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

@@ -1,5 +1,5 @@
#===============================================================================
# Text colours
# Text colors
#===============================================================================
# TODO: Unused.
def ctag(color)
@@ -1033,6 +1033,16 @@ def pbDrawShadow(bitmap, x, y, width, height, string)
pbDrawShadowText(bitmap, x, y, width, height, string, nil, bitmap.font.color)
end
def pbDrawPlainText(bitmap, x, y, width, height, string, baseColor, align = 0)
return if !bitmap || !string
width = (width < 0) ? bitmap.text_size(string).width + 1 : width
height = (height < 0) ? bitmap.text_size(string).height + 1 : height
if baseColor && baseColor.alpha > 0
bitmap.font.color = baseColor
bitmap.draw_text(x, y, width, height, string, align)
end
end
def pbDrawShadowText(bitmap, x, y, width, height, string, baseColor, shadowColor = nil, align = 0)
return if !bitmap || !string
width = (width < 0) ? bitmap.text_size(string).width + 1 : width
@@ -1075,24 +1085,29 @@ end
# 0 - Text to draw
# 1 - X coordinate
# 2 - Y coordinate
# 3 - If true or 1, the text is right aligned. If 2, the text is centered.
# Otherwise, the text is left aligned.
# 3 - Text alignment. Is one of :left (or false or 0), :right (or true or 1) or
# :center (or 2). If anything else, the text is left aligned.
# 4 - Base color
# 5 - Shadow color
# 6 - If true or 1, the text has an outline. Otherwise, the text has a shadow.
# 5 - Shadow color. If nil, there is no shadow.
# 6 - If :outline (or true or 1), the text has a full outline. If :none (or the
# shadow color is nil), there is no shadow. Otherwise, the text has a shadow.
def pbDrawTextPositions(bitmap, textpos)
textpos.each do |i|
textsize = bitmap.text_size(i[0])
x = i[1]
y = i[2]
case i[3]
when true, 1 # right align
when :right, true, 1 # right align
x -= textsize.width
when 2 # centered
when :center, 2 # centered
x -= (textsize.width / 2)
end
if i[6] == true || i[6] == 1 # outline text
i[6] = :none if !i[5] # No shadow color given, draw plain text
case i[6]
when :outline, true, 1 # outline text
pbDrawOutlineText(bitmap, x, y, textsize.width, textsize.height, i[0], i[4], i[5])
when :none
pbDrawPlainText(bitmap, x, y, textsize.width, textsize.height, i[0], i[4])
else
pbDrawShadowText(bitmap, x, y, textsize.width, textsize.height, i[0], i[4], i[5])
end

View File

@@ -1302,7 +1302,7 @@ module Transitions
@text_sprite.visible = false
pbSetSystemFont(@text_sprite.bitmap)
pbDrawTextPositions(@text_sprite.bitmap,
[[$game_temp.transition_animation_data[1], 244, 86, 0,
[[$game_temp.transition_animation_data[1], 244, 86, :left,
Color.new(248, 248, 248), Color.new(72, 80, 80)]])
# Foreground black
@black_sprite = new_sprite(0, 0, @black_bitmap)
@@ -1497,7 +1497,7 @@ module Transitions
@text_sprite.z = 8
pbSetSystemFont(@text_sprite.bitmap)
pbDrawTextPositions(@text_sprite.bitmap,
[[$game_temp.transition_animation_data[1], 160, 86, 0,
[[$game_temp.transition_animation_data[1], 160, 86, :left,
Color.new(248, 248, 248), Color.new(72, 80, 80)]])
# VS logo
@vs_main_sprite = new_sprite(Graphics.width / 2, Graphics.height / 2, @vs_1_bitmap,
@@ -1804,7 +1804,7 @@ module Transitions
@text_sprite.visible = false
pbSetSystemFont(@text_sprite.bitmap)
pbDrawTextPositions(@text_sprite.bitmap,
[[$game_temp.transition_animation_data[1], 272, 8, 0,
[[$game_temp.transition_animation_data[1], 272, 8, :left,
Color.new(248, 248, 248), Color.new(72, 80, 80)]])
# Foreground black
@black_sprite = new_sprite(0, 0, @black_bitmap)

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

View File

@@ -81,8 +81,8 @@ class Battle::Scene::SafariDataBox < Sprite
base = Color.new(72, 72, 72)
shadow = Color.new(184, 184, 184)
textpos = []
textpos.push([_INTL("Safari Balls"), 30, 14, false, base, shadow])
textpos.push([_INTL("Left: {1}", @battle.ballCount), 30, 44, false, base, shadow])
textpos.push([_INTL("Safari Balls"), 30, 14, :left, base, shadow])
textpos.push([_INTL("Left: {1}", @battle.ballCount), 30, 44, :left, base, shadow])
pbDrawTextPositions(self.bitmap, textpos)
end

View File

@@ -235,15 +235,15 @@ class Battle::Scene
window.contents.clear
pbSetSystemFont(window.contents)
textpos = [
[battler1.name, 64, 6, 2, Color.new(248, 0, 0), Color.new(208, 208, 200)],
[_INTL("VS"), 144, 6, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[battler2.name, 224, 6, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[_INTL("Mind"), 144, 54, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[_INTL("Skill"), 144, 86, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[_INTL("Body"), 144, 118, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[total1.to_s, 64, 166, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[_INTL("Judgment"), 144, 166, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[total2.to_s, 224, 166, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)]
[battler1.name, 64, 6, :center, Color.new(248, 0, 0), Color.new(208, 208, 200)],
[_INTL("VS"), 144, 6, :center, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[battler2.name, 224, 6, :center, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[_INTL("Mind"), 144, 54, :center, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[_INTL("Skill"), 144, 86, :center, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[_INTL("Body"), 144, 118, :center, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[total1.to_s, 64, 166, :center, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[_INTL("Judgment"), 144, 166, :center, Color.new(72, 72, 72), Color.new(208, 208, 200)],
[total2.to_s, 224, 166, :center, Color.new(72, 72, 72), Color.new(208, 208, 200)]
]
pbDrawTextPositions(window.contents, textpos)
images = []

View File

@@ -373,9 +373,9 @@ SpecialBattleIntroAnimations.register("alternate_vs_trainer_animation", 50, #
trainer.tone = Tone.new(0, 0, 0)
trainername = foe[0].name
textpos = [
[$player.name, Graphics.width / 4, (Graphics.height / 1.5) + 16, 2,
[$player.name, Graphics.width / 4, (Graphics.height / 1.5) + 16, :center,
Color.new(248, 248, 248), Color.new(72, 72, 72)],
[trainername, (Graphics.width / 4) + (Graphics.width / 2), (Graphics.height / 1.5) + 16, 2,
[trainername, (Graphics.width / 4) + (Graphics.width / 2), (Graphics.height / 1.5) + 16, :center,
Color.new(248, 248, 248), Color.new(72, 72, 72)]
]
pbDrawTextPositions(overlay.bitmap, textpos)

View File

@@ -319,16 +319,16 @@ class HallOfFame_Scene
dexnumber = _ISPRINTF("No. {1:03d}", number)
end
textPositions = [
[dexnumber, 32, Graphics.height - 74, 0, BASECOLOR, SHADOWCOLOR],
[pokename, Graphics.width - 192, Graphics.height - 74, 2, BASECOLOR, SHADOWCOLOR],
[dexnumber, 32, Graphics.height - 74, :left, BASECOLOR, SHADOWCOLOR],
[pokename, Graphics.width - 192, Graphics.height - 74, :center, BASECOLOR, SHADOWCOLOR],
[_INTL("Lv. {1}", pokemon.egg? ? "?" : pokemon.level),
64, Graphics.height - 42, 0, BASECOLOR, SHADOWCOLOR],
64, Graphics.height - 42, :left, BASECOLOR, SHADOWCOLOR],
[_INTL("ID No. {1}", pokemon.egg? ? "?????" : idno),
Graphics.width - 192, Graphics.height - 42, 2, BASECOLOR, SHADOWCOLOR]
Graphics.width - 192, Graphics.height - 42, :center, BASECOLOR, SHADOWCOLOR]
]
if hallNumber > -1
textPositions.push([_INTL("Hall of Fame No."), (Graphics.width / 2) - 104, 6, 0, BASECOLOR, SHADOWCOLOR])
textPositions.push([hallNumber.to_s, (Graphics.width / 2) + 104, 6, 1, BASECOLOR, SHADOWCOLOR])
textPositions.push([_INTL("Hall of Fame No."), (Graphics.width / 2) - 104, 6, :left, BASECOLOR, SHADOWCOLOR])
textPositions.push([hallNumber.to_s, (Graphics.width / 2) + 104, 6, :right, BASECOLOR, SHADOWCOLOR])
end
pbDrawTextPositions(overlay, textPositions)
end
@@ -337,7 +337,7 @@ class HallOfFame_Scene
overlay = @sprites["overlay"].bitmap
overlay.clear
pbDrawTextPositions(overlay, [[_INTL("Welcome to the Hall of Fame!"),
Graphics.width / 2, Graphics.height - 68, 2, BASECOLOR, SHADOWCOLOR]])
Graphics.width / 2, Graphics.height - 68, :center, BASECOLOR, SHADOWCOLOR]])
end
def pbAnimationLoop

View File

@@ -430,17 +430,17 @@ class PokemonPokedex_Scene
end
end
textpos = [
[dexname, Graphics.width / 2, 10, 2, Color.new(248, 248, 248), Color.black]
[dexname, Graphics.width / 2, 10, :center, Color.new(248, 248, 248), Color.black]
]
textpos.push([GameData::Species.get(iconspecies).name, 112, 58, 2, base, shadow]) if iconspecies
textpos.push([GameData::Species.get(iconspecies).name, 112, 58, :center, base, shadow]) if iconspecies
if @searchResults
textpos.push([_INTL("Search results"), 112, 314, 2, base, shadow])
textpos.push([@dexlist.length.to_s, 112, 346, 2, base, shadow])
textpos.push([_INTL("Search results"), 112, 314, :center, base, shadow])
textpos.push([@dexlist.length.to_s, 112, 346, :center, base, shadow])
else
textpos.push([_INTL("Seen:"), 42, 314, 0, base, shadow])
textpos.push([$player.pokedex.seen_count(pbGetPokedexRegion).to_s, 182, 314, 1, base, shadow])
textpos.push([_INTL("Owned:"), 42, 346, 0, base, shadow])
textpos.push([$player.pokedex.owned_count(pbGetPokedexRegion).to_s, 182, 346, 1, base, shadow])
textpos.push([_INTL("Seen:"), 42, 314, :left, base, shadow])
textpos.push([$player.pokedex.seen_count(pbGetPokedexRegion).to_s, 182, 314, :right, base, shadow])
textpos.push([_INTL("Owned:"), 42, 346, :left, base, shadow])
textpos.push([$player.pokedex.owned_count(pbGetPokedexRegion).to_s, 182, 346, :right, base, shadow])
end
# Draw all text
pbDrawTextPositions(overlay, textpos)
@@ -483,36 +483,36 @@ class PokemonPokedex_Scene
shadow = Color.new(72, 72, 72)
# Write various bits of text
textpos = [
[_INTL("Search Mode"), Graphics.width / 2, 10, 2, base, shadow],
[_INTL("Order"), 136, 64, 2, base, shadow],
[_INTL("Name"), 58, 122, 2, base, shadow],
[_INTL("Type"), 58, 174, 2, base, shadow],
[_INTL("Height"), 58, 226, 2, base, shadow],
[_INTL("Weight"), 58, 278, 2, base, shadow],
[_INTL("Color"), 326, 122, 2, base, shadow],
[_INTL("Shape"), 454, 174, 2, base, shadow],
[_INTL("Reset"), 80, 346, 2, base, shadow, 1],
[_INTL("Start"), Graphics.width / 2, 346, 2, base, shadow, 1],
[_INTL("Cancel"), Graphics.width - 80, 346, 2, base, shadow, 1]
[_INTL("Search Mode"), Graphics.width / 2, 10, :center, base, shadow],
[_INTL("Order"), 136, 64, :center, base, shadow],
[_INTL("Name"), 58, 122, :center, base, shadow],
[_INTL("Type"), 58, 174, :center, base, shadow],
[_INTL("Height"), 58, 226, :center, base, shadow],
[_INTL("Weight"), 58, 278, :center, base, shadow],
[_INTL("Color"), 326, 122, :center, base, shadow],
[_INTL("Shape"), 454, 174, :center, base, shadow],
[_INTL("Reset"), 80, 346, :center, base, shadow, 1],
[_INTL("Start"), Graphics.width / 2, 346, :center, base, shadow, :outline],
[_INTL("Cancel"), Graphics.width - 80, 346, :center, base, shadow, :outline]
]
# Write order, name and color parameters
textpos.push([@orderCommands[params[0]], 344, 66, 2, base, shadow, 1])
textpos.push([(params[1] < 0) ? "----" : @nameCommands[params[1]], 176, 124, 2, base, shadow, 1])
textpos.push([(params[8] < 0) ? "----" : @colorCommands[params[8]].name, 444, 124, 2, base, shadow, 1])
textpos.push([@orderCommands[params[0]], 344, 66, :center, base, shadow, :outline])
textpos.push([(params[1] < 0) ? "----" : @nameCommands[params[1]], 176, 124, :center, base, shadow, :outline])
textpos.push([(params[8] < 0) ? "----" : @colorCommands[params[8]].name, 444, 124, :center, base, shadow, :outline])
# Draw type icons
if params[2] >= 0
type_number = @typeCommands[params[2]].icon_position
typerect = Rect.new(0, type_number * 32, 96, 32)
overlay.blt(128, 168, @typebitmap.bitmap, typerect)
else
textpos.push(["----", 176, 176, 2, base, shadow, 1])
textpos.push(["----", 176, 176, :center, base, shadow, :outline])
end
if params[3] >= 0
type_number = @typeCommands[params[3]].icon_position
typerect = Rect.new(0, type_number * 32, 96, 32)
overlay.blt(256, 168, @typebitmap.bitmap, typerect)
else
textpos.push(["----", 304, 176, 2, base, shadow, 1])
textpos.push(["----", 304, 176, :center, base, shadow, :outline])
end
# Write height and weight limits
ht1 = (params[4] < 0) ? 0 : (params[4] >= @heightCommands.length) ? 999 : @heightCommands[params[4]]
@@ -525,16 +525,16 @@ class PokemonPokedex_Scene
ht2 = (params[5] < 0) ? 99 * 12 : (ht2 / 0.254).round
wt1 = (params[6] >= @weightCommands.length) ? 99_990 : (wt1 / 0.254).round
wt2 = (params[7] < 0) ? 99_990 : (wt2 / 0.254).round
textpos.push([sprintf("%d'%02d''", ht1 / 12, ht1 % 12), 166, 228, 2, base, shadow, 1])
textpos.push([sprintf("%d'%02d''", ht2 / 12, ht2 % 12), 294, 228, 2, base, shadow, 1])
textpos.push([sprintf("%.1f", wt1 / 10.0), 166, 280, 2, base, shadow, 1])
textpos.push([sprintf("%.1f", wt2 / 10.0), 294, 280, 2, base, shadow, 1])
textpos.push([sprintf("%d'%02d''", ht1 / 12, ht1 % 12), 166, 228, :center, base, shadow, :outline])
textpos.push([sprintf("%d'%02d''", ht2 / 12, ht2 % 12), 294, 228, :center, base, shadow, :outline])
textpos.push([sprintf("%.1f", wt1 / 10.0), 166, 280, :center, base, shadow, :outline])
textpos.push([sprintf("%.1f", wt2 / 10.0), 294, 280, :center, base, shadow, :outline])
hwoffset = true
else
textpos.push([sprintf("%.1f", ht1 / 10.0), 166, 228, 2, base, shadow, 1])
textpos.push([sprintf("%.1f", ht2 / 10.0), 294, 228, 2, base, shadow, 1])
textpos.push([sprintf("%.1f", wt1 / 10.0), 166, 280, 2, base, shadow, 1])
textpos.push([sprintf("%.1f", wt2 / 10.0), 294, 280, 2, base, shadow, 1])
textpos.push([sprintf("%.1f", ht1 / 10.0), 166, 228, :center, base, shadow, :outline])
textpos.push([sprintf("%.1f", ht2 / 10.0), 294, 228, :center, base, shadow, :outline])
textpos.push([sprintf("%.1f", wt1 / 10.0), 166, 280, :center, base, shadow, :outline])
textpos.push([sprintf("%.1f", wt2 / 10.0), 294, 280, :center, base, shadow, :outline])
end
overlay.blt(344, 214, @hwbitmap.bitmap, Rect.new(0, (hwoffset) ? 44 : 0, 32, 44))
overlay.blt(344, 266, @hwbitmap.bitmap, Rect.new(32, (hwoffset) ? 44 : 0, 32, 44))
@@ -555,13 +555,13 @@ class PokemonPokedex_Scene
shadow = Color.new(72, 72, 72)
# Write various bits of text
textpos = [
[_INTL("Search Mode"), Graphics.width / 2, 10, 2, base, shadow],
[_INTL("OK"), 80, 346, 2, base, shadow, 1],
[_INTL("Cancel"), Graphics.width - 80, 346, 2, base, shadow, 1]
[_INTL("Search Mode"), Graphics.width / 2, 10, :center, base, shadow],
[_INTL("OK"), 80, 346, :center, base, shadow, :outline],
[_INTL("Cancel"), Graphics.width - 80, 346, :center, base, shadow, :outline]
]
title = [_INTL("Order"), _INTL("Name"), _INTL("Type"), _INTL("Height"),
_INTL("Weight"), _INTL("Color"), _INTL("Shape")][mode]
textpos.push([title, 102, (mode == 6) ? 70 : 64, 0, base, shadow])
textpos.push([title, 102, (mode == 6) ? 70 : 64, :left, base, shadow])
case mode
when 0 # Order
xstart = 46
@@ -621,7 +621,7 @@ class PokemonPokedex_Scene
when 2 # Type icons
2.times do |i|
if !sel[i] || sel[i] < 0
textpos.push(["----", 298 + (128 * i), 66, 2, base, shadow, 1])
textpos.push(["----", 298 + (128 * i), 66, :center, base, shadow, :outline])
else
type_number = @typeCommands[sel[i]].icon_position
typerect = Rect.new(0, type_number * 32, 96, 32)
@@ -642,8 +642,8 @@ class PokemonPokedex_Scene
txt1 = sprintf("%.1f", ht1 / 10.0)
txt2 = sprintf("%.1f", ht2 / 10.0)
end
textpos.push([txt1, 286, 66, 2, base, shadow, 1])
textpos.push([txt2, 414, 66, 2, base, shadow, 1])
textpos.push([txt1, 286, 66, :center, base, shadow, :outline])
textpos.push([txt2, 414, 66, :center, base, shadow, :outline])
overlay.blt(462, 52, @hwbitmap.bitmap, Rect.new(0, (hwoffset) ? 44 : 0, 32, 44))
when 4 # Weight range
wt1 = (sel[0] < 0) ? 0 : (sel[0] >= @weightCommands.length) ? 9999 : @weightCommands[sel[0]]
@@ -659,14 +659,14 @@ class PokemonPokedex_Scene
txt1 = sprintf("%.1f", wt1 / 10.0)
txt2 = sprintf("%.1f", wt2 / 10.0)
end
textpos.push([txt1, 286, 66, 2, base, shadow, 1])
textpos.push([txt2, 414, 66, 2, base, shadow, 1])
textpos.push([txt1, 286, 66, :center, base, shadow, :outline])
textpos.push([txt2, 414, 66, :center, base, shadow, :outline])
overlay.blt(462, 52, @hwbitmap.bitmap, Rect.new(32, (hwoffset) ? 44 : 0, 32, 44))
when 5 # Color
if sel[0] < 0
textpos.push(["----", 362, 66, 2, base, shadow, 1])
textpos.push(["----", 362, 66, :center, base, shadow, :outline])
else
textpos.push([cmds[sel[0]].name, 362, 66, 2, base, shadow, 1])
textpos.push([cmds[sel[0]].name, 362, 66, :center, base, shadow, :outline])
end
when 6 # Shape icon
if sel[0] >= 0
@@ -676,9 +676,9 @@ class PokemonPokedex_Scene
else
if sel[0] < 0
text = ["----", "-", "----", "", "", "----", ""][mode]
textpos.push([text, 362, 66, 2, base, shadow, 1])
textpos.push([text, 362, 66, :center, base, shadow, :outline])
else
textpos.push([cmds[sel[0]], 362, 66, 2, base, shadow, 1])
textpos.push([cmds[sel[0]], 362, 66, :center, base, shadow, :outline])
end
end
# Draw selected option(s) button graphic
@@ -698,8 +698,8 @@ class PokemonPokedex_Scene
overlay.blt(xpos2, ystart, @searchsliderbitmap.bitmap, hwrect)
hwrect.y = 96
overlay.blt(xpos1, ystart + ygap, @searchsliderbitmap.bitmap, hwrect)
textpos.push([txt1, xpos1 + halfwidth, ypos1, 2, base, nil, 1])
textpos.push([txt2, xpos2 + halfwidth, ypos2, 2, base, nil, 1])
textpos.push([txt1, xpos1 + halfwidth, ypos1, :center, base])
textpos.push([txt2, xpos2 + halfwidth, ypos2, :center, base])
else
sel.length.times do |i|
selrect = Rect.new(0, selbuttony, @selbitmap.bitmap.width, selbuttonheight)
@@ -720,13 +720,13 @@ class PokemonPokedex_Scene
cmds.length.times do |i|
x = xstart + halfwidth + ((i % cols) * xgap)
y = ystart + 14 + ((i / cols).floor * ygap)
textpos.push([cmds[i], x, y, 2, base, shadow, 1])
textpos.push([cmds[i], x, y, :center, base, shadow, :outline])
end
if mode != 0
textpos.push([(mode == 1) ? "-" : "----",
xstart + halfwidth + ((cols - 1) * xgap),
ystart + 14 + ((cmds.length / cols).floor * ygap),
2, base, shadow, 1])
:center, base, shadow, :outline])
end
when 2 # Type
typerect = Rect.new(0, 0, 96, 32)
@@ -739,17 +739,17 @@ class PokemonPokedex_Scene
textpos.push(["----",
xstart + halfwidth + ((cols - 1) * xgap),
ystart + 14 + ((cmds.length / cols).floor * ygap),
2, base, shadow, 1])
:center, base, shadow, :outline])
when 5 # Color
cmds.length.times do |i|
x = xstart + halfwidth + ((i % cols) * xgap)
y = ystart + 14 + ((i / cols).floor * ygap)
textpos.push([cmds[i].name, x, y, 2, base, shadow, 1])
textpos.push([cmds[i].name, x, y, :center, base, shadow, :outline])
end
textpos.push(["----",
xstart + halfwidth + ((cols - 1) * xgap),
ystart + 14 + ((cmds.length / cols).floor * ygap),
2, base, shadow, 1])
:center, base, shadow, :outline])
when 6 # Shape
shaperect = Rect.new(0, 0, 60, 60)
cmds.length.times do |i|

View File

@@ -221,18 +221,18 @@ class PokemonPokedexInfo_Scene
end
textpos = [
[_INTL("{1}{2} {3}", indexText, " ", species_data.name),
246, 48, 0, Color.new(248, 248, 248), Color.black]
246, 48, :left, Color.new(248, 248, 248), Color.black]
]
if @show_battled_count
textpos.push([_INTL("Number Battled"), 314, 164, 0, base, shadow])
textpos.push([$player.pokedex.battled_count(@species).to_s, 452, 196, 1, base, shadow])
textpos.push([_INTL("Number Battled"), 314, 164, :left, base, shadow])
textpos.push([$player.pokedex.battled_count(@species).to_s, 452, 196, :right, base, shadow])
else
textpos.push([_INTL("Height"), 314, 164, 0, base, shadow])
textpos.push([_INTL("Weight"), 314, 196, 0, base, shadow])
textpos.push([_INTL("Height"), 314, 164, :left, base, shadow])
textpos.push([_INTL("Weight"), 314, 196, :left, base, shadow])
end
if $player.owned?(@species)
# Write the category
textpos.push([_INTL("{1} Pokémon", species_data.category), 246, 80, 0, base, shadow])
textpos.push([_INTL("{1} Pokémon", species_data.category), 246, 80, :left, base, shadow])
# Write the height and weight
if !@show_battled_count
height = species_data.height
@@ -240,11 +240,11 @@ class PokemonPokedexInfo_Scene
if System.user_language[3..4] == "US" # If the user is in the United States
inches = (height / 0.254).round
pounds = (weight / 0.45359).round
textpos.push([_ISPRINTF("{1:d}'{2:02d}\"", inches / 12, inches % 12), 460, 164, 1, base, shadow])
textpos.push([_ISPRINTF("{1:4.1f} lbs.", pounds / 10.0), 494, 196, 1, base, shadow])
textpos.push([_ISPRINTF("{1:d}'{2:02d}\"", inches / 12, inches % 12), 460, 164, :right, base, shadow])
textpos.push([_ISPRINTF("{1:4.1f} lbs.", pounds / 10.0), 494, 196, :right, base, shadow])
else
textpos.push([_ISPRINTF("{1:.1f} m", height / 10.0), 470, 164, 1, base, shadow])
textpos.push([_ISPRINTF("{1:.1f} kg", weight / 10.0), 482, 196, 1, base, shadow])
textpos.push([_ISPRINTF("{1:.1f} m", height / 10.0), 470, 164, :right, base, shadow])
textpos.push([_ISPRINTF("{1:.1f} kg", weight / 10.0), 482, 196, :right, base, shadow])
end
end
# Draw the Pokédex entry text
@@ -267,15 +267,15 @@ class PokemonPokedexInfo_Scene
end
else
# Write the category
textpos.push([_INTL("????? Pokémon"), 246, 80, 0, base, shadow])
textpos.push([_INTL("????? Pokémon"), 246, 80, :left, base, shadow])
# Write the height and weight
if !@show_battled_count
if System.user_language[3..4] == "US" # If the user is in the United States
textpos.push([_INTL("???'??\""), 460, 164, 1, base, shadow])
textpos.push([_INTL("????.? lbs."), 494, 196, 1, base, shadow])
textpos.push([_INTL("???'??\""), 460, 164, :right, base, shadow])
textpos.push([_INTL("????.? lbs."), 494, 196, :right, base, shadow])
else
textpos.push([_INTL("????.? m"), 470, 164, 1, base, shadow])
textpos.push([_INTL("????.? kg"), 482, 196, 1, base, shadow])
textpos.push([_INTL("????.? m"), 470, 164, :right, base, shadow])
textpos.push([_INTL("????.? kg"), 482, 196, :right, base, shadow])
end
end
end
@@ -378,11 +378,11 @@ class PokemonPokedexInfo_Scene
overlay,
[["Graphics/UI/Pokedex/overlay_areanone", 108, 188]]
)
textpos.push([_INTL("Area unknown"), Graphics.width / 2, (Graphics.height / 2) + 6, 2, base, shadow])
textpos.push([_INTL("Area unknown"), Graphics.width / 2, (Graphics.height / 2) + 6, :center, base, shadow])
end
textpos.push([@mapdata.name, 414, 50, 2, base, shadow])
textpos.push([@mapdata.name, 414, 50, :center, base, shadow])
textpos.push([_INTL("{1}'s area", GameData::Species.get(@species).name),
Graphics.width / 2, 358, 2, base, shadow])
Graphics.width / 2, 358, :center, base, shadow])
pbDrawTextPositions(overlay, textpos)
end
@@ -400,8 +400,8 @@ class PokemonPokedexInfo_Scene
end
end
textpos = [
[GameData::Species.get(@species).name, Graphics.width / 2, Graphics.height - 82, 2, base, shadow],
[formname, Graphics.width / 2, Graphics.height - 50, 2, base, shadow]
[GameData::Species.get(@species).name, Graphics.width / 2, Graphics.height - 82, :center, base, shadow],
[formname, Graphics.width / 2, Graphics.height - 50, :center, base, shadow]
]
# Draw all text
pbDrawTextPositions(overlay, textpos)

View File

@@ -19,7 +19,7 @@ class PokemonPartyConfirmCancelSprite < Sprite
@overlaysprite = BitmapSprite.new(@bgsprite.bitmap.width, @bgsprite.bitmap.height, viewport)
@overlaysprite.z = self.z + 1
pbSetSystemFont(@overlaysprite.bitmap)
textpos = [[text, 56, (narrowbox) ? 8 : 14, 2, Color.new(248, 248, 248), Color.new(40, 40, 40)]]
textpos = [[text, 56, (narrowbox) ? 8 : 14, :center, Color.new(248, 248, 248), Color.new(40, 40, 40)]]
pbDrawTextPositions(@overlaysprite.bitmap, textpos)
self.x = x
self.y = y
@@ -373,7 +373,7 @@ class PokemonPartyPanel < Sprite
def draw_name
pbDrawTextPositions(@overlaysprite.bitmap,
[[@pokemon.name, 96, 22, 0, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR]])
[[@pokemon.name, 96, 22, :left, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR]])
end
def draw_level
@@ -384,7 +384,7 @@ class PokemonPartyPanel < Sprite
# Level number
pbSetSmallFont(@overlaysprite.bitmap)
pbDrawTextPositions(@overlaysprite.bitmap,
[[@pokemon.level.to_s, 42, 68, 0, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR]])
[[@pokemon.level.to_s, 42, 68, :left, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR]])
pbSetSystemFont(@overlaysprite.bitmap)
end
@@ -394,7 +394,7 @@ class PokemonPartyPanel < Sprite
base_color = (@pokemon.male?) ? Color.new(0, 112, 248) : Color.new(232, 32, 16)
shadow_color = (@pokemon.male?) ? Color.new(120, 184, 232) : Color.new(248, 168, 184)
pbDrawTextPositions(@overlaysprite.bitmap,
[[gender_text, 224, 22, 0, base_color, shadow_color]])
[[gender_text, 224, 22, :left, base_color, shadow_color]])
end
def draw_hp
@@ -402,7 +402,7 @@ class PokemonPartyPanel < Sprite
# HP numbers
hp_text = sprintf("% 3d /% 3d", @pokemon.hp, @pokemon.totalhp)
pbDrawTextPositions(@overlaysprite.bitmap,
[[hp_text, 224, 66, 1, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR]])
[[hp_text, 224, 66, :right, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR]])
# HP bar
if @pokemon.able?
w = @pokemon.hp * HP_BAR_WIDTH / @pokemon.totalhp.to_f
@@ -440,7 +440,7 @@ class PokemonPartyPanel < Sprite
def draw_annotation
return if !@text || @text.length == 0
pbDrawTextPositions(@overlaysprite.bitmap,
[[@text, 96, 62, 0, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR]])
[[@text, 96, 62, :left, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR]])
end
def refresh

View File

@@ -338,22 +338,22 @@ class PokemonSummary_Scene
_INTL("MOVES"),
_INTL("RIBBONS")][page - 1]
textpos = [
[pagename, 26, 22, 0, base, shadow],
[@pokemon.name, 46, 68, 0, base, shadow],
[@pokemon.level.to_s, 46, 98, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Item"), 66, 324, 0, base, shadow]
[pagename, 26, 22, :left, base, shadow],
[@pokemon.name, 46, 68, :left, base, shadow],
[@pokemon.level.to_s, 46, 98, :left, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Item"), 66, 324, :left, base, shadow]
]
# Write the held item's name
if @pokemon.hasItem?
textpos.push([@pokemon.item.name, 16, 358, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([@pokemon.item.name, 16, 358, :left, Color.new(64, 64, 64), Color.new(176, 176, 176)])
else
textpos.push([_INTL("None"), 16, 358, 0, Color.new(192, 200, 208), Color.new(208, 216, 224)])
textpos.push([_INTL("None"), 16, 358, :left, Color.new(192, 200, 208), Color.new(208, 216, 224)])
end
# Write the gender symbol
if @pokemon.male?
textpos.push([_INTL(""), 178, 68, 0, Color.new(24, 112, 216), Color.new(136, 168, 208)])
textpos.push([_INTL(""), 178, 68, :left, Color.new(24, 112, 216), Color.new(136, 168, 208)])
elsif @pokemon.female?
textpos.push([_INTL(""), 178, 68, 0, Color.new(248, 56, 32), Color.new(224, 152, 144)])
textpos.push([_INTL(""), 178, 68, :left, Color.new(248, 56, 32), Color.new(224, 152, 144)])
end
# Draw all text
pbDrawTextPositions(overlay, textpos)
@@ -386,12 +386,12 @@ class PokemonSummary_Scene
end
# Write various bits of text
textpos = [
[_INTL("Dex No."), 238, 86, 0, base, shadow],
[_INTL("Species"), 238, 118, 0, base, shadow],
[@pokemon.speciesName, 435, 118, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Type"), 238, 150, 0, base, shadow],
[_INTL("OT"), 238, 182, 0, base, shadow],
[_INTL("ID No."), 238, 214, 0, base, shadow]
[_INTL("Dex No."), 238, 86, :left, base, shadow],
[_INTL("Species"), 238, 118, :left, base, shadow],
[@pokemon.speciesName, 435, 118, :center, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Type"), 238, 150, :left, base, shadow],
[_INTL("OT"), 238, 182, :left, base, shadow],
[_INTL("ID No."), 238, 214, :left, base, shadow]
]
# Write the Regional/National Dex number
dexnum = 0
@@ -410,15 +410,15 @@ class PokemonSummary_Scene
end
end
if dexnum <= 0
textpos.push(["???", 435, 86, 2, dexNumBase, dexNumShadow])
textpos.push(["???", 435, 86, :center, dexNumBase, dexNumShadow])
else
dexnum -= 1 if dexnumshift
textpos.push([sprintf("%03d", dexnum), 435, 86, 2, dexNumBase, dexNumShadow])
textpos.push([sprintf("%03d", dexnum), 435, 86, :center, dexNumBase, dexNumShadow])
end
# Write Original Trainer's name and ID number
if @pokemon.owner.name.empty?
textpos.push([_INTL("RENTAL"), 435, 182, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push(["?????", 435, 214, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([_INTL("RENTAL"), 435, 182, :center, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push(["?????", 435, 214, :center, Color.new(64, 64, 64), Color.new(176, 176, 176)])
else
ownerbase = Color.new(64, 64, 64)
ownershadow = Color.new(176, 176, 176)
@@ -430,13 +430,13 @@ class PokemonSummary_Scene
ownerbase = Color.new(248, 56, 32)
ownershadow = Color.new(224, 152, 144)
end
textpos.push([@pokemon.owner.name, 435, 182, 2, ownerbase, ownershadow])
textpos.push([sprintf("%05d", @pokemon.owner.public_id), 435, 214, 2,
textpos.push([@pokemon.owner.name, 435, 182, :center, ownerbase, ownershadow])
textpos.push([sprintf("%05d", @pokemon.owner.public_id), 435, 214, :center,
Color.new(64, 64, 64), Color.new(176, 176, 176)])
end
# Write Exp text OR heart gauge message (if a Shadow Pokémon)
if @pokemon.shadowPokemon?
textpos.push([_INTL("Heart Gauge"), 238, 246, 0, base, shadow])
textpos.push([_INTL("Heart Gauge"), 238, 246, :left, base, shadow])
heartmessage = [_INTL("The door to its heart is open! Undo the final lock!"),
_INTL("The door to its heart is almost fully open."),
_INTL("The door to its heart is nearly open."),
@@ -447,10 +447,10 @@ class PokemonSummary_Scene
drawFormattedTextEx(overlay, 234, 308, 264, memo)
else
endexp = @pokemon.growth_rate.minimum_exp_for_level(@pokemon.level + 1)
textpos.push([_INTL("Exp. Points"), 238, 246, 0, base, shadow])
textpos.push([@pokemon.exp.to_s_formatted, 488, 278, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([_INTL("To Next Lv."), 238, 310, 0, base, shadow])
textpos.push([(endexp - @pokemon.exp).to_s_formatted, 488, 342, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([_INTL("Exp. Points"), 238, 246, :left, base, shadow])
textpos.push([@pokemon.exp.to_s_formatted, 488, 278, :right, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([_INTL("To Next Lv."), 238, 310, :left, base, shadow])
textpos.push([(endexp - @pokemon.exp).to_s_formatted, 488, 342, :right, Color.new(64, 64, 64), Color.new(176, 176, 176)])
end
# Draw all text
pbDrawTextPositions(overlay, textpos)
@@ -486,15 +486,15 @@ class PokemonSummary_Scene
pbDrawImagePositions(overlay, imagepos)
# Write various bits of text
textpos = [
[_INTL("TRAINER MEMO"), 26, 22, 0, base, shadow],
[@pokemon.name, 46, 68, 0, base, shadow],
[_INTL("Item"), 66, 324, 0, base, shadow]
[_INTL("TRAINER MEMO"), 26, 22, :left, base, shadow],
[@pokemon.name, 46, 68, :left, base, shadow],
[_INTL("Item"), 66, 324, :left, base, shadow]
]
# Write the held item's name
if @pokemon.hasItem?
textpos.push([@pokemon.item.name, 16, 358, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([@pokemon.item.name, 16, 358, :left, Color.new(64, 64, 64), Color.new(176, 176, 176)])
else
textpos.push([_INTL("None"), 16, 358, 0, Color.new(192, 200, 208), Color.new(208, 216, 224)])
textpos.push([_INTL("None"), 16, 358, :left, Color.new(192, 200, 208), Color.new(208, 216, 224)])
end
# Draw all text
pbDrawTextPositions(overlay, textpos)
@@ -637,24 +637,24 @@ class PokemonSummary_Scene
end
# Write various bits of text
textpos = [
[_INTL("HP"), 292, 82, 2, base, statshadows[:HP]],
[sprintf("%d/%d", @pokemon.hp, @pokemon.totalhp), 462, 82, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Attack"), 248, 126, 0, base, statshadows[:ATTACK]],
[@pokemon.attack.to_s, 456, 126, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Defense"), 248, 158, 0, base, statshadows[:DEFENSE]],
[@pokemon.defense.to_s, 456, 158, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Sp. Atk"), 248, 190, 0, base, statshadows[:SPECIAL_ATTACK]],
[@pokemon.spatk.to_s, 456, 190, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Sp. Def"), 248, 222, 0, base, statshadows[:SPECIAL_DEFENSE]],
[@pokemon.spdef.to_s, 456, 222, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Speed"), 248, 254, 0, base, statshadows[:SPEED]],
[@pokemon.speed.to_s, 456, 254, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Ability"), 224, 290, 0, base, shadow]
[_INTL("HP"), 292, 82, :center, base, statshadows[:HP]],
[sprintf("%d/%d", @pokemon.hp, @pokemon.totalhp), 462, 82, :right, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Attack"), 248, 126, :left, base, statshadows[:ATTACK]],
[@pokemon.attack.to_s, 456, 126, :right, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Defense"), 248, 158, :left, base, statshadows[:DEFENSE]],
[@pokemon.defense.to_s, 456, 158, :right, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Sp. Atk"), 248, 190, :left, base, statshadows[:SPECIAL_ATTACK]],
[@pokemon.spatk.to_s, 456, 190, :right, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Sp. Def"), 248, 222, :left, base, statshadows[:SPECIAL_DEFENSE]],
[@pokemon.spdef.to_s, 456, 222, :right, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Speed"), 248, 254, :left, base, statshadows[:SPEED]],
[@pokemon.speed.to_s, 456, 254, :right, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[_INTL("Ability"), 224, 290, :left, base, shadow]
]
# Draw ability name and description
ability = @pokemon.ability
if ability
textpos.push([ability.name, 362, 290, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([ability.name, 362, 290, :left, Color.new(64, 64, 64), Color.new(176, 176, 176)])
drawTextEx(overlay, 224, 322, 282, 2, ability.description, Color.new(64, 64, 64), Color.new(176, 176, 176))
end
# Draw all text
@@ -698,9 +698,9 @@ class PokemonSummary_Scene
if move
type_number = GameData::Type.get(move.display_type(@pokemon)).icon_position
imagepos.push(["Graphics/UI/types", 248, yPos - 4, 0, type_number * 28, 64, 28])
textpos.push([move.name, 316, yPos, 0, moveBase, moveShadow])
textpos.push([move.name, 316, yPos, :left, moveBase, moveShadow])
if move.total_pp > 0
textpos.push([_INTL("PP"), 342, yPos + 32, 0, moveBase, moveShadow])
textpos.push([_INTL("PP"), 342, yPos + 32, :left, moveBase, moveShadow])
ppfraction = 0
if move.pp == 0
ppfraction = 3
@@ -709,11 +709,11 @@ class PokemonSummary_Scene
elsif move.pp * 2 <= move.total_pp
ppfraction = 1
end
textpos.push([sprintf("%d/%d", move.pp, move.total_pp), 460, yPos + 32, 1, ppBase[ppfraction], ppShadow[ppfraction]])
textpos.push([sprintf("%d/%d", move.pp, move.total_pp), 460, yPos + 32, :right, ppBase[ppfraction], ppShadow[ppfraction]])
end
else
textpos.push(["-", 316, yPos, 0, moveBase, moveShadow])
textpos.push(["--", 442, yPos + 32, 1, moveBase, moveShadow])
textpos.push(["-", 316, yPos, :left, moveBase, moveShadow])
textpos.push(["--", 442, yPos + 32, :right, moveBase, moveShadow])
end
yPos += 64
end
@@ -745,10 +745,10 @@ class PokemonSummary_Scene
end
# Write various bits of text
textpos = [
[_INTL("MOVES"), 26, 22, 0, base, shadow],
[_INTL("CATEGORY"), 20, 128, 0, base, shadow],
[_INTL("POWER"), 20, 160, 0, base, shadow],
[_INTL("ACCURACY"), 20, 192, 0, base, shadow]
[_INTL("MOVES"), 26, 22, :left, base, shadow],
[_INTL("CATEGORY"), 20, 128, :left, base, shadow],
[_INTL("POWER"), 20, 160, :left, base, shadow],
[_INTL("ACCURACY"), 20, 192, :left, base, shadow]
]
imagepos = []
# Write move names, types and PP amounts for each known move
@@ -764,9 +764,9 @@ class PokemonSummary_Scene
if move
type_number = GameData::Type.get(move.display_type(@pokemon)).icon_position
imagepos.push(["Graphics/UI/types", 248, yPos - 4, 0, type_number * 28, 64, 28])
textpos.push([move.name, 316, yPos, 0, moveBase, moveShadow])
textpos.push([move.name, 316, yPos, :left, moveBase, moveShadow])
if move.total_pp > 0
textpos.push([_INTL("PP"), 342, yPos + 32, 0, moveBase, moveShadow])
textpos.push([_INTL("PP"), 342, yPos + 32, :left, moveBase, moveShadow])
ppfraction = 0
if move.pp == 0
ppfraction = 3
@@ -775,11 +775,12 @@ class PokemonSummary_Scene
elsif move.pp * 2 <= move.total_pp
ppfraction = 1
end
textpos.push([sprintf("%d/%d", move.pp, move.total_pp), 460, yPos + 32, 1, ppBase[ppfraction], ppShadow[ppfraction]])
textpos.push([sprintf("%d/%d", move.pp, move.total_pp), 460, yPos + 32, :right,
ppBase[ppfraction], ppShadow[ppfraction]])
end
else
textpos.push(["-", 316, yPos, 0, moveBase, moveShadow])
textpos.push(["--", 442, yPos + 32, 1, moveBase, moveShadow])
textpos.push(["-", 316, yPos, :left, moveBase, moveShadow])
textpos.push(["--", 442, yPos + 32, :right, moveBase, moveShadow])
end
yPos += 64
end
@@ -809,14 +810,14 @@ class PokemonSummary_Scene
textpos = []
# Write power and accuracy values for selected move
case selected_move.display_damage(@pokemon)
when 0 then textpos.push(["---", 216, 160, 1, base, shadow]) # Status move
when 1 then textpos.push(["???", 216, 160, 1, base, shadow]) # Variable power move
else textpos.push([selected_move.display_damage(@pokemon).to_s, 216, 160, 1, base, shadow])
when 0 then textpos.push(["---", 216, 160, :right, base, shadow]) # Status move
when 1 then textpos.push(["???", 216, 160, :right, base, shadow]) # Variable power move
else textpos.push([selected_move.display_damage(@pokemon).to_s, 216, 160, :right, base, shadow])
end
if selected_move.display_accuracy(@pokemon) == 0
textpos.push(["---", 216, 192, 1, base, shadow])
textpos.push(["---", 216, 192, :right, base, shadow])
else
textpos.push(["#{selected_move.display_accuracy(@pokemon)}%", 216 + overlay.text_size("%").width, 192, 1, base, shadow])
textpos.push(["#{selected_move.display_accuracy(@pokemon)}%", 216 + overlay.text_size("%").width, 192, :right, base, shadow])
end
# Draw all text
pbDrawTextPositions(overlay, textpos)
@@ -833,8 +834,8 @@ class PokemonSummary_Scene
@sprites["downarrow"].visible = false
# Write various bits of text
textpos = [
[_INTL("No. of Ribbons:"), 234, 338, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[@pokemon.numRibbons.to_s, 450, 338, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)]
[_INTL("No. of Ribbons:"), 234, 338, :left, Color.new(64, 64, 64), Color.new(176, 176, 176)],
[@pokemon.numRibbons.to_s, 450, 338, :right, Color.new(64, 64, 64), Color.new(176, 176, 176)]
]
# Draw all text
pbDrawTextPositions(overlay, textpos)
@@ -873,7 +874,7 @@ class PokemonSummary_Scene
pbDrawImagePositions(overlay, imagepos)
# Draw name of selected ribbon
textpos = [
[name, 18, 292, 0, nameBase, nameShadow]
[name, 18, 292, :left, nameBase, nameShadow]
]
pbDrawTextPositions(overlay, textpos)
# Draw selected ribbon's description
@@ -1082,9 +1083,9 @@ class PokemonSummary_Scene
@markingbitmap.bitmap, markrect)
end
textpos = [
[_INTL("Mark {1}", pokemon.name), 366, 102, 2, base, shadow],
[_INTL("OK"), 366, 254, 2, base, shadow],
[_INTL("Cancel"), 366, 304, 2, base, shadow]
[_INTL("Mark {1}", pokemon.name), 366, 102, :center, base, shadow],
[_INTL("OK"), 366, 254, :center, base, shadow],
[_INTL("Cancel"), 366, 304, :center, base, shadow]
]
pbDrawTextPositions(@sprites["markingoverlay"].bitmap, textpos)
redraw = false

View File

@@ -66,7 +66,7 @@ class Window_PokemonBag < Window_DrawableCommand
rect = Rect.new(rect.x + 16, rect.y + 16, rect.width - 16, rect.height)
thispocket = @bag.pockets[@pocket]
if index == self.itemCount - 1
textpos.push([_INTL("CLOSE BAG"), rect.x, rect.y + 2, false, self.baseColor, self.shadowColor])
textpos.push([_INTL("CLOSE BAG"), rect.x, rect.y + 2, :left, self.baseColor, self.shadowColor])
else
item = (@filterlist) ? thispocket[@filterlist[@pocket][index]][0] : thispocket[index][0]
baseColor = self.baseColor
@@ -76,7 +76,7 @@ class Window_PokemonBag < Window_DrawableCommand
shadowColor = Color.new(248, 144, 144)
end
textpos.push(
[@adapter.getDisplayName(item), rect.x, rect.y + 2, false, baseColor, shadowColor]
[@adapter.getDisplayName(item), rect.x, rect.y + 2, :left, baseColor, shadowColor]
)
if GameData::Item.get(item).is_important?
if @bag.registered?(item)
@@ -94,7 +94,7 @@ class Window_PokemonBag < Window_DrawableCommand
qty = (@filterlist) ? thispocket[@filterlist[@pocket][index]][1] : thispocket[index][1]
qtytext = _ISPRINTF("x{1: 3d}", qty)
xQty = rect.x + rect.width - self.contents.text_size(qtytext).width - 16
textpos.push([qtytext, xQty, rect.y + 2, false, baseColor, shadowColor])
textpos.push([qtytext, xQty, rect.y + 2, :left, baseColor, shadowColor])
end
end
pbDrawTextPositions(self.contents, textpos)
@@ -293,7 +293,7 @@ class PokemonBag_Scene
# Draw the pocket name
pbDrawTextPositions(
overlay,
[[PokemonBag.pocket_names[@bag.last_viewed_pocket - 1], 94, 186, 2, POCKETNAMEBASECOLOR, POCKETNAMESHADOWCOLOR]]
[[PokemonBag.pocket_names[@bag.last_viewed_pocket - 1], 94, 186, :center, POCKETNAMEBASECOLOR, POCKETNAMESHADOWCOLOR]]
)
# Draw slider arrows
showslider = false

View File

@@ -45,7 +45,7 @@ class PokegearButton < Sprite
rect.y = @button.height / 2 if @selected
self.bitmap.blt(0, 0, @button.bitmap, rect)
textpos = [
[@name, rect.width / 2, (rect.height / 2) - 10, 2, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR]
[@name, rect.width / 2, (rect.height / 2) - 10, :center, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR]
]
pbDrawTextPositions(self.bitmap, textpos)
imagepos = [

View File

@@ -39,9 +39,9 @@ class MapBottomSprite < Sprite
def refresh
bitmap.clear
textpos = [
[@mapname, 18, 4, 0, TEXT_MAIN_COLOR, TEXT_SHADOW_COLOR],
[@maplocation, 18, 360, 0, TEXT_MAIN_COLOR, TEXT_SHADOW_COLOR],
[@mapdetails, Graphics.width - 16, 360, 1, TEXT_MAIN_COLOR, TEXT_SHADOW_COLOR]
[@mapname, 18, 4, :left, TEXT_MAIN_COLOR, TEXT_SHADOW_COLOR],
[@maplocation, 18, 360, :left, TEXT_MAIN_COLOR, TEXT_SHADOW_COLOR],
[@mapdetails, Graphics.width - 16, 360, :right, TEXT_MAIN_COLOR, TEXT_SHADOW_COLOR]
]
pbDrawTextPositions(bitmap, textpos)
end
@@ -236,7 +236,7 @@ class PokemonRegionMap_Scene
text = (@mode == 0) ? _INTL("ACTION: Fly") : _INTL("ACTION: Cancel Fly")
pbDrawTextPositions(
@sprites["help"].bitmap,
[[text, Graphics.width - 16, 4, 1, Color.new(248, 248, 248), Color.black]]
[[text, Graphics.width - 16, 4, :right, Color.new(248, 248, 248), Color.black]]
)
@sprites.each do |key, sprite|
next if !key.include?("point")

View File

@@ -49,18 +49,18 @@ class PokemonTrainerCard_Scene
$PokemonGlobal.startTime.day,
$PokemonGlobal.startTime.year)
textPositions = [
[_INTL("Name"), 34, 70, 0, baseColor, shadowColor],
[$player.name, 302, 70, 1, baseColor, shadowColor],
[_INTL("ID No."), 332, 70, 0, baseColor, shadowColor],
[sprintf("%05d", $player.public_ID), 468, 70, 1, baseColor, shadowColor],
[_INTL("Money"), 34, 118, 0, baseColor, shadowColor],
[_INTL("${1}", $player.money.to_s_formatted), 302, 118, 1, baseColor, shadowColor],
[_INTL("Pokédex"), 34, 166, 0, baseColor, shadowColor],
[sprintf("%d/%d", $player.pokedex.owned_count, $player.pokedex.seen_count), 302, 166, 1, baseColor, shadowColor],
[_INTL("Time"), 34, 214, 0, baseColor, shadowColor],
[time, 302, 214, 1, baseColor, shadowColor],
[_INTL("Started"), 34, 262, 0, baseColor, shadowColor],
[starttime, 302, 262, 1, baseColor, shadowColor]
[_INTL("Name"), 34, 70, :left, baseColor, shadowColor],
[$player.name, 302, 70, :right, baseColor, shadowColor],
[_INTL("ID No."), 332, 70, :left, baseColor, shadowColor],
[sprintf("%05d", $player.public_ID), 468, 70, :right, baseColor, shadowColor],
[_INTL("Money"), 34, 118, :left, baseColor, shadowColor],
[_INTL("${1}", $player.money.to_s_formatted), 302, 118, :right, baseColor, shadowColor],
[_INTL("Pokédex"), 34, 166, :left, baseColor, shadowColor],
[sprintf("%d/%d", $player.pokedex.owned_count, $player.pokedex.seen_count), 302, 166, :right, baseColor, shadowColor],
[_INTL("Time"), 34, 214, :left, baseColor, shadowColor],
[time, 302, 214, :right, baseColor, shadowColor],
[_INTL("Started"), 34, 262, :left, baseColor, shadowColor],
[starttime, 302, 262, :right, baseColor, shadowColor]
]
pbDrawTextPositions(overlay, textPositions)
x = 72

View File

@@ -62,31 +62,31 @@ class PokemonLoadPanel < Sprite
end
textpos = []
if @isContinue
textpos.push([@title, 32, 16, 0, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([_INTL("Badges:"), 32, 118, 0, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([@trainer.badge_count.to_s, 206, 118, 1, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([_INTL("Pokédex:"), 32, 150, 0, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([@trainer.pokedex.seen_count.to_s, 206, 150, 1, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([_INTL("Time:"), 32, 182, 0, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([@title, 32, 16, :left, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([_INTL("Badges:"), 32, 118, :left, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([@trainer.badge_count.to_s, 206, 118, :right, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([_INTL("Pokédex:"), 32, 150, :left, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([@trainer.pokedex.seen_count.to_s, 206, 150, :right, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([_INTL("Time:"), 32, 182, :left, TEXTCOLOR, TEXTSHADOWCOLOR])
hour = @totalsec / 60 / 60
min = @totalsec / 60 % 60
if hour > 0
textpos.push([_INTL("{1}h {2}m", hour, min), 206, 182, 1, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([_INTL("{1}h {2}m", hour, min), 206, 182, :right, TEXTCOLOR, TEXTSHADOWCOLOR])
else
textpos.push([_INTL("{1}m", min), 206, 182, 1, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([_INTL("{1}m", min), 206, 182, :right, TEXTCOLOR, TEXTSHADOWCOLOR])
end
if @trainer.male?
textpos.push([@trainer.name, 112, 70, 0, MALETEXTCOLOR, MALETEXTSHADOWCOLOR])
textpos.push([@trainer.name, 112, 70, :left, MALETEXTCOLOR, MALETEXTSHADOWCOLOR])
elsif @trainer.female?
textpos.push([@trainer.name, 112, 70, 0, FEMALETEXTCOLOR, FEMALETEXTSHADOWCOLOR])
textpos.push([@trainer.name, 112, 70, :left, FEMALETEXTCOLOR, FEMALETEXTSHADOWCOLOR])
else
textpos.push([@trainer.name, 112, 70, 0, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([@trainer.name, 112, 70, :left, TEXTCOLOR, TEXTSHADOWCOLOR])
end
mapname = pbGetMapNameFromId(@mapid)
mapname.gsub!(/\\PN/, @trainer.name)
textpos.push([mapname, 386, 16, 1, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([mapname, 386, 16, :right, TEXTCOLOR, TEXTSHADOWCOLOR])
else
textpos.push([@title, 32, 14, 0, TEXTCOLOR, TEXTSHADOWCOLOR])
textpos.push([@title, 32, 14, :left, TEXTCOLOR, TEXTSHADOWCOLOR])
end
pbDrawTextPositions(self.bitmap, textpos)
end

View File

@@ -71,16 +71,16 @@ class ReadyMenuButton < Sprite
self.bitmap.blt(0, 0, @button.bitmap, rect)
textx = (@command[2]) ? 164 : (GameData::Item.get(@command[0]).is_important?) ? 146 : 124
textpos = [
[@command[1], textx, 24, 2, Color.new(248, 248, 248), Color.new(40, 40, 40), 1]
[@command[1], textx, 24, :center, Color.new(248, 248, 248), Color.new(40, 40, 40), :outline]
]
if !@command[2] && !GameData::Item.get(@command[0]).is_important?
qty = $bag.quantity(@command[0])
if qty > 99
textpos.push([_INTL(">99"), 230, 24, 1,
Color.new(248, 248, 248), Color.new(40, 40, 40), 1])
textpos.push([_INTL(">99"), 230, 24, :right,
Color.new(248, 248, 248), Color.new(40, 40, 40), :outline])
else
textpos.push([_INTL("x{1}", qty), 230, 24, 1,
Color.new(248, 248, 248), Color.new(40, 40, 40), 1])
textpos.push([_INTL("x{1}", qty), 230, 24, :right,
Color.new(248, 248, 248), Color.new(40, 40, 40), :outline])
end
end
pbDrawTextPositions(self.bitmap, textpos)

View File

@@ -529,7 +529,7 @@ class PokemonBoxPartySprite < Sprite
@contents.blt(0, 0, @boxbitmap.bitmap, Rect.new(0, 0, 172, 352))
pbDrawTextPositions(
self.bitmap,
[[_INTL("Back"), 86, 248, 2, Color.new(248, 248, 248), Color.new(80, 80, 80), 1]]
[[_INTL("Back"), 86, 248, :center, Color.new(248, 248, 248), Color.new(80, 80, 80), :outline]]
)
xvalues = [] # [18, 90, 18, 90, 18, 90]
yvalues = [] # [2, 18, 66, 82, 130, 146]
@@ -1322,8 +1322,8 @@ class PokemonStorageScene
@markingbitmap.bitmap, markrect)
end
textpos = [
[_INTL("OK"), 402, 216, 2, base, shadow, 1],
[_INTL("Cancel"), 402, 280, 2, base, shadow, 1]
[_INTL("OK"), 402, 216, :center, base, shadow, :outline],
[_INTL("Cancel"), 402, 280, :center, base, shadow, :outline]
]
pbDrawTextPositions(@sprites["markingoverlay"].bitmap, textpos)
pbMarkingSetArrow(@sprites["arrow"], index)
@@ -1396,8 +1396,8 @@ class PokemonStorageScene
buttonshadow = Color.new(80, 80, 80)
pbDrawTextPositions(
overlay,
[[_INTL("Party: {1}", (@storage.party.length rescue 0)), 270, 334, 2, buttonbase, buttonshadow, 1],
[_INTL("Exit"), 446, 334, 2, buttonbase, buttonshadow, 1]]
[[_INTL("Party: {1}", (@storage.party.length rescue 0)), 270, 334, :center, buttonbase, buttonshadow, :outline],
[_INTL("Exit"), 446, 334, :center, buttonbase, buttonshadow, :outline]]
)
pokemon = nil
if @screen.pbHeldPokemon
@@ -1416,26 +1416,26 @@ class PokemonStorageScene
nonshadow = Color.new(224, 224, 224)
pokename = pokemon.name
textstrings = [
[pokename, 10, 14, false, base, shadow]
[pokename, 10, 14, :left, base, shadow]
]
if !pokemon.egg?
imagepos = []
if pokemon.male?
textstrings.push([_INTL(""), 148, 14, false, Color.new(24, 112, 216), Color.new(136, 168, 208)])
textstrings.push([_INTL(""), 148, 14, :left, Color.new(24, 112, 216), Color.new(136, 168, 208)])
elsif pokemon.female?
textstrings.push([_INTL(""), 148, 14, false, Color.new(248, 56, 32), Color.new(224, 152, 144)])
textstrings.push([_INTL(""), 148, 14, :left, Color.new(248, 56, 32), Color.new(224, 152, 144)])
end
imagepos.push(["Graphics/UI/Storage/overlay_lv", 6, 246])
textstrings.push([pokemon.level.to_s, 28, 240, false, base, shadow])
textstrings.push([pokemon.level.to_s, 28, 240, :left, base, shadow])
if pokemon.ability
textstrings.push([pokemon.ability.name, 86, 312, 2, base, shadow])
textstrings.push([pokemon.ability.name, 86, 312, :center, base, shadow])
else
textstrings.push([_INTL("No ability"), 86, 312, 2, nonbase, nonshadow])
textstrings.push([_INTL("No ability"), 86, 312, :center, nonbase, nonshadow])
end
if pokemon.item
textstrings.push([pokemon.item.name, 86, 348, 2, base, shadow])
textstrings.push([pokemon.item.name, 86, 348, :center, base, shadow])
else
textstrings.push([_INTL("No item"), 86, 348, 2, nonbase, nonshadow])
textstrings.push([_INTL("No item"), 86, 348, :center, nonbase, nonshadow])
end
imagepos.push(["Graphics/UI/shiny", 156, 198]) if pokemon.shiny?
typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types"))

View File

@@ -32,17 +32,17 @@ class Window_PokemonItemStorage < Window_DrawableCommand
rect = drawCursor(index, rect)
textpos = []
if index == @bag.length
textpos.push([_INTL("CANCEL"), rect.x, rect.y, false, self.baseColor, self.shadowColor])
textpos.push([_INTL("CANCEL"), rect.x, rect.y, :left, self.baseColor, self.shadowColor])
else
item = @bag[index][0]
itemname = @adapter.getDisplayName(item)
baseColor = (index == @sortIndex) ? Color.new(248, 24, 24) : self.baseColor
textpos.push([itemname, rect.x, rect.y, false, self.baseColor, self.shadowColor])
textpos.push([itemname, rect.x, rect.y, :left, self.baseColor, self.shadowColor])
if !GameData::Item.get(item).is_important? # Not a Key item/HM/TM
qty = _ISPRINTF("x{1: 2d}", @bag[index][1])
sizeQty = self.contents.text_size(qty).width
xQty = rect.x + rect.width - sizeQty - 2
textpos.push([qty, xQty, rect.y, false, baseColor, self.shadowColor])
textpos.push([qty, xQty, rect.y, :left, baseColor, self.shadowColor])
end
end
pbDrawTextPositions(self.contents, textpos)

View File

@@ -200,15 +200,15 @@ class Window_PokemonMart < Window_DrawableCommand
rect = drawCursor(index, rect)
ypos = rect.y
if index == count - 1
textpos.push([_INTL("CANCEL"), rect.x, ypos + 2, false, self.baseColor, self.shadowColor])
textpos.push([_INTL("CANCEL"), rect.x, ypos + 2, :left, self.baseColor, self.shadowColor])
else
item = @stock[index]
itemname = @adapter.getDisplayName(item)
qty = @adapter.getDisplayPrice(item)
sizeQty = self.contents.text_size(qty).width
xQty = rect.x + rect.width - sizeQty - 2 - 16
textpos.push([itemname, rect.x, ypos + 2, false, self.baseColor, self.shadowColor])
textpos.push([qty, xQty, ypos + 2, false, self.baseColor, self.shadowColor])
textpos.push([itemname, rect.x, ypos + 2, :left, self.baseColor, self.shadowColor])
textpos.push([qty, xQty, ypos + 2, :left, self.baseColor, self.shadowColor])
end
pbDrawTextPositions(self.contents, textpos)
end

View File

@@ -115,15 +115,15 @@ class Window_BattlePointShop < Window_DrawableCommand
rect = drawCursor(index, rect)
ypos = rect.y
if index == count - 1
textpos.push([_INTL("CANCEL"), rect.x, ypos + 2, false, self.baseColor, self.shadowColor])
textpos.push([_INTL("CANCEL"), rect.x, ypos + 2, :left, self.baseColor, self.shadowColor])
else
item = @stock[index]
itemname = @adapter.getDisplayName(item)
qty = @adapter.getDisplayPrice(item)
sizeQty = self.contents.text_size(qty).width
xQty = rect.x + rect.width - sizeQty - 2 - 16
textpos.push([itemname, rect.x, ypos + 2, false, self.baseColor, self.shadowColor])
textpos.push([qty, xQty, ypos + 2, false, self.baseColor, self.shadowColor])
textpos.push([itemname, rect.x, ypos + 2, :left, self.baseColor, self.shadowColor])
textpos.push([qty, xQty, ypos + 2, :left, self.baseColor, self.shadowColor])
end
pbDrawTextPositions(self.contents, textpos)
end

View File

@@ -59,7 +59,7 @@ class MoveRelearner_Scene
overlay.blt(type_x, 70, @typebitmap.bitmap, type_rect)
end
textpos = [
[_INTL("Teach which move?"), 16, 14, 0, Color.new(88, 88, 80), Color.new(168, 184, 184)]
[_INTL("Teach which move?"), 16, 14, :left, Color.new(88, 88, 80), Color.new(168, 184, 184)]
]
imagepos = []
yPos = 88
@@ -69,13 +69,13 @@ class MoveRelearner_Scene
moveData = GameData::Move.get(moveobject)
type_number = GameData::Type.get(moveData.display_type(@pokemon)).icon_position
imagepos.push(["Graphics/UI/types", 12, yPos - 4, 0, type_number * 28, 64, 28])
textpos.push([moveData.name, 80, yPos, 0, Color.new(248, 248, 248), Color.black])
textpos.push([_INTL("PP"), 112, yPos + 32, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([moveData.name, 80, yPos, :left, Color.new(248, 248, 248), Color.black])
textpos.push([_INTL("PP"), 112, yPos + 32, :left, Color.new(64, 64, 64), Color.new(176, 176, 176)])
if moveData.total_pp > 0
textpos.push([_INTL("{1}/{1}", moveData.total_pp), 230, yPos + 32, 1,
textpos.push([_INTL("{1}/{1}", moveData.total_pp), 230, yPos + 32, :right,
Color.new(64, 64, 64), Color.new(176, 176, 176)])
else
textpos.push(["--", 230, yPos + 32, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push(["--", 230, yPos + 32, :right, Color.new(64, 64, 64), Color.new(176, 176, 176)])
end
end
yPos += 64
@@ -87,13 +87,13 @@ class MoveRelearner_Scene
power = selMoveData.display_damage(@pokemon)
category = selMoveData.display_category(@pokemon)
accuracy = selMoveData.display_accuracy(@pokemon)
textpos.push([_INTL("CATEGORY"), 272, 120, 0, Color.new(248, 248, 248), Color.black])
textpos.push([_INTL("POWER"), 272, 152, 0, Color.new(248, 248, 248), Color.black])
textpos.push([power <= 1 ? power == 1 ? "???" : "---" : power.to_s,
468, 152, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([_INTL("ACCURACY"), 272, 184, 0, Color.new(248, 248, 248), Color.black])
textpos.push([accuracy == 0 ? "---" : "#{accuracy}%",
468, 184, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([_INTL("CATEGORY"), 272, 120, :left, Color.new(248, 248, 248), Color.black])
textpos.push([_INTL("POWER"), 272, 152, :left, Color.new(248, 248, 248), Color.black])
textpos.push([power <= 1 ? power == 1 ? "???" : "---" : power.to_s, 468, 152, :center,
Color.new(64, 64, 64), Color.new(176, 176, 176)])
textpos.push([_INTL("ACCURACY"), 272, 184, :left, Color.new(248, 248, 248), Color.black])
textpos.push([accuracy == 0 ? "---" : "#{accuracy}%", 468, 184, :center,
Color.new(64, 64, 64), Color.new(176, 176, 176)])
pbDrawTextPositions(overlay, textpos)
imagepos.push(["Graphics/UI/category", 436, 116, 0, category * 28, 64, 28])
if @sprites["commands"].index < @moves.length - 1

View File

@@ -648,9 +648,9 @@ class Window_PurifyChamberSets < Window_DrawableCommand
textpos = []
rect = drawCursor(index, rect)
if index == @switching
textpos.push([(index + 1).to_s, rect.x, rect.y, false, Color.new(248, 0, 0), self.shadowColor])
textpos.push([(index + 1).to_s, rect.x, rect.y, :left, Color.new(248, 0, 0), self.shadowColor])
else
textpos.push([(index + 1).to_s, rect.x, rect.y, false, self.baseColor, self.shadowColor])
textpos.push([(index + 1).to_s, rect.x, rect.y, :left, self.baseColor, self.shadowColor])
end
if @chamber.setCount(index) > 0
pbDrawGauge(self.contents, Rect.new(rect.x + 16, rect.y + 6, 48, 8),
@@ -942,8 +942,8 @@ class PurifyChamberSetView < Sprite
type_string += GameData::Type.get(type).name
end
textpos.push([_INTL("{1} Lv.{2} {3}", pkmn.name, pkmn.level, type_string),
2, 6, 0, Color.new(248, 248, 248), Color.new(128, 128, 128)])
textpos.push([_INTL("FLOW"), 2 + (@info.bitmap.width / 2), 30, 0,
2, 6, :left, Color.new(248, 248, 248), Color.new(128, 128, 128)])
textpos.push([_INTL("FLOW"), 2 + (@info.bitmap.width / 2), 30, :left,
Color.new(248, 248, 248), Color.new(128, 128, 128)])
# draw heart gauge
pbDrawGauge(@info.bitmap, Rect.new(@info.bitmap.width * 3 / 4, 8, @info.bitmap.width * 1 / 4, 8),
@@ -953,8 +953,7 @@ class PurifyChamberSetView < Sprite
Color.new(0, 0, 248), @chamber.chamberFlow(@set), 7)
end
if @chamber.setCount(@set) > 0
textpos.push([_INTL("TEMPO"), 2, 30, 0,
Color.new(248, 248, 248), Color.new(128, 128, 128)])
textpos.push([_INTL("TEMPO"), 2, 30, :left, Color.new(248, 248, 248), Color.new(128, 128, 128)])
# draw tempo gauge
pbDrawGauge(@info.bitmap, Rect.new(@info.bitmap.width * 1 / 4, 32, @info.bitmap.width * 1 / 4, 8),
Color.new(0, 0, 248), @chamber[@set].tempo, PurifyChamber.maximumTempo)

View File

@@ -149,9 +149,9 @@ class PokemonEntryScene
pbSetSystemFont(@sprites["gender"].bitmap)
textpos = []
if pokemon.male?
textpos.push([_INTL(""), 0, 6, false, Color.new(0, 128, 248), Color.new(168, 184, 184)])
textpos.push([_INTL(""), 0, 6, :left, Color.new(0, 128, 248), Color.new(168, 184, 184)])
elsif pokemon.female?
textpos.push([_INTL(""), 0, 6, false, Color.new(248, 24, 24), Color.new(168, 184, 184)])
textpos.push([_INTL(""), 0, 6, :left, Color.new(248, 24, 24), Color.new(168, 184, 184)])
end
pbDrawTextPositions(@sprites["gender"].bitmap, textpos)
end
@@ -383,7 +383,7 @@ class PokemonEntryScene2
COLUMNS.times do |y|
ROWS.times do |x|
pos = (y * ROWS) + x
textPos.push([@@Characters[i][0][pos], 44 + (x * 32), 24 + (y * 38), 2,
textPos.push([@@Characters[i][0][pos], 44 + (x * 32), 24 + (y * 38), :center,
Color.new(16, 24, 32), Color.new(160, 160, 160)])
end
end
@@ -430,9 +430,9 @@ class PokemonEntryScene2
pbSetSystemFont(@sprites["gender"].bitmap)
textpos = []
if pokemon.male?
textpos.push([_INTL(""), 0, 6, false, Color.new(0, 128, 248), Color.new(168, 184, 184)])
textpos.push([_INTL(""), 0, 6, :left, Color.new(0, 128, 248), Color.new(168, 184, 184)])
elsif pokemon.female?
textpos.push([_INTL(""), 0, 6, false, Color.new(248, 24, 24), Color.new(168, 184, 184)])
textpos.push([_INTL(""), 0, 6, :left, Color.new(248, 24, 24), Color.new(168, 184, 184)])
end
pbDrawTextPositions(@sprites["gender"].bitmap, textpos)
end
@@ -507,12 +507,12 @@ class PokemonEntryScene2
bgoverlay.clear
pbSetSystemFont(bgoverlay)
textPositions = [
[@helptext, 160, 18, false, Color.new(16, 24, 32), Color.new(168, 184, 184)]
[@helptext, 160, 18, :left, Color.new(16, 24, 32), Color.new(168, 184, 184)]
]
chars = @helper.textChars
x = 172
chars.each do |ch|
textPositions.push([ch, x, 54, 2, Color.new(16, 24, 32), Color.new(168, 184, 184)])
textPositions.push([ch, x, 54, :center, Color.new(16, 24, 32), Color.new(168, 184, 184)])
x += 24
end
pbDrawTextPositions(bgoverlay, textPositions)

View File

@@ -200,8 +200,8 @@ class TriadScene
pbSetSystemFont(@sprites["overlay"].bitmap)
pbDrawTextPositions(
@sprites["overlay"].bitmap,
[[@battle.opponentName, 52, 10, 2, Color.new(248, 248, 248), Color.new(96, 96, 96)],
[@battle.playerName, Graphics.width - 52, 10, 2, Color.new(248, 248, 248), Color.new(96, 96, 96)]]
[[@battle.opponentName, 52, 10, :center, Color.new(248, 248, 248), Color.new(96, 96, 96)],
[@battle.playerName, Graphics.width - 52, 10, :center, Color.new(248, 248, 248), Color.new(96, 96, 96)]]
)
@sprites["score"] = Sprite.new(@viewport)
@sprites["score"].bitmap = BitmapWrapper.new(Graphics.width, Graphics.height)
@@ -578,7 +578,7 @@ class TriadScene
end
pbDrawTextPositions(
bitmap,
[[_INTL("{1}-{2}", oppscore, playerscore), Graphics.width / 2, 10, 2, Color.new(248, 248, 248), Color.new(96, 96, 96)]]
[[_INTL("{1}-{2}", oppscore, playerscore), Graphics.width / 2, 10, :center, Color.new(248, 248, 248), Color.new(96, 96, 96)]]
)
end

View File

@@ -88,7 +88,7 @@ class PokemonTilesetScene
TILES_PER_ROW.times do |xx|
tile_id = tile_ID_from_coordinates(xx, @top_y + yy)
terr = @tileset.terrain_tags[tile_id]
textpos.push([terr.to_s, (xx * TILE_SIZE) + (TILE_SIZE / 2), (yy * TILE_SIZE) + 6, 2, TEXT_COLOR, TEXT_SHADOW_COLOR])
textpos.push([terr.to_s, (xx * TILE_SIZE) + (TILE_SIZE / 2), (yy * TILE_SIZE) + 6, :center, TEXT_COLOR, TEXT_SHADOW_COLOR])
end
end
pbDrawTextPositions(@sprites["overlay"].bitmap, textpos)
@@ -123,8 +123,8 @@ class PokemonTilesetScene
terrain_tag_name = terrain_tag.to_s
end
textpos = [
[_INTL("Terrain Tag:"), tile_x + TILE_SIZE, tile_y + (TILE_SIZE * 2) + 22, 2, Color.new(248, 248, 248), Color.new(40, 40, 40)],
[terrain_tag_name, tile_x + TILE_SIZE, tile_y + (TILE_SIZE * 2) + 54, 2, Color.new(248, 248, 248), Color.new(40, 40, 40)]
[_INTL("Terrain Tag:"), tile_x + TILE_SIZE, tile_y + (TILE_SIZE * 2) + 22, :center, Color.new(248, 248, 248), Color.new(40, 40, 40)],
[terrain_tag_name, tile_x + TILE_SIZE, tile_y + (TILE_SIZE * 2) + 54, :center, Color.new(248, 248, 248), Color.new(40, 40, 40)]
]
# Draw all text
pbDrawTextPositions(overlay, textpos)