• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Get the real current view of the screen

Z

zmads

Guest
I'm trying to figure it out a way to get the currectly view of the screen.

The room start with a view of x = 240 and y = 135.
Then the code double the view after a little while, so the view goes for x = 480 and y = 270.

When my player shoots the gun I give him a zoom out, the way I do is I have another view with the same size as the first one, the more the key is checked the more the view zoom out, until reachs the max value. What it does iwhen he stop shooting and zooming out is, he copy the size of the first view(so he can start to zoom out from the beggining again) and change to the first view.

The problem is when the second view copy the size of the first one, the copied size is the one that the room is created, the x= 240 and y = 135. I want to had copied the currenctly size that t is x = 480 and y = 270.

Here is my code

Create Event
Code:
max_wview1 = view_wview[0]*1.5;
max_hview1 = view_hview[0]*1.5;
Step Event
Code:
var _next_wview1 = view_wview[1]+view_wview[1]/300;
var _next_hview1 = view_hview[1]+view_hview[1]/300;

 if shootkey {
    view_visible[0] = false
    view_visible[1] = true

// Zoom
    view_wview[1] = min(_next_wview1,max_wview1);
    view_hview[1] = min(_next_hview1,max_hview1);
 
} else {
    view_wview[1] = view_wview[0]
    view_hview[1] = view_hview[0]
    view_visible[1] = false
    view_visible[0] = true
}
Any help is appreciated, even if it's another approach to solve this
 
Top