Fixed battle graphics being incorrectly positioned, fixed mispositioned number choice window text

This commit is contained in:
Maruno17
2020-11-27 21:14:38 +00:00
parent eb22e49d9b
commit 01f451b398
4 changed files with 27 additions and 27 deletions

View File

@@ -33,11 +33,11 @@ end
class Spriteset_Map
attr_reader :map
attr_accessor :tilemap
@@viewport0 = Viewport.new(0,0,Graphics.width,Graphics.height) # Panorama
@@viewport0 = Viewport.new(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) # Panorama
@@viewport0.z = -100
@@viewport1 = Viewport.new(0,0,Graphics.width,Graphics.height) # Map, events, player, fog
@@viewport1 = Viewport.new(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) # Map, events, player, fog
@@viewport1.z = 0
@@viewport3 = Viewport.new(0,0,Graphics.width,Graphics.height) # Flashing
@@viewport3 = Viewport.new(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) # Flashing
@@viewport3.z = 500
def Spriteset_Map.viewport # For access by Spriteset_Global

View File

@@ -1,6 +1,6 @@
class Spriteset_Global
attr_reader :playersprite
@@viewport2 = Viewport.new(0, 0, Graphics.width, Graphics.height)
@@viewport2 = Viewport.new(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)
@@viewport2.z = 200
def initialize

View File

@@ -663,11 +663,11 @@ class Window_InputNumberPokemon < SpriteWindow_Base
self.contents.clear
s=sprintf("%0*d",@digits_max,@number.abs)
if @sign
textHelper(0,0,@negative ? "-" : "+",0)
textHelper(0,6,@negative ? "-" : "+",0)
end
for i in 0...@digits_max
index=i+(@sign ? 1 : 0)
textHelper(index*24,0,s[i,1],index)
textHelper(index*24,6,s[i,1],index)
end
end
@@ -715,13 +715,9 @@ class Window_InputNumberPokemon < SpriteWindow_Base
def textHelper(x,y,text,i)
textwidth=self.contents.text_size(text).width
self.contents.font.color=@shadowColor
pbDrawShadow(self.contents,x+(12-textwidth/2),y, textwidth+4, 32, text)
self.contents.font.color=@baseColor
self.contents.draw_text(x+(12-textwidth/2),y, textwidth+4, 32, text)
pbDrawShadowText(self.contents, x+(12-textwidth/2), y, textwidth+4, 32, text, @baseColor, @shadowColor)
if @index==i && @active && @frame/15==0
colors=getDefaultTextColors(self.windowskin)
self.contents.fill_rect(x+(12-textwidth/2),y+30,textwidth,2,colors[0])
self.contents.fill_rect(x+(12-textwidth/2), y+24, textwidth, 2, @baseColor)
end
end
end

View File

@@ -1,27 +1,29 @@
module PokeBattle_SceneConstants
USE_ABILITY_SPLASH = true
# Text colors
MESSAGE_BASE_COLOR = Color.new(80,80,88)
MESSAGE_SHADOW_COLOR = Color.new(160,160,168)
MESSAGE_BASE_COLOR = Color.new(80, 80, 88)
MESSAGE_SHADOW_COLOR = Color.new(160, 160, 168)
# The number of party balls to show in each side's lineup.
NUM_BALLS = 6
# Centre bottom of the player's side base graphic
PLAYER_BASE_X = 128
PLAYER_BASE_Y = Graphics.height - 80
PLAYER_BASE_Y = SCREEN_HEIGHT - 80
# Centre middle of the foe's side base graphic
FOE_BASE_X = Graphics.width - 128
FOE_BASE_Y = (Graphics.height * 3/4) - 112
FOE_BASE_X = SCREEN_WIDTH - 128
FOE_BASE_Y = (SCREEN_HEIGHT * 3 / 4) - 112
# Returns where the centre bottom of a battler's sprite should be, given its
# index and the number of battlers on its side, assuming the battler has
# metrics of 0 (those are added later).
def self.pbBattlerPosition(index,sideSize=1)
def self.pbBattlerPosition(index, sideSize = 1)
# Start at the centre of the base for the appropriate side
if (index&1)==0; ret = [PLAYER_BASE_X,PLAYER_BASE_Y]
else; ret = [FOE_BASE_X,FOE_BASE_Y]
if (index & 1) == 0
ret = [PLAYER_BASE_X, PLAYER_BASE_Y]
else
ret = [FOE_BASE_X, FOE_BASE_Y]
end
# Shift depending on index (no shifting needed for sideSize of 1)
case sideSize
@@ -37,19 +39,21 @@ module PokeBattle_SceneConstants
# Returns where the centre bottom of a trainer's sprite should be, given its
# side (0/1), index and the number of trainers on its side.
def self.pbTrainerPosition(side,index=0,sideSize=1)
def self.pbTrainerPosition(side, index = 0, sideSize = 1)
# Start at the centre of the base for the appropriate side
if side==0; ret = [PLAYER_BASE_X,PLAYER_BASE_Y-16]
else; ret = [FOE_BASE_X,FOE_BASE_Y+6]
if side == 0
ret = [PLAYER_BASE_X, PLAYER_BASE_Y - 16]
else
ret = [FOE_BASE_X, FOE_BASE_Y + 6]
end
# Shift depending on index (no shifting needed for sideSize of 1)
case sideSize
when 2
ret[0] += [-48, 48, 32, -32][2*index+side]
ret[1] += [ 0, 0, 0, -16][2*index+side]
ret[0] += [-48, 48, 32, -32][2 * index + side]
ret[1] += [ 0, 0, 0, -16][2 * index + side]
when 3
ret[0] += [-80, 80, 0, 0, 80, -80][2*index+side]
ret[1] += [ 0, 0, 0, -8, 0, -16][2*index+side]
ret[0] += [-80, 80, 0, 0, 80, -80][2 * index + side]
ret[1] += [ 0, 0, 0, -8, 0, -16][2 * index + side]
end
return ret
end