Go Back   The PokéCommunity Forums > Creative Discussions > Game Development > Pokémon Essentials
Reload this Page [Question] Script to Zoom in on Player

Notices
For all updates, view the main page.

Pokémon Essentials All questions and discussion about Pokémon Essentials, the Pokémon game kit for RPG Maker XP, go in here. Also contains links to the latest downloads and the Essentials Wiki.



Reply
 
Thread Tools
  #1    
Old April 7th, 2013 (02:00 PM).
Rayd12smitty's Avatar
Rayd12smitty Rayd12smitty is offline
Shadow Maker
 
Join Date: Dec 2011
Gender: Male
Posts: 642
I have another quick question. I want to call a script that will make the game zoom in on the player, and then another one that will zoom back out. I want it to be a gradual change like when you use
Code:
pbToneChangeAll(0,20)
where the 0 is the tone it fades to and 20 is the frames it takes to do it. Is there something like this to zoom in on the player in the over world?
__________________
Reply With Quote
  #2    
Old April 7th, 2013 (02:08 PM).
Maruno's Avatar
Maruno Maruno is offline
Lead Dev of Pokémon Essentials
Moderator
 
Join Date: Jan 2008
Location: England
Posts: 4,012
You mean like the battle transition which zooms in on the screen? Class ZoomInTransition is where to get started with that, although what you need depends a huge amount on what you want to do with this zooming.
__________________
Reply With Quote
  #3    
Old April 7th, 2013 (03:10 PM).
Rayd12smitty's Avatar
Rayd12smitty Rayd12smitty is offline
Shadow Maker
 
Join Date: Dec 2011
Gender: Male
Posts: 642
Quote originally posted by Maruno:
You mean like the battle transition which zooms in on the screen? Class ZoomInTransition is where to get started with that, although what you need depends a huge amount on what you want to do with this zooming.
Yes thats exactly what I want. I want to make it so the player is zoomed in on like that when I select something in the menu. I am using a custom menu so I don't need to know how to edit that.
Code:
if Input.trigger?(Input::C)
          Audio.se_play("Audio/SE/Select")
          pbWait(2)
          10.times do
            if $Trainer.pokedex==true
              @sprites["Pokedex"].y-=16
            end
            if $Trainer.party.length>=1
              @sprites["Pokemon"].y-=16
            end
            if $Trainer.pokegear==true
              @sprites["Pokegear"].y-=16
            end
            @sprites["Bag"].y-=16
            @sprites["Trainer Card"].y+=25.5
            @sprites["Save"].y+=25.5
            @sprites["Options"].y+=25.5
            @sprites["Back"].y+=25.5
            pbWait(1)
          end
          ####ZOOM IN ON PLAYER
          Audio.se_play("Audio/SE/navopen")
          pbPokeDev
          ####ZOOM OUT ON PLAYER
          break
        end

This is the basic idea I had. The commented out parts would be zooming in and then when you close the thing in the menu it zooms back out to normal. I will take just about anything I can get. It doesn't have to show it zoom back out if thats not possible.
__________________
Reply With Quote
  #4    
Old April 7th, 2013 (06:24 PM).
zingzags's Avatar
zingzags zingzags is offline
Creator or Pokemon Serenity
 
Join Date: Jan 2009
Location: Boston
Age: 21
Nature: Adamant
Posts: 552
Zooming in on player is basically enlarging the map, and the player. The effect you are looking for is to make a loop which will gradually zoom in until it reaches the desired enlargement point.
__________________
Pokemon Serenity is my fangame name.
name decided 12/15/09
Currently helping:
Pokemon ebony
and
Xenotime:
Reply With Quote
  #5    
Old April 7th, 2013 (06:28 PM).
Rayd12smitty's Avatar
Rayd12smitty Rayd12smitty is offline
Shadow Maker
 
Join Date: Dec 2011
Gender: Male
Posts: 642
I understand that but I don't know what to put in the loop. I don't know the script XD
__________________
Reply With Quote
  #6    
Old April 8th, 2013 (06:48 AM). Edited April 8th, 2013 by Luka S.J..
Luka S.J.'s Avatar
Luka S.J. Luka S.J. is offline
@LukaSJ0
 
Join Date: Dec 2008
Location: Croatia
Age: 21
Gender: Male
Nature: Adamant
Posts: 818
Quote originally posted by zingzags:
Zooming in on player is basically enlarging the map, and the player. The effect you are looking for is to make a loop which will gradually zoom in until it reaches the desired enlargement point.
That is not a good way to do it. First of all it's much more complicated. Second, if you are actually enlarging the map, you'll be enlarging it tile by tile, making them out of alignment at points which aren't perfectly divisible by the scale factor. I tried this method; it's complicated, and doesn't give you a smooth animation in return.
Quote originally posted by Rayd12smitty:
I understand that but I don't know what to put in the loop. I don't know the script XD
Maruno gave you everything you need. If you look at how the class ZoomInTransition actually works, you'll see that it uses the Graphics.snap_to_bitmap function, which basically creates a temporary screenshot of your screen. Create a sprite with that, and you have yourself a super easy method of creating transitions of all kinds.
__________________
Reply With Quote
  #7    
Old April 8th, 2013 (10:19 AM).
Rayd12smitty's Avatar
Rayd12smitty Rayd12smitty is offline
Shadow Maker
 
Join Date: Dec 2011
Gender: Male
Posts: 642
Thanks Luka...again haha. I'll look at it again.
__________________
Reply With Quote
  #8    
Old April 9th, 2013 (03:56 PM).
zingzags's Avatar
zingzags zingzags is offline
Creator or Pokemon Serenity
 
Join Date: Jan 2009
Location: Boston
Age: 21
Nature: Adamant
Posts: 552
Quote originally posted by Luka S.J.:
That is not a good way to do it. First of all it's much more complicated. Second, if you are actually enlarging the map, you'll be enlarging it tile by tile, making them out of alignment at points which aren't perfectly divisible by the scale factor. I tried this method; it's complicated, and doesn't give you a smooth animation in return.

Maruno gave you everything you need. If you look at how the class ZoomInTransition actually works, you'll see that it uses the Graphics.snap_to_bitmap function, which basically creates a temporary screenshot of your screen. Create a sprite with that, and you have yourself a super easy method of creating transitions of all kinds.
I was talking in theory, never really tried it myself.
__________________
Pokemon Serenity is my fangame name.
name decided 12/15/09
Currently helping:
Pokemon ebony
and
Xenotime:
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are UTC -8. The time now is 04:00 AM.