diff --git a/Data/Scripts/015_Items/006_PItem_Mail.rb b/Data/Scripts/015_Items/006_PItem_Mail.rb index 8d8ad1414..27569bb73 100644 --- a/Data/Scripts/015_Items/006_PItem_Mail.rb +++ b/Data/Scripts/015_Items/006_PItem_Mail.rb @@ -91,8 +91,8 @@ end def pbWriteMail(item,pkmn,pkmnid,scene) message = "" loop do - message = pbMessageFreeText(_INTL("Please enter a message (max. 256 characters)."), - "",false,256,Graphics.width) { scene.pbUpdate } + message = pbMessageFreeText(_INTL("Please enter a message (max. 250 characters)."), + "",false,250,Graphics.width) { scene.pbUpdate } if message!="" # Store mail if a message was written poke1 = poke2 = nil diff --git a/Data/Scripts/017_UI/005_PScreen_Party.rb b/Data/Scripts/017_UI/005_PScreen_Party.rb index 315884a77..2bdf2a243 100644 --- a/Data/Scripts/017_UI/005_PScreen_Party.rb +++ b/Data/Scripts/017_UI/005_PScreen_Party.rb @@ -136,8 +136,8 @@ class PokemonPartyBlankPanel < SpriteWrapper def initialize(_pokemon,index,viewport=nil) super(viewport) - self.x = [0,256,0,256,0,256][index] - self.y = [0,16,96,112,192,208][index] + self.x = [0, Graphics.width/2][index%2] + self.y = [0, 16, 96, 112, 192, 208][index] @panelbgsprite = AnimatedBitmap.new("Graphics/Pictures/Party/panel_blank") self.bitmap = @panelbgsprite.bitmap @text = nil @@ -172,8 +172,8 @@ class PokemonPartyPanel < SpriteWrapper @pokemon = pokemon @active = (index==0) # true = rounded panel, false = rectangular panel @refreshing = true - self.x = [0,256,0,256,0,256][index] - self.y = [0,16,96,112,192,208][index] + self.x = [0, Graphics.width/2][index%2] + self.y = [0, 16, 96, 112, 192, 208][index] @panelbgsprite = ChangelingSprite.new(0,0,viewport) @panelbgsprite.z = self.z if @active # Rounded panel diff --git a/Data/Scripts/017_UI/009_PScreen_RegionMap.rb b/Data/Scripts/017_UI/009_PScreen_RegionMap.rb index ce0850b60..621947e03 100644 --- a/Data/Scripts/017_UI/009_PScreen_RegionMap.rb +++ b/Data/Scripts/017_UI/009_PScreen_RegionMap.rb @@ -212,7 +212,7 @@ class PokemonRegionMap_Scene break end end - currentname = pbMessageFreeText(_INTL("Set the name for this point."),currentname,false,256) { pbUpdate } + currentname = pbMessageFreeText(_INTL("Set the name for this point."),currentname,false,250) { pbUpdate } if currentname if currentobj currentobj[2] = currentname diff --git a/Data/Scripts/017_UI/026_PScreen_MysteryGift.rb b/Data/Scripts/017_UI/026_PScreen_MysteryGift.rb index 43ed60a76..6b9e45822 100644 --- a/Data/Scripts/017_UI/026_PScreen_MysteryGift.rb +++ b/Data/Scripts/017_UI/026_PScreen_MysteryGift.rb @@ -47,7 +47,7 @@ def pbEditMysteryGift(type,item,id=0,giftname="") item.obtainText=commands[command] break elsif command==commands.length-1 - obtainname=pbMessageFreeText(_INTL("Enter a phrase."),"",false,32) + obtainname=pbMessageFreeText(_INTL("Enter a phrase."),"",false,30) if obtainname!="" item.obtainText=obtainname break @@ -96,7 +96,7 @@ def pbEditMysteryGift(type,item,id=0,giftname="") end end loop do - newgiftname=pbMessageFreeText(_INTL("Enter a name for the gift."),giftname,false,32) + newgiftname=pbMessageFreeText(_INTL("Enter a name for the gift."),giftname,false,250) if newgiftname!="" giftname=newgiftname break diff --git a/Data/Scripts/018_Minigames/004_PMinigame_VoltorbFlip.rb b/Data/Scripts/018_Minigames/004_PMinigame_VoltorbFlip.rb index f761ee47e..781cacedb 100644 --- a/Data/Scripts/018_Minigames/004_PMinigame_VoltorbFlip.rb +++ b/Data/Scripts/018_Minigames/004_PMinigame_VoltorbFlip.rb @@ -171,12 +171,12 @@ class VoltorbFlip @sprites["curtain"].opacity=0 @sprites["curtainL"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport) @sprites["curtainL"].z=99999 - @sprites["curtainL"].x=256 + @sprites["curtainL"].x=Graphics.width/2 @sprites["curtainL"].angle=-90 @sprites["curtainL"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(0,0,0)) @sprites["curtainR"]=BitmapSprite.new(Graphics.width,Graphics.height*2,@viewport) @sprites["curtainR"].z=99999 - @sprites["curtainR"].x=256 + @sprites["curtainR"].x=Graphics.width/2 @sprites["curtainR"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height*2,Color.new(0,0,0)) @sprites["cursor"]=BitmapSprite.new(Graphics.width,Graphics.height,@viewport) @sprites["cursor"].z=99998 diff --git a/Data/Scripts/021_Debug/002_Debug_Actions.rb b/Data/Scripts/021_Debug/002_Debug_Actions.rb index 49598df12..d42b9bb53 100644 --- a/Data/Scripts/021_Debug/002_Debug_Actions.rb +++ b/Data/Scripts/021_Debug/002_Debug_Actions.rb @@ -127,7 +127,7 @@ def pbDebugVariableScreen(id) $game_variables[id] = [$game_variables[id],-99999999].max elsif $game_variables[id].is_a?(String) value = pbMessageFreeText(_INTL("Set variable {1}.",id), - $game_variables[id],false,256,Graphics.width) + $game_variables[id],false,250,Graphics.width) $game_variables[id] = value end end diff --git a/Data/Scripts/021_Debug/004_Editor_Screens.rb b/Data/Scripts/021_Debug/004_Editor_Screens.rb index bb4d8ecda..5568fdf27 100644 --- a/Data/Scripts/021_Debug/004_Editor_Screens.rb +++ b/Data/Scripts/021_Debug/004_Editor_Screens.rb @@ -175,16 +175,16 @@ def pbEncounterEditorMap(encdata,map) enccmd = pbListWindow([]) # This window displays the help text enchelp = Window_UnformattedTextPokemon.new("") - enchelp.x = 256 + enchelp.x = Graphics.width/2 enchelp.y = 0 - enchelp.width = 224 + enchelp.width = Graphics.width/2 - 32 enchelp.height = 96 enchelp.z = 99999 mapinfos = load_data("Data/MapInfos.rxdata") mapname = mapinfos[map].name loop do enc = encdata[map] - enchelp.text = mapname + enchelp.text = _ISPRINTF("{1:03d}: {2:s}\r\nChoose a method",map,mapname) choice = pbEncounterEditorTypes(enc,enccmd) if !enc enc = [EncounterTypes::EnctypeDensities.clone,[]] @@ -197,11 +197,11 @@ def pbEncounterEditorMap(encdata,map) elsif choice==-3 ret = pbNewEncounterType(enc) if ret>=0 - enchelp.text = _INTL("{1}\r\n{2}",mapname,EncounterTypes::Names[ret]) + enchelp.text = _ISPRINTF("{1:03d}: {2:s}\r\n{3:s}",map,mapname,EncounterTypes::Names[ret]) pbEditEncounterType(enc,ret) end else - enchelp.text = _INTL("{1}\r\n{2}",mapname,EncounterTypes::Names[choice]) + enchelp.text = _ISPRINTF("{1:03d}: {2:s}\r\n{3:s}",map,mapname,EncounterTypes::Names[choice]) pbEditEncounterType(enc,choice) end end @@ -228,7 +228,7 @@ def pbTrainerTypeEditorNew(trconst) end trainertype = maxid+1 trname = pbMessageFreeText(_INTL("Please enter the trainer type's name."), - (trconst) ? trconst.gsub(/_+/," ") : "",false,256) + (trconst) ? trconst.gsub(/_+/," ") : "",false,30) return -1 if trname=="" && !trconst # Create an internal name based on the trainer type's name if there is none. trconst = trname if !trconst @@ -432,7 +432,7 @@ def pbTrainerBattleEditor else next end - trainername = pbMessageFreeText(_INTL("Now enter the trainer's name."),"",false,32) + trainername = pbMessageFreeText(_INTL("Now enter the trainer's name."),"",false,30) next if trainername=="" trainerparty = pbGetFreeTrainerParty(trainertype,trainername) if trainerparty<0 @@ -1086,9 +1086,9 @@ def pbRegionalDexEditor(dex) viewport = Viewport.new(0,0,Graphics.width,Graphics.height) viewport.z = 99999 info = Window_AdvancedTextPokemon.new(_INTL("Z+Up/Down: Rearrange entries\nZ+Right: Insert new entry\nZ+Left: Delete entry\nF: Clear entry")) - info.x = 256 + info.x = Graphics.width/2 info.y = 64 - info.width = Graphics.width-256 + info.width = Graphics.width/2 info.height = Graphics.height-64 info.viewport = viewport info.z = 2 @@ -1229,16 +1229,16 @@ def pbRegionalDexEditorMain cmdwin.viewport = viewport cmdwin.z = 2 title = Window_UnformattedTextPokemon.new(_INTL("Regional Dexes Editor")) - title.x = 256 + title.x = Graphics.width/2 title.y = 0 - title.width = Graphics.width-256 + title.width = Graphics.width/2 title.height = 64 title.viewport = viewport title.z = 2 info = Window_AdvancedTextPokemon.new(_INTL("Z+Up/Down: Rearrange Dexes")) - info.x = 256 + info.x = Graphics.width/2 info.y = 64 - info.width = Graphics.width-256 + info.width = Graphics.width/2 info.height = Graphics.height-64 info.viewport = viewport info.z = 2 @@ -1387,16 +1387,16 @@ def pbAnimationsOrganiser cmdwin.viewport = viewport cmdwin.z = 2 title = Window_UnformattedTextPokemon.new(_INTL("Animations Organiser")) - title.x = 256 + title.x = Graphics.width/2 title.y = 0 - title.width = Graphics.width-256 + title.width = Graphics.width/2 title.height = 64 title.viewport = viewport title.z = 2 info = Window_AdvancedTextPokemon.new(_INTL("Z+Up/Down: Swap\nZ+Left: Delete\nZ+Right: Insert")) - info.x = 256 + info.x = Graphics.width/2 info.y = 64 - info.width = Graphics.width-256 + info.width = Graphics.width/2 info.height = Graphics.height-64 info.viewport = viewport info.z = 2 diff --git a/Data/Scripts/021_Debug/006_Editor_DataTypes.rb b/Data/Scripts/021_Debug/006_Editor_DataTypes.rb index ed3a30896..6cf4e0f05 100644 --- a/Data/Scripts/021_Debug/006_Editor_DataTypes.rb +++ b/Data/Scripts/021_Debug/006_Editor_DataTypes.rb @@ -156,7 +156,7 @@ end module StringProperty def self.set(settingname,oldsetting) return pbMessageFreeText(_INTL("Set the value for {1}.",settingname), - (oldsetting) ? oldsetting : "",false,256,Graphics.width) + (oldsetting) ? oldsetting : "",false,250,Graphics.width) end def self.format(value) @@ -720,7 +720,7 @@ end module ItemNameProperty def self.set(settingname,oldsetting) return pbMessageFreeText(_INTL("Set the value for {1}.",settingname), - (oldsetting) ? oldsetting : "",false,12) + (oldsetting) ? oldsetting : "",false,30) end def self.defaultValue @@ -1120,7 +1120,7 @@ module FormNamesProperty if cmd[1]>=0 entry = realcmds[cmd[1]] if entry[1]<0 # Add new form - newname = pbMessageFreeText(_INTL("Choose a form name (no commas)."),"",false,255) + newname = pbMessageFreeText(_INTL("Choose a form name (no commas)."),"",false,250) if newname!="" realcmds.push([newname,realcmds.length-1]) refreshlist = true @@ -1129,7 +1129,7 @@ module FormNamesProperty cmd2 = pbMessage(_INTL("\\ts[]Do what with this form name?"), [_INTL("Rename"),_INTL("Delete"),_INTL("Cancel")],3) if cmd2==0 - newname = pbMessageFreeText(_INTL("Choose a form name (no commas)."),entry[0],false,255) + newname = pbMessageFreeText(_INTL("Choose a form name (no commas)."),entry[0],false,250) if newname!="" realcmds[cmd[1]][0] = newname refreshlist = true diff --git a/Data/Scripts/021_Debug/007_Editor_Listers.rb b/Data/Scripts/021_Debug/007_Editor_Listers.rb index 870ba24a3..936b4e4c4 100644 --- a/Data/Scripts/021_Debug/007_Editor_Listers.rb +++ b/Data/Scripts/021_Debug/007_Editor_Listers.rb @@ -130,6 +130,8 @@ class GraphicsLister def initialize(folder,selection) @sprite = IconSprite.new(0,0) @sprite.bitmap = nil + @sprite.x = Graphics.width * 3 / 4 + @sprite.y = (Graphics.height - 64) / 2 + 64 @sprite.z = 2 @folder = folder @selection = selection @@ -179,23 +181,18 @@ class GraphicsLister def refresh(index) return if index<0 @sprite.setBitmap(@folder+@commands[index]) - ww = @sprite.bitmap.width - wh = @sprite.bitmap.height - sx = (Graphics.width-256).to_f/ww - sy = (Graphics.height-64).to_f/wh - if sx<1.0 || sy<1.0 - if sx>sy - ww = sy*ww - wh = (Graphics.height-64).to_f - else - wh = sx*wh - ww = (Graphics.width-256).to_f - end + sprite_width = @sprite.bitmap.width + sprite_height = @sprite.bitmap.height + @sprite.ox = sprite_width/2 + @sprite.oy = sprite_height/2 + scale_x = (Graphics.width/2).to_f/sprite_width + scale_y = (Graphics.height-64).to_f/sprite_height + if scale_x<1.0 || scale_y<1.0 + min_scale = [scale_x, scale_y].min + @sprite.zoom_x = @sprite.zoom_y = min_scale + else + @sprite.zoom_x = @sprite.zoom_y = 1.0 end - @sprite.x = (Graphics.width-((Graphics.width-256)/2))-(ww/2) - @sprite.y = (Graphics.height-((Graphics.height-64)/2))-(wh/2) - @sprite.zoom_x = ww*1.0/@sprite.bitmap.width - @sprite.zoom_y = wh*1.0/@sprite.bitmap.height end end @@ -272,7 +269,9 @@ class MapLister def initialize(selmap,addGlobal=false) @sprite = SpriteWrapper.new @sprite.bitmap = nil - @sprite.z = 2 + @sprite.x = Graphics.width * 3 / 4 + @sprite.y = (Graphics.height - 64) / 2 + 64 + @sprite.z = -2 @commands = [] @maps = pbMapTree @addGlobalOffset = (addGlobal) ? 1 : 0 @@ -318,8 +317,8 @@ class MapLister return if index<0 return if index==0 && @addGlobalOffset==1 @sprite.bitmap = createMinimap(@maps[index-@addGlobalOffset][0]) - @sprite.x = (Graphics.width-((Graphics.width-256)/2))-(@sprite.bitmap.width/2) - @sprite.y = (Graphics.height-((Graphics.height-64)/2))-(@sprite.bitmap.height/2) + @sprite.ox = @sprite.bitmap.width/2 + @sprite.oy = @sprite.bitmap.height/2 end end @@ -444,6 +443,8 @@ class TrainerTypeLister def initialize(selection,includeNew) @sprite = IconSprite.new(0,0) @sprite.bitmap = nil + @sprite.x = Graphics.width * 3 / 4 + @sprite.y = (Graphics.height - 64) / 2 + 64 @sprite.z = 2 @selection = selection @commands = [] @@ -499,23 +500,18 @@ class TrainerTypeLister rescue @sprite.setBitmap(nil) end - ww = @sprite.bitmap.width - wh = @sprite.bitmap.height - sx = (Graphics.width-256).to_f()/ww - sy = (Graphics.height-64).to_f()/wh - if sx<1.0 || sy<1.0 - if sx>sy - ww = sy*ww - wh = (Graphics.height-64).to_f() - else - wh = sx*wh - ww = (Graphics.width-256).to_f() - end + sprite_width = @sprite.bitmap.width + sprite_height = @sprite.bitmap.height + @sprite.ox = sprite_width/2 + @sprite.oy = sprite_height/2 + scale_x = (Graphics.width/2).to_f/sprite_width + scale_y = (Graphics.height-64).to_f/sprite_height + if scale_x<1.0 || scale_y<1.0 + min_scale = [scale_x, scale_y].min + @sprite.zoom_x = @sprite.zoom_y = min_scale + else + @sprite.zoom_x = @sprite.zoom_y = 1.0 end - @sprite.x = (Graphics.width-((Graphics.width-256)/2))-(ww/2) - @sprite.y = (Graphics.height-((Graphics.height-64)/2))-(wh/2) - @sprite.zoom_x = ww*1.0/@sprite.bitmap.width - @sprite.zoom_y = wh*1.0/@sprite.bitmap.height end end diff --git a/Data/Scripts/021_Debug/008_Editor_Utilities.rb b/Data/Scripts/021_Debug/008_Editor_Utilities.rb index 0c7590d67..28c5a3efc 100644 --- a/Data/Scripts/021_Debug/008_Editor_Utilities.rb +++ b/Data/Scripts/021_Debug/008_Editor_Utilities.rb @@ -400,10 +400,10 @@ def pbCommands2(cmdwindow,commands,cmdIfCancel,defaultindex=-1,noresize=false) cmdwindow.index = defaultindex if defaultindex>=0 cmdwindow.x = 0 cmdwindow.y = 0 - if !noresize - cmdwindow.width = 256 - else + if noresize cmdwindow.height = Graphics.height + else + cmdwindow.width = Graphics.width/2 end cmdwindow.height = Graphics.height if cmdwindow.height>Graphics.height cmdwindow.z = 99999 @@ -437,10 +437,10 @@ def pbCommands3(cmdwindow,commands,cmdIfCancel,defaultindex=-1,noresize=false) cmdwindow.index = defaultindex if defaultindex>=0 cmdwindow.x = 0 cmdwindow.y = 0 - if !noresize - cmdwindow.width = 256 - else + if noresize cmdwindow.height = Graphics.height + else + cmdwindow.width = Graphics.width/2 end cmdwindow.height = Graphics.height if cmdwindow.height>Graphics.height cmdwindow.z = 99999 @@ -528,10 +528,10 @@ end def pbCommandsSortable(cmdwindow,commands,cmdIfCancel,defaultindex=-1,sortable=false) cmdwindow.commands = commands - cmdwindow.index = defaultindex if defaultindex>=0 + cmdwindow.index = defaultindex if defaultindex >= 0 cmdwindow.x = 0 cmdwindow.y = 0 - cmdwindow.width = 256 if cmdwindow.width<256 + cmdwindow.width = Graphics.width / 2 if cmdwindow.width < Graphics.width / 2 cmdwindow.height = Graphics.height cmdwindow.z = 99999 cmdwindow.active = true diff --git a/Data/Scripts/021_Debug/009_Editor_TilesetEditor.rb b/Data/Scripts/021_Debug/009_Editor_TilesetEditor.rb index 694cd9541..2471519de 100644 --- a/Data/Scripts/021_Debug/009_Editor_TilesetEditor.rb +++ b/Data/Scripts/021_Debug/009_Editor_TilesetEditor.rb @@ -17,31 +17,34 @@ end class PokemonTilesetScene + TILESET_WIDTH = 256 + TILE_SIZE = 32 + def pbUpdateTileset @sprites["overlay"].bitmap.clear textpos = [] - @sprites["tileset"].src_rect = Rect.new(0,@topy,256,Graphics.height-64) + @sprites["tileset"].src_rect = Rect.new(0,@topy,TILESET_WIDTH,Graphics.height) tilesize = @tileset.terrain_tags.xsize - for yy in 0...(Graphics.height-64)/32 - ypos = (yy+(@topy/32))*8+384 + for yy in 0...Graphics.height/TILE_SIZE + ypos = (yy+(@topy/TILE_SIZE))*8+384 next if ypos>=tilesize for xx in 0...8 terr = ypos<384 ? @tileset.terrain_tags[xx*48] : @tileset.terrain_tags[ypos+xx] if ypos<384 - @tilehelper.bltTile(@sprites["overlay"].bitmap,xx*32,yy*32,xx*48) + @tilehelper.bltTile(@sprites["overlay"].bitmap,xx*TILE_SIZE,yy*TILE_SIZE,xx*48) end - textpos.push(["#{terr}",xx*32+16,yy*32,2,Color.new(80,80,80),Color.new(192,192,192)]) + textpos.push(["#{terr}",xx*TILE_SIZE+TILE_SIZE/2,yy*TILE_SIZE,2,Color.new(80,80,80),Color.new(192,192,192)]) end end - @sprites["overlay"].bitmap.fill_rect(@x,@y-@topy,32,4,Color.new(255,0,0)) - @sprites["overlay"].bitmap.fill_rect(@x,@y-@topy,4,32,Color.new(255,0,0)) - @sprites["overlay"].bitmap.fill_rect(@x,@y-@topy+28,32,4,Color.new(255,0,0)) - @sprites["overlay"].bitmap.fill_rect(@x+28,@y-@topy,4,32,Color.new(255,0,0)) + @sprites["overlay"].bitmap.fill_rect(@x,@y-@topy,TILE_SIZE,4,Color.new(255,0,0)) + @sprites["overlay"].bitmap.fill_rect(@x,@y-@topy,4,TILE_SIZE,Color.new(255,0,0)) + @sprites["overlay"].bitmap.fill_rect(@x,@y-@topy+28,TILE_SIZE,4,Color.new(255,0,0)) + @sprites["overlay"].bitmap.fill_rect(@x+28,@y-@topy,4,TILE_SIZE,Color.new(255,0,0)) pbDrawTextPositions(@sprites["overlay"].bitmap,textpos) end def pbGetSelected(x,y) - return (y<0) ? 48*(x/32) : (y/32)*8+384+(x/32) + return (y<0) ? 48*(x/TILE_SIZE) : (y/TILE_SIZE)*8+384+(x/TILE_SIZE) end def pbSetSelected(i,value) @@ -66,8 +69,8 @@ class PokemonTilesetScene @tilehelper = TileDrawingHelper.fromTileset(@tileset) @sprites["tileset"].setBitmap("Graphics/Tilesets/#{@tileset.tileset_name}") @x = 0 - @y = -32 - @topy = -32 + @y = -TILE_SIZE + @topy = -TILE_SIZE pbUpdateTileset end end @@ -79,25 +82,25 @@ class PokemonTilesetScene @tileset = @tilesetwrapper.data[1] @tilehelper = TileDrawingHelper.fromTileset(@tileset) @sprites = {} - @sprites["title"] = Window_UnformattedTextPokemon.new(_INTL("Tileset Editor (PgUp/PgDn: SCROLL; Z: MENU)")) + @sprites["title"] = Window_UnformattedTextPokemon.new(_INTL("Tileset Editor\r\nPgUp/PgDn: SCROLL\r\nZ: MENU")) @sprites["title"].viewport = @viewport - @sprites["title"].x = 0 + @sprites["title"].x = TILESET_WIDTH @sprites["title"].y = 0 - @sprites["title"].width = Graphics.width - @sprites["title"].height = 64 - @sprites["tileset"] = IconSprite.new(0,64,@viewport) + @sprites["title"].width = Graphics.width - TILESET_WIDTH + @sprites["title"].height = 128 + @sprites["tileset"] = IconSprite.new(0,0,@viewport) @sprites["tileset"].setBitmap("Graphics/Tilesets/#{@tileset.tileset_name}") - @sprites["tileset"].src_rect = Rect.new(0,0,256,Graphics.height-64) - @sprites["overlay"] = BitmapSprite.new(256,Graphics.height-64,@viewport) + @sprites["tileset"].src_rect = Rect.new(0,0,TILESET_WIDTH,Graphics.height) + @sprites["overlay"] = BitmapSprite.new(TILESET_WIDTH,Graphics.height,@viewport) @sprites["overlay"].x = 0 - @sprites["overlay"].y = 64 + @sprites["overlay"].y = 0 pbSetSystemFont(@sprites["overlay"].bitmap) @sprites["title"].visible = true @sprites["tileset"].visible = true @sprites["overlay"].visible = true @x = 0 - @y = -32 - @topy = -32 + @y = -TILE_SIZE + @topy = -TILE_SIZE pbUpdateTileset pbFadeInAndShow(@sprites) height = @sprites["tileset"].bitmap.height @@ -106,37 +109,37 @@ class PokemonTilesetScene Graphics.update Input.update if Input.repeat?(Input::UP) - @y -= 32 - @y = -32 if @y<-32 + @y -= TILE_SIZE + @y = -TILE_SIZE if @y<-TILE_SIZE @topy = @y if @y<@topy pbUpdateTileset elsif Input.repeat?(Input::DOWN) - @y += 32 - @y = height-32 if @y>=height-32 - @topy = @y-(Graphics.height-64)+32 if @y-@topy>=Graphics.height-64 + @y += TILE_SIZE + @y = height-TILE_SIZE if @y>=height-TILE_SIZE + @topy = @y-Graphics.height+TILE_SIZE if @y-@topy>=Graphics.height pbUpdateTileset elsif Input.repeat?(Input::LEFT) - @x -= 32 + @x -= TILE_SIZE @x = 0 if @x<0 pbUpdateTileset elsif Input.repeat?(Input::RIGHT) - @x += 32 - @x = 256-32 if @x>=256-32 + @x += TILE_SIZE + @x = TILESET_WIDTH-TILE_SIZE if @x>=TILESET_WIDTH-TILE_SIZE pbUpdateTileset elsif Input.repeat?(Input::L) - @y -= ((Graphics.height-64)/32)*32 - @topy -= ((Graphics.height-64)/32)*32 - @y = -32 if @y<-32 + @y -= (Graphics.height/TILE_SIZE)*TILE_SIZE + @topy -= (Graphics.height/TILE_SIZE)*TILE_SIZE + @y = -TILE_SIZE if @y<-TILE_SIZE @topy = @y if @y<@topy - @topy = -32 if @topy<-32 + @topy = -TILE_SIZE if @topy<-TILE_SIZE pbUpdateTileset elsif Input.repeat?(Input::R) - @y += ((Graphics.height-64)/32)*32 - @topy += ((Graphics.height-64)/32)*32 - @y = height-32 if @y>=height-32 - @topy = @y-(Graphics.height-64)+32 if @y-@topy>=Graphics.height-64 - if @topy>=height-(Graphics.height-64) - @topy = height-(Graphics.height-64) + @y += (Graphics.height/TILE_SIZE)*TILE_SIZE + @topy += (Graphics.height/TILE_SIZE)*TILE_SIZE + @y = height-TILE_SIZE if @y>=height-TILE_SIZE + @topy = @y-Graphics.height+TILE_SIZE if @y-@topy>=Graphics.height + if @topy>=height-Graphics.height + @topy = height-Graphics.height end pbUpdateTileset elsif Input.trigger?(Input::A) @@ -149,11 +152,11 @@ class PokemonTilesetScene ret = pbShowCommands(nil,commands,-1) case ret when 0 - @y = height-32 - @topy = @y-(Graphics.height-64)+32 if @y-@topy>=Graphics.height-64 + @y = height-TILE_SIZE + @topy = @y-Graphics.height+TILE_SIZE if @y-@topy>=Graphics.height pbUpdateTileset when 1 - @y = -32 + @y = -TILE_SIZE @topy = @y if @y<@topy pbUpdateTileset when 2