HTML5 The game crop the visible area to browser size

Juanla

Member
Hello! I want design a game over this sizes. (Below image)

All player actions always occurs in blue rectangle, I will have a big room, and I want crop the user visible area(view_port¿?), with the mayor resolution available always that this resolution be greater than blue rectangle. Sorry my english, if I can explain better, let me know.

I tried, in a step event of a object, change the size with all this functions (none combination make my desired behaivour):

Code:
window_set_position(0,0);
window_set_size(VIEW_WIDTH, VIEW_HEIGHT);

camera_set_view_size(0, floor(VIEW_WIDTH), floor(VIEW_HEIGHT));
camera_set_view_pos(0, 1920-VIEW_WIDTH, 1080-VIEW_HEIGHT);

surface_resize(application_surface, floor(VIEW_WIDTH), floor(VIEW_HEIGHT));
view_wport[0] = VIEW_WIDTH;
view_hport[0] = VIEW_HEIGHT;
 

Attachments

Last edited:
Top