Added fonts and text scaling
This commit is contained in:
@@ -49,7 +49,7 @@ TextureImporter:
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 3
|
||||
spriteBorder: {x: 6, y: 6, z: 6, w: 6}
|
||||
spriteBorder: {x: 8, y: 8, z: 8, w: 8}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
|
||||
8
Assets/Fonts.meta
Normal file
8
Assets/Fonts.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 210940a104e948648bb2633dee5b3daa
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Fonts/editundo.ttf
Normal file
BIN
Assets/Fonts/editundo.ttf
Normal file
Binary file not shown.
21
Assets/Fonts/editundo.ttf.meta
Normal file
21
Assets/Fonts/editundo.ttf.meta
Normal file
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 25598a8975ed29243bb850b56f191920
|
||||
TrueTypeFontImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
fontSize: 16
|
||||
forceTextureCase: -2
|
||||
characterSpacing: 0
|
||||
characterPadding: 1
|
||||
includeFontData: 1
|
||||
fontNames:
|
||||
- Edit Undo BRK
|
||||
fallbackFontReferences: []
|
||||
customCharacters:
|
||||
fontRenderingMode: 0
|
||||
ascentCalculationMode: 1
|
||||
useLegacyBoundsCalculation: 0
|
||||
shouldRoundAdvanceValue: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Fonts/ka1.ttf
Normal file
BIN
Assets/Fonts/ka1.ttf
Normal file
Binary file not shown.
21
Assets/Fonts/ka1.ttf.meta
Normal file
21
Assets/Fonts/ka1.ttf.meta
Normal file
@@ -0,0 +1,21 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32565b2e72182494c8e58dae1ee512b0
|
||||
TrueTypeFontImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 4
|
||||
fontSize: 16
|
||||
forceTextureCase: -2
|
||||
characterSpacing: 0
|
||||
characterPadding: 1
|
||||
includeFontData: 1
|
||||
fontNames:
|
||||
- Karmatic Arcade
|
||||
fallbackFontReferences: []
|
||||
customCharacters:
|
||||
fontRenderingMode: 0
|
||||
ascentCalculationMode: 1
|
||||
useLegacyBoundsCalculation: 0
|
||||
shouldRoundAdvanceValue: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -44,9 +44,12 @@ namespace Fruitomation.UI
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
AttachedText = gameObject.GetComponentInChildren<Text>();
|
||||
AttachedText.fontSize = 30;
|
||||
const int TEXT_SCALAR = 5;
|
||||
|
||||
AttachedText = gameObject.GetComponentInChildren<Text>();
|
||||
AttachedText.transform.localScale = new Vector3(1f / TEXT_SCALAR, 1f / TEXT_SCALAR, 1f);
|
||||
AttachedText.fontSize = BigText ? 50 * TEXT_SCALAR : 35 * TEXT_SCALAR;
|
||||
|
||||
AttachedButton = GetComponent<Button>();
|
||||
|
||||
AttachedButton.onClick.AddListener(() => { UpgradeManager.Unlock(Upgrade); });
|
||||
@@ -145,7 +148,8 @@ namespace Fruitomation.UI
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/questions/27040325/c-sharp-regex-to-convert-camelcase-to-sentence-case
|
||||
string formatted = Regex.Replace(Upgrade.ToString(), @"[A-Z]", " $0");
|
||||
string formatted = Regex.Replace(Upgrade.ToString(), @"[A-Z]", " $0")[1..];
|
||||
|
||||
AttachedText.text = State == UpgradeState.Hidden
|
||||
? "???"
|
||||
: $"{formatted}\n{Cost.AsString()}";
|
||||
@@ -153,4 +157,4 @@ namespace Fruitomation.UI
|
||||
|
||||
private bool IsUnlocked => State == UpgradeState.Unlocked;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user