Cita de: Clamud en Marzo 22, 2016, 04:48:49 PM
Aquí publicaron un código para eso:
http://gmc.yoyogames.com/index.php?showtopic=541440
En los tutoriales de GMS también hay un ejemplo:
Es un tutorial muy corto, tal vez lo traduzca en unos días.
El tutorial de game maker no le entiendo muy bien.
Probe el codigo que publicaron en el foro de yoyogames;
CitarCreateCódigo [Seleccionar]initial_w_view = view_wview[0];
view_scale = 1;
initial_x = 0;
initial_y = 0;
initial_zoom = 0;
Global mouse leftCódigo [Seleccionar]var view_ratio;
view_ratio = view_hview[0]/view_wview[0];
if( device_mouse_check_button_pressed( 1, mb_left ) )
{
initial_x = mean( device_mouse_x( 0 ), device_mouse_x( 1 ) );
initial_y = mean( device_mouse_y( 0 ), device_mouse_y( 1 ) );
initial_zoom =
point_distance
(
device_mouse_raw_x( 0 ), device_mouse_raw_y( 0 ),
device_mouse_raw_x( 1 ), device_mouse_raw_y( 1 )
)*view_scale;
};
if( device_mouse_check_button( 1, mb_left ) )
{
view_scale = initial_zoom/
point_distance
(
device_mouse_raw_x( 0 ), device_mouse_raw_y( 0 ),
device_mouse_raw_x( 1 ), device_mouse_raw_y( 1 )
);
view_wview[0] = initial_w_view*view_scale;
view_hview[0] = view_wview[0]*view_ratio;
view_xview[0] += initial_x-mean( device_mouse_x( 0 ), device_mouse_x( 1 ) );
view_yview[0] += initial_y-mean( device_mouse_y( 0 ), device_mouse_y( 1 ) );
};
Si me funciono pero tengo un problema. Cuando le empiezo a hacer zoom, la view se empieza a mover como si se estuviera trabando el juego :-\