Script for Screen Zoom help?

greensdream

"GREEN'S DREAM" developer page
Veteran
Joined
Jul 15, 2017
Messages
59
Reaction score
26
First Language
English
Primarily Uses
RMMV
I have been using a script to zoom-in (bring the camera closer) and it has worked great... Up until trying to change the scale! Here is the script I'm using by creating an event and typing this into the script line:

$gameScreen.setZoom(Graphics.width / 2, Graphics.height / 2, 2)

It works perfectly until I try to change the scale. I don't think I wrote down what the variables are (where the '"2's" are), so when I change the numbers to, say, 1.5, although the game zooms appropriately, everything is off-center.

Can anyone figure out what those values mean? I don't want to use a plugin for this if I can help it, since most plugins interfere with the Yanfly Core Engine I'm using. Any help would be appreciated!
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,695
Reaction score
1,113
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi!
the code that I use, and work flawlessly is this:
Code:
$gameScreen.startZoom(X, Y, SCALE, FRAMES);
This will set the zoom to default:
Code:
$gameScreen.clearZoom();
Ex: $gameScreen.startZoom($gamePlayer.screenX(), $gamePlayer.screenY(), 2.0, 60);
Zoom in the player position with scale of 2 and the duration for the zoom to the default scale to the scale i choose is 60 frames.
If you change map or open the menu, the zoom will return to normal.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA

I've moved this thread to Learning JavaScript. Please be sure to post your threads in the correct forum next time. Thank you.


This is probably your best bet for getting help on this issue without the use of plugins.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,859
Messages
1,017,030
Members
137,566
Latest member
Fl0shVS
Top