mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-22 12:03:04 +00:00
font size changes with screen resolution
This commit is contained in:
parent
2f9c78bd6f
commit
c03e940847
2 changed files with 7 additions and 2 deletions
|
@ -31,6 +31,8 @@ namespace SanAndreasUnity.Behaviours
|
|||
public int ImguiFontSize { get => m_imguiFontSize; set { m_imguiFontSize = value; m_shouldChangeFontSize = true; } }
|
||||
|
||||
[SerializeField] int m_defaultFontSizeOnMobile = 16;
|
||||
[SerializeField] int m_referenceScreenHeightForFontSize = 720;
|
||||
[SerializeField] int m_maxFontSize = 23;
|
||||
[SerializeField] bool m_changeFontSizeInEditor = false;
|
||||
|
||||
[SerializeField] float m_scrollbarSizeMultiplierOnMobile = 2f;
|
||||
|
@ -55,7 +57,10 @@ namespace SanAndreasUnity.Behaviours
|
|||
// set default font size on mobile platforms
|
||||
if (Application.isMobilePlatform || (m_changeFontSizeInEditor && Application.isEditor))
|
||||
{
|
||||
this.ImguiFontSize = m_defaultFontSizeOnMobile;
|
||||
int fontSize = Mathf.RoundToInt( m_defaultFontSizeOnMobile / (float) m_referenceScreenHeightForFontSize * Screen.height );
|
||||
if (fontSize > m_maxFontSize)
|
||||
fontSize = m_maxFontSize;
|
||||
this.ImguiFontSize = fontSize;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
- Chat
|
||||
|
||||
- Android: set font size to 23 ; adapt UI: Utilities size, vehicle spawner button width ; 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: adapt UI: Utilities size ; use unsigned (debug) key alias ; increment build number ; test at 800x480 resolution ; time scale affects physics update rate setting ;
|
||||
|
||||
- Touch input:
|
||||
|
||||
|
|
Loading…
Reference in a new issue