mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 03:53:04 +00:00
apply min button width and height in main menu
This commit is contained in:
parent
f28aeeb82a
commit
920d4e00b4
3 changed files with 17 additions and 2 deletions
|
@ -100,7 +100,7 @@ namespace SanAndreasUnity.UI
|
|||
|
||||
public static bool DrawMenuEntry(string text)
|
||||
{
|
||||
return GUIUtils.ButtonWithCalculatedSize(text);
|
||||
return GUIUtils.ButtonWithCalculatedSize(text, Instance.minButtonWidth, Instance.minButtonHeight);
|
||||
}
|
||||
|
||||
public static void RegisterMenuEntry (MenuEntry menuEntry)
|
||||
|
|
|
@ -85,9 +85,24 @@ namespace SanAndreasUnity.Utilities
|
|||
return ButtonWithCalculatedSize(new GUIContent(text));
|
||||
}
|
||||
|
||||
public static bool ButtonWithCalculatedSize(string text, float minWidth, float minHeight)
|
||||
{
|
||||
return ButtonWithCalculatedSize(new GUIContent(text), minWidth, minHeight);
|
||||
}
|
||||
|
||||
public static bool ButtonWithCalculatedSize(GUIContent content)
|
||||
{
|
||||
return ButtonWithCalculatedSize(content, 0f, 0f);
|
||||
}
|
||||
|
||||
public static bool ButtonWithCalculatedSize(GUIContent content, float minWidth, float minHeight)
|
||||
{
|
||||
Vector2 size = CalcScreenSizeForContent (content, GUI.skin.button);
|
||||
|
||||
if (size.x < minWidth)
|
||||
size.x = minWidth;
|
||||
if (size.y < minHeight)
|
||||
size.y = minHeight;
|
||||
|
||||
return GUILayout.Button (content, GUILayout.Width (size.x), GUILayout.Height (size.y));
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
- Chat
|
||||
|
||||
- Android: set font size to 20 ; adapt UI: StartGame scrollview style, JoinGame scrollview style, main menu, options (save, load, use box as scrollview style, size), Utilities size, file browser size ; sliders should be larger ; camera zoom should be configurable (no need for persistence) ; use unsigned (debug) key alias ; increment build number ; test at 800x480 resolution ;
|
||||
- Android: set font size to 23 ; adapt UI: main menu (add min button size), options (save, load, size), Utilities size, file browser size ; sliders should be larger ; camera zoom should be configurable (no need for persistence) ; use unsigned (debug) key alias ; increment build number ; test at 800x480 resolution ;
|
||||
|
||||
- Touch input:
|
||||
|
||||
|
|
Loading…
Reference in a new issue