PartText

1 つのテキスト レイアウト要素を含むウォッチフェイスの部分を表します。

Wear OS 4 で導入されました。

構文

<PartText x="integer" y="integer" width="integer" height="integer"
           pivotX="float" pivotY="float" angle="float-degrees" alpha="integer"
           name="string" scaleX="float" scaleY="float"
           renderMode="[SOURCE | MASK | ALL]"
           tintColor="argb-color | rgb-color">
    <!-- Text-specific child elements. -->
    <Text>
        <!-- There must be raw text as the leaf inner element within a
            "PartText" element tree. -->
        <Font family="font" size="20" color="#00FFFF">Hello world
        </Font>
        <Font>
            <!-- Example of a text decoration element. -->
            <Outline>
                <!-- Example of a template with 2 string values. -->
                <Template>%s %s
                    <Parameter expression="[MONTH_S]" />
                    <Parameter expression="[DAY]" />
                </Template>
            </Outline>
            <!-- Example of a text formatting element. -->
            <Upper>
                <Template ... />
            </Upper>
            <Template ... />
        </Font>
    </Text>
    <!-- A "PartText" element can contain this "TextCircular" element instead
         of a "Text" element. -->
    <TextCircular centerX="180" centerY="180" direction="COUNTER_CLOCKWISE"
                  endAngle="90" height="340" width="340" startAngle="270">
        There must be raw text as the leaf inner element within a "PartText"
        element tree.
        <Font family="font" size="20" color="#00FFFF">Hello world
        </Font>
        <Font>
            Example of a text decoration element.
            <Outline>
                Example of a template with 2 string values.
                <Template>%s %s
                    <Parameter expression="[MONTH_S]" />
                    <Parameter expression="[DAY]" />
                </Template>
            </Outline>
            Example of a text formatting element.
            <Upper>
                <Template ... />
            </Upper>
            <Template ... />
        </Font>
    </TextCircular />
    -->

    <!-- Child elements that are shared across all "Part" elements. -->
    <Localization .../>
    <Transform .../>
    <Variant .../>
    <Gyro .../>
    <Launch .../>
    <ScreenReader .../>
</PartText>

属性

PartText 要素には次の属性があります。

必須属性

次の属性は必須です。

xywidthheight
要素のサイズと位置を指定する整数のコレクション。

オプションの属性

次の属性は省略可能です。

pivotXpivotY
要素が回転する中心となる 2 次元のピボット ポイント。どちらの値も浮動小数点数であり、$ [0, 1] $ の範囲に収まるように調整されます。
angle
ピボット ポイントを中心にして要素が回転する時計回りの角度。
alpha
この要素の透過性レベルを設定します。値 0 は要素が完全に透明であることを表します。値 255 は要素が完全に不透明であることを表します。
name
この要素を識別する文字列です。この要素をウォッチフェイス ファイル内の別の場所から参照する必要がある場合に便利です。
scaleX
この要素に適用する水平方向のスケーリング ファクタ。
scaleY
この要素に適用する垂直方向のスケーリング ファクタ。
renderMode
要素のレンダリング モードのタイプ。有効な値は SOURCE(デフォルト)、MASK、または ALL です。
tintColor
要素に色合い調整フィルタを適用します。ARGB 形式(#ff000000 = 不透明な黒)または RGB 形式(#000000 = 黒)を使用して、色を指定する必要があります。

内部要素

PartText 要素には、次の内部要素を含めることができます。Text または TextCircular が内部要素のいずれかであることを除き、すべての要素は省略可能です。PartText 要素には、各内部要素を無制限に含められます(それぞれ 1 回までしか表示できない TextTextCircularLocalizationGyroLaunchScreenReader は除く)。

  • 注: JavaScript がオフになっている場合はリンクテキストが表示されます
  • Group
  • PartImage
  • PartDraw