def pbDrawTextPositions now uses symbols for text alignment and outline, and added a quicker way to draw text with no shadow/outline

This commit is contained in:
Maruno17
2023-04-04 21:16:09 +01:00
parent e7847fba9a
commit cb4a1fd8af
27 changed files with 295 additions and 279 deletions

View File

@@ -358,7 +358,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
# code to ensure the font is an appropriate color.
moveNameBase = button.bitmap.get_pixel(10, button.src_rect.y + 34)
end
textPos.push([moves[i].name, x, y, 2, moveNameBase, TEXT_SHADOW_COLOR])
textPos.push([moves[i].name, x, y, :center, moveNameBase, TEXT_SHADOW_COLOR])
end
pbDrawTextPositions(@overlay.bitmap, textPos)
end
@@ -408,7 +408,7 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase
ppFraction = [(4.0 * move.pp / move.total_pp).ceil, 3].min
textPos = []
textPos.push([_INTL("PP: {1}/{2}", move.pp, move.total_pp),
448, 56, 2, PP_COLORS[ppFraction * 2], PP_COLORS[(ppFraction * 2) + 1]])
448, 56, :center, PP_COLORS[ppFraction * 2], PP_COLORS[(ppFraction * 2) + 1]])
pbDrawTextPositions(@infoOverlay.bitmap, textPos)
end
end
@@ -540,7 +540,7 @@ class Battle::Scene::TargetMenu < Battle::Scene::MenuBase
next if !button || nil_or_empty?(@texts[i])
x = button.x - self.x + (button.src_rect.width / 2)
y = button.y - self.y + 14
textpos.push([@texts[i], x, y, 2, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR])
textpos.push([@texts[i], x, y, :center, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR])
end
pbDrawTextPositions(@overlay.bitmap, textpos)
end

View File

@@ -214,7 +214,7 @@ class Battle::Scene::PokemonDataBox < Sprite
nameOffset = 0
nameOffset = nameWidth - 116 if nameWidth > 116
pbDrawTextPositions(self.bitmap,
[[@battler.name, @spriteBaseX + 8 - nameOffset, 12, false, NAME_BASE_COLOR, NAME_SHADOW_COLOR]]
[[@battler.name, @spriteBaseX + 8 - nameOffset, 12, :left, NAME_BASE_COLOR, NAME_SHADOW_COLOR]]
)
end
@@ -233,7 +233,7 @@ class Battle::Scene::PokemonDataBox < Sprite
gender_text = (gender == 0) ? _INTL("") : _INTL("")
base_color = (gender == 0) ? MALE_BASE_COLOR : FEMALE_BASE_COLOR
shadow_color = (gender == 0) ? MALE_SHADOW_COLOR : FEMALE_SHADOW_COLOR
pbDrawTextPositions(self.bitmap, [[gender_text, @spriteBaseX + 126, 12, false, base_color, shadow_color]])
pbDrawTextPositions(self.bitmap, [[gender_text, @spriteBaseX + 126, 12, :left, base_color, shadow_color]])
end
def draw_status
@@ -479,12 +479,13 @@ class Battle::Scene::AbilitySplashBar < Sprite
return if !@battler
textPos = []
textX = (@side == 0) ? 10 : self.bitmap.width - 8
align = (@side == 0) ? :left : :right
# Draw Pokémon's name
textPos.push([_INTL("{1}'s", @battler.name), textX, 8, @side == 1,
TEXT_BASE_COLOR, TEXT_SHADOW_COLOR, true])
textPos.push([_INTL("{1}'s", @battler.name), textX, 8, align,
TEXT_BASE_COLOR, TEXT_SHADOW_COLOR, :outline])
# Draw Pokémon's ability
textPos.push([@battler.abilityName, textX, 38, @side == 1,
TEXT_BASE_COLOR, TEXT_SHADOW_COLOR, true])
textPos.push([@battler.abilityName, textX, 38, align,
TEXT_BASE_COLOR, TEXT_SHADOW_COLOR, :outline])
pbDrawTextPositions(self.bitmap, textPos)
end