Skip to content

Commit b2105d4

Browse files
committed
General tweaks
1 parent e4cb413 commit b2105d4

File tree

3 files changed

+74
-75
lines changed

3 files changed

+74
-75
lines changed

Assets/RTLTMPro/RTLDefaultControls.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ public struct Resources
2121
private const float kThickHeight = 30f;
2222
private const float kThinHeight = 20f;
2323
private static Vector2 s_ThickElementSize = new Vector2(kWidth, kThickHeight);
24+
2425
private static Vector2 s_ThinElementSize = new Vector2(kWidth, kThinHeight);
26+
2527
//private static Vector2 s_ImageElementSize = new Vector2(100f, 100f);
2628
private static Color s_DefaultSelectableColor = new Color(1f, 1f, 1f, 1f);
29+
2730
//private static Color s_PanelColor = new Color(1f, 1f, 1f, 0.392f);
2831
private static Color s_TextColor = new Color(50f / 255f, 50f / 255f, 50f / 255f, 1f);
2932

@@ -148,15 +151,18 @@ public static GameObject CreateInputField(Resources resources)
148151
text.extraPadding = true;
149152
text.richText = true;
150153
text.autoSizeTextContainer = true;
154+
text.enableAutoSizing = true;
151155
text.fontSizeMin = 10;
152156
text.fontSizeMax = 100;
157+
text.margin = new Vector4(0, 0, 0, 4.5f);
153158
text.alignment = TextAlignmentOptions.Right;
154159
SetDefaultTextValues(text);
155160

156161
RTLTextMeshPro placeholder = childPlaceholder.AddComponent<RTLTextMeshPro>();
157-
placeholder.text = "Enter text...";
162+
placeholder.text = "Enter Text...";
158163
placeholder.fontSize = 14;
159164
placeholder.autoSizeTextContainer = true;
165+
placeholder.enableAutoSizing = true;
160166
placeholder.fontSizeMin = 10;
161167
placeholder.fontSizeMax = 100;
162168
placeholder.fontStyle = FontStyles.Italic;
@@ -244,8 +250,8 @@ public static GameObject CreateDropdown(Resources resources)
244250
templateImage.type = Image.Type.Sliced;
245251

246252
ScrollRect templateScrollRect = template.AddComponent<ScrollRect>();
247-
templateScrollRect.content = (RectTransform)content.transform;
248-
templateScrollRect.viewport = (RectTransform)viewport.transform;
253+
templateScrollRect.content = (RectTransform) content.transform;
254+
templateScrollRect.viewport = (RectTransform) viewport.transform;
249255
templateScrollRect.horizontal = false;
250256
templateScrollRect.movementType = ScrollRect.MovementType.Clamped;
251257
templateScrollRect.verticalScrollbar = scrollbarScrollbar;
@@ -282,9 +288,9 @@ public static GameObject CreateDropdown(Resources resources)
282288

283289
// Setting default Item list.
284290
itemLabelText.text = "Option A";
285-
dropdown.options.Add(new TMP_Dropdown.OptionData {text = "Option A" });
286-
dropdown.options.Add(new TMP_Dropdown.OptionData {text = "Option B" });
287-
dropdown.options.Add(new TMP_Dropdown.OptionData {text = "Option C" });
291+
dropdown.options.Add(new TMP_Dropdown.OptionData { text = "Option A" });
292+
dropdown.options.Add(new TMP_Dropdown.OptionData { text = "Option B" });
293+
dropdown.options.Add(new TMP_Dropdown.OptionData { text = "Option C" });
288294
dropdown.RefreshShownValue();
289295

290296
// Set up RectTransforms.

Assets/RTLTMPro/Scenes/Dropdown.unity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ RectTransform:
796796
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
797797
m_AnchorMin: {x: 0.5, y: 0.5}
798798
m_AnchorMax: {x: 0.5, y: 0.5}
799-
m_AnchoredPosition: {x: 56.8, y: 10.6}
799+
m_AnchoredPosition: {x: 0.000011444, y: 0.000024796}
800800
m_SizeDelta: {x: 273.5, y: 51.3}
801801
m_Pivot: {x: 0.5, y: 0.5}
802802
--- !u!114 &1251315540

0 commit comments

Comments
 (0)