Fixed missing characters in fonts, aligned text

When renaming a pokémon, the input box and the header text messages were off-center so I fixed that
Added some missing characters to the fonts, including the male and female symbols
This commit is contained in:
JappaWakka 2022-06-02 12:58:54 +02:00
parent f3b1face86
commit 0a47307a7c
6 changed files with 16 additions and 31 deletions

View File

@ -104,24 +104,16 @@ Public Class NameObjectScreen
If _askedRename = False Then
Dim genderString As String = ""
Dim genderUnicode As Integer = 0
If _renamePokemon = True Then
If _pokemon.Gender = Pokemon.Genders.Male Then
genderString = " "
genderUnicode = 156
genderString = ""
ElseIf _pokemon.Gender = Pokemon.Genders.Female Then
genderString = " "
genderUnicode = 157
genderString = ""
End If
End If
Core.SpriteBatch.DrawString(FontManager.InGameFont, "Rename " & Me._defaultName & genderString & "?", New Vector2(CInt(Core.windowSize.Width / 2) - 182 + 25, 93), Color.Black)
Core.SpriteBatch.DrawString(FontManager.InGameFont, "Rename " & Me._defaultName & genderString & "?", New Vector2(CInt(Core.windowSize.Width / 2) - 182 + 22, 90), Color.White)
If genderUnicode <> 0 Then
Core.SpriteBatch.DrawString(FontManager.TextFont, StringHelper.GetChar(genderUnicode), New Vector2(CInt(Core.windowSize.Width / 2) + FontManager.InGameFont.MeasureString("Rename " & Me._defaultName).X - 147, 93), Color.Black, 0.0F, Vector2.Zero, 2.0F, SpriteEffects.None, 0.0F)
Core.SpriteBatch.DrawString(FontManager.TextFont, StringHelper.GetChar(genderUnicode), New Vector2(CInt(Core.windowSize.Width / 2) + FontManager.InGameFont.MeasureString("Rename " & Me._defaultName).X - 150, 90), Color.White, 0.0F, Vector2.Zero, 2.0F, SpriteEffects.None, 0.0F)
End If
Core.SpriteBatch.DrawString(FontManager.InGameFont, "Rename " & Me._defaultName & genderString & "?", New Vector2(CInt(Core.windowSize.Width / 2) - CInt(FontManager.InGameFont.MeasureString("Rename " & Me._defaultName & genderString & "?").X / 2) + 2, 96 + 2), Color.Black)
Core.SpriteBatch.DrawString(FontManager.InGameFont, "Rename " & Me._defaultName & genderString & "?", New Vector2(CInt(Core.windowSize.Width / 2) - CInt(FontManager.InGameFont.MeasureString("Rename " & Me._defaultName & genderString & "?").X / 2), 96), Color.White)
ChooseBox.Showing = False
Else
@ -130,23 +122,16 @@ Public Class NameObjectScreen
Dim genderUnicode As Integer = 0
If _renamePokemon = True Then
If _pokemon.Gender = Pokemon.Genders.Male Then
genderString = " "
genderUnicode = 156
genderString = ""
ElseIf _pokemon.Gender = Pokemon.Genders.Female Then
genderString = " "
genderUnicode = 157
genderString = ""
End If
End If
Core.SpriteBatch.DrawString(FontManager.InGameFont, "Enter name for " & Me._defaultName & genderString & ":", New Vector2(CInt(Core.windowSize.Width / 2) - 182 + 25, 93), Color.Black)
Core.SpriteBatch.DrawString(FontManager.InGameFont, "Enter name for " & Me._defaultName & genderString & ":", New Vector2(CInt(Core.windowSize.Width / 2) - 182 + 22, 90), Color.White)
Core.SpriteBatch.DrawString(FontManager.InGameFont, "Enter name for " & Me._defaultName & genderString & ":", New Vector2(CInt(Core.windowSize.Width / 2) - CInt(FontManager.InGameFont.MeasureString("Enter name for " & Me._defaultName & genderString & ":").X / 2) + 2, 96 + 2), Color.Black)
Core.SpriteBatch.DrawString(FontManager.InGameFont, "Enter name for " & Me._defaultName & genderString & ":", New Vector2(CInt(Core.windowSize.Width / 2) - CInt(FontManager.InGameFont.MeasureString("Enter name for " & Me._defaultName & genderString & ":").X / 2), 96), Color.White)
If genderUnicode <> 0 Then
Core.SpriteBatch.DrawString(FontManager.TextFont, StringHelper.GetChar(genderUnicode), New Vector2(CInt(Core.windowSize.Width / 2) + FontManager.InGameFont.MeasureString("Enter name for " & Me._defaultName).X - 150, 93), Color.Black, 0.0F, Vector2.Zero, 2.0F, SpriteEffects.None, 0.0F)
Core.SpriteBatch.DrawString(FontManager.TextFont, StringHelper.GetChar(genderUnicode), New Vector2(CInt(Core.windowSize.Width / 2) + FontManager.InGameFont.MeasureString("Enter name for " & Me._defaultName).X - 153, 90), Color.White, 0.0F, Vector2.Zero, 2.0F, SpriteEffects.None, 0.0F)
End If
Canvas.DrawRectangle(New Rectangle(CInt(Core.windowSize.Width / 2) - 89, 136, 208, 32), New Color(101, 142, 255))
Canvas.DrawRectangle(New Rectangle(CInt(TextboxPosition().X) - 4, CInt(TextboxPosition().Y) - 4, 320 + 8, 32), New Color(101, 142, 255))
DrawTextBox()
End If
End If
@ -156,17 +141,17 @@ Public Class NameObjectScreen
End Sub
Private Function TextboxPosition() As Vector2
Return New Vector2(CInt(Core.windowSize.Width / 2) - 85, 140)
Return New Vector2(CInt(Core.windowSize.Width / 2) - 160, 140)
End Function
Private Sub DrawTextBox()
Canvas.DrawRectangle(New Rectangle(CInt(Core.windowSize.Width / 2) - 85, 140, 200, 24), Color.White)
Canvas.DrawRectangle(New Rectangle(CInt(TextboxPosition().X), CInt(TextboxPosition().Y), 320, 24), Color.White)
Dim t As String = Me._currentText
If t.Length < 20 Then
t &= "_"
End If
Core.SpriteBatch.DrawString(FontManager.MiniFont, t, TextboxPosition(), Color.Black)
Core.SpriteBatch.DrawString(FontManager.InGameFont, t, TextboxPosition(), Color.Black)
End Sub
Public Overrides Sub Update()

View File

@ -38,7 +38,7 @@
/importer:LocalizedFontTextureImporter
/processor:LocalizedFontTextureProcessor
/processorParam:DefaultCharacter=?
/processorParam:FirstCharacter=
/processorParam:FirstCharacter=
/processorParam:PremultiplyAlpha=True
/processorParam:TextureFormat=Color
/build:Fonts/BMP/chatFont.png
@ -50,7 +50,7 @@
/importer:LocalizedFontTextureImporter
/processor:LocalizedFontTextureProcessor
/processorParam:DefaultCharacter=?
/processorParam:FirstCharacter=
/processorParam:FirstCharacter=
/processorParam:PremultiplyAlpha=True
/processorParam:TextureFormat=Color
/build:Fonts/BMP/InGame.png
@ -59,7 +59,7 @@
/importer:LocalizedFontTextureImporter
/processor:LocalizedFontTextureProcessor
/processorParam:DefaultCharacter=?
/processorParam:FirstCharacter=
/processorParam:FirstCharacter=
/processorParam:PremultiplyAlpha=True
/processorParam:TextureFormat=Color
/build:Fonts/BMP/mainFont.png
@ -75,7 +75,7 @@
/importer:LocalizedFontTextureImporter
/processor:LocalizedFontTextureProcessor
/processorParam:DefaultCharacter=?
/processorParam:FirstCharacter=
/processorParam:FirstCharacter=
/processorParam:PremultiplyAlpha=True
/processorParam:TextureFormat=Color
/build:Fonts/BMP/TextFont.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB