D
dubas
Guest
For the past couple of days I've been struggling quite a bit to scale my game to devices. I am using the full scale method that's described in the tech blog (Scaling For Devices: Part 2) but the port size of the rooms will not change. I pretty much copied the code from the blog and put it into the creation code of my first room, which is a blank room that just prepares the game for me. The code is:
The port size should change to the display size of my computer, but it is not changing. Only the view size is changing, only showing 288 pixels of the room for the height. I need to figure out why the port size of the room is not changing. I even have it set up so the port of every room is equal to the display size. Any help is greatly appreciated!
Code:
var base_w = 512;
var base_h = 704;
var max_w = display_get_width();
var max_h = display_get_height();
var aspect = max_w / max_h;
var VIEW_WIDTH = min(base_w, max_w);
var VIEW_HEIGHT = VIEW_WIDTH / aspect;
view_wview[0] = floor(VIEW_WIDTH);
view_hview[0] = floor(VIEW_HEIGHT);
view_wport[0] = max_w;
view_hport[0] = max_h;
surface_resize(application_surface, view_wview[0], view_hview[0]);