@@ -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.
0 commit comments