24 lines
2.0 KiB
XML
24 lines
2.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<UXML xmlns="UnityEngine.UIElements" xmlns:utk="UVC.UIToolkit">
|
|
<Style src="../UTKSampleCommon.uss" />
|
|
<Style src="UTKVectorFieldSample.uss" />
|
|
|
|
<VisualElement class="utk-sample-container">
|
|
<Label class="utk-sample-desc" text="Rect 입력 필드 (x, y, width, height)" />
|
|
|
|
<!-- Default -->
|
|
<VisualElement class="utk-sample-section">
|
|
<Label class="utk-sample-section__title" text="Default" />
|
|
<VisualElement class="utk-sample-row">
|
|
<utk:UTKRectField name="rect-area" label="Area" class="utk-sample-rect-field" />
|
|
</VisualElement>
|
|
</VisualElement>
|
|
|
|
<!-- Code Sample -->
|
|
<VisualElement class="utk-code-sample-container">
|
|
<utk:UTKCodeBlock title="C#" code="// 기본 Rect 필드 생성 var rectField = new UTKRectField(); rectField.label = "UI 영역"; rectField.Value = new Rect(0, 0, 100, 50); // 값 변경 이벤트 rectField.OnValueChanged += (rect) => { Debug.Log($"위치: ({rect.x}, {rect.y}), 크기: {rect.width} x {rect.height}"); }; // 라벨 생성자 사용 var namedField = new UTKRectField("클리핑 영역"); // 축 라벨 커스터마이징 rectField.XLabel = "Left"; rectField.YLabel = "Top"; rectField.WLabel = "Width"; rectField.HLabel = "Height";" />
|
|
<utk:UTKCodeBlock title="UXML" code="<!-- 기본 Rect 필드 --> <utk:UTKRectField label="영역" /> <!-- 커스텀 라벨 --> <utk:UTKRectField label="스프라이트 영역" XLabel="Left" YLabel="Top" WLabel="W" HLabel="H" /> <!-- 비활성화 상태 --> <utk:UTKRectField label="읽기 전용" IsEnabled="false" />" />
|
|
</VisualElement>
|
|
</VisualElement>
|
|
</UXML>
|