GameMaker rooms transitions

Y

Yotzer

Guest
i am making a game where you have 4 rooms that are in fact one cubic room (each room is a wall).
what i want to do is to transit between the rooms as a sliding image (not just apear in the room),i am not sure how to explain it ,as imitating a rotation.
 
E

Ephemeral

Guest
The hard part of this is going to be the math, but that won't be too bad.

What you'll want to do is read the manual on the surface_ functions and on the draw_vertex functions (or alternatively, the sprite drawing functions. You can do this with surfaces alone and vertex drawing, or you can use the function that creates a sprite and use the draw_sprite_pos() function, but that's a much bigger performance hit, is creating new sprites on the fly...)

Once you are familiar with those functions, what you'll want to do is have a persistent object to handle this effect, which does the following:

In the Room End event, it captures the last frame from room you're leaving on a surface.

In the Room Start event, it activates code in the Draw Event that redraws the application_surface onto a second created surface, then in the Step Event iterates through a counter every step, interpolating between the starting and finishing eight vertex positions of the two surfaces until they've swapped places, while using those number in the Draw Event. Then that code turns itself off and deletes (frees) the surfaces, waiting for the next room swap.
 
Y

Yotzer

Guest
thanks.
i was looking for an easier way but i guess there isn't.

it should be a built in function in my oppinion
 
I

icuurd12b42

Guest
it was built-in in 8.1 and lower, but with limited types... and your transition specifically has no equal even in my huge set of transitions. that's basically why they left this to your own implement...
 
Top