Files
XRLib/Assets/Resources/UIToolkit/Sample/Label/UTKLabelSample.uxml
2026-01-21 20:43:54 +09:00

74 lines
4.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<UXML xmlns="UnityEngine.UIElements" xmlns:utk="UVC.UIToolkit">
<Style src="../UTKSampleCommon.uss" />
<Style src="UTKLabelSample.uss" />
<VisualElement class="utk-sample-container">
<Label class="utk-sample-desc" text="다양한 크기와 아이콘을 지원하는 라벨 컴포넌트" />
<!-- Text Sizes -->
<VisualElement class="utk-sample-section">
<Label class="utk-sample-section__title" text="Text Sizes" />
<VisualElement class="utk-sample-column">
<utk:UTKLabel name="label-h1" text="H1 Heading" size="H1" />
<utk:UTKLabel name="label-h2" text="H2 Heading" size="H2" />
<utk:UTKLabel name="label-h3" text="H3 Heading" size="H3" />
<utk:UTKLabel name="label-body1" text="Body1 Text" size="Body1" />
<utk:UTKLabel name="label-body2" text="Body2 Text" size="Body2" />
<utk:UTKLabel name="label-caption" text="Caption Text" size="Caption" />
</VisualElement>
</VisualElement>
<!-- Material Icon + Text -->
<VisualElement class="utk-sample-section">
<Label class="utk-sample-section__title" text="Material Icon + Text" />
<VisualElement class="utk-sample-row" name="material-icon-row">
<!-- Labels with material icons will be created via C# -->
</VisualElement>
</VisualElement>
<!-- Icon Right -->
<VisualElement class="utk-sample-section">
<Label class="utk-sample-section__title" text="Icon Right" />
<VisualElement class="utk-sample-row" name="icon-right-row">
<!-- Labels with icons on right will be created via C# -->
</VisualElement>
</VisualElement>
<!-- Image Icon + Text -->
<VisualElement class="utk-sample-section">
<Label class="utk-sample-section__title" text="Image Icon + Text" />
<VisualElement class="utk-sample-row" name="image-icon-row">
<!-- Labels with image icons will be created via C# -->
</VisualElement>
</VisualElement>
<!-- Material Icon Only -->
<VisualElement class="utk-sample-section">
<Label class="utk-sample-section__title" text="Material Icon Only" />
<VisualElement class="utk-sample-row" name="material-icon-only-row">
<!-- Icon-only labels will be created via C# -->
</VisualElement>
</VisualElement>
<!-- Variants -->
<VisualElement class="utk-sample-section">
<Label class="utk-sample-section__title" text="Variants" />
<VisualElement class="utk-sample-row">
<utk:UTKLabel name="label-primary" text="Primary" variant="Primary" />
<utk:UTKLabel name="label-secondary" text="Secondary" variant="Secondary" />
<utk:UTKLabel name="label-success" text="Success" variant="Success" />
<utk:UTKLabel name="label-warning" text="Warning" variant="Warning" />
<utk:UTKLabel name="label-error" text="Error" variant="Error" />
<utk:UTKLabel name="label-disabled" text="Disabled" variant="Disabled" />
</VisualElement>
</VisualElement>
<!-- Code Sample -->
<VisualElement class="utk-code-sample-container">
<utk:UTKCodeBlock title="C#" code="// 기본 라벨&#10;var label = new UTKLabel();&#10;label.Text = &quot;안녕하세요&quot;;&#10;label.Size = UTKLabel.LabelSize.Body1;&#10;label.Variant = UTKLabel.LabelVariant.Primary;&#10;&#10;// 제목 스타일&#10;var title = new UTKLabel();&#10;title.Text = &quot;제목&quot;;&#10;title.Size = UTKLabel.LabelSize.Heading1;&#10;title.IsBold = true;&#10;&#10;// Material Icon과 텍스트 함께 사용&#10;var iconLabel = new UTKLabel(&quot;설정&quot;, UTKMaterialIcons.Settings);&#10;&#10;// Material Icon만 사용&#10;var iconOnly = new UTKLabel(UTKMaterialIcons.Home);" />
<utk:UTKCodeBlock title="UXML" code="&lt;!-- 기본 라벨 --&gt;&#10;&lt;utk:UTKLabel text=&quot;일반 텍스트&quot; /&gt;&#10;&#10;&lt;!-- 제목 --&gt;&#10;&lt;utk:UTKLabel text=&quot;제목&quot; size=&quot;H1&quot; is-bold=&quot;true&quot; /&gt;&#10;&#10;&lt;!-- 보조 텍스트 --&gt;&#10;&lt;utk:UTKLabel text=&quot;설명&quot; size=&quot;Caption&quot; variant=&quot;Secondary&quot; /&gt;&#10;&#10;&lt;!-- Material Icon과 텍스트 --&gt;&#10;&lt;utk:UTKLabel text=&quot;설정&quot; material-icon=&quot;settings&quot; /&gt;&#10;&#10;&lt;!-- 아이콘 오른쪽 배치 --&gt;&#10;&lt;utk:UTKLabel text=&quot;다음&quot; material-icon=&quot;arrow_forward&quot; icon-placement=&quot;Right&quot; /&gt;" />
</VisualElement>
</VisualElement>
</UXML>