I'm trying to scale my game but...

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:
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]);
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!
 

Yal

🐧 *penguin noises*
GMC Elder
AFAIK you can't change the view port of the room you're in. Does the view scale up properly if you change to a different room?
 
D

dubas

Guest
AFAIK you can't change the view port of the room you're in. Does the view scale up properly if you change to a different room?
No. The port remains the same size visually, but in the debugger it says that the port is changed to wport = 1920 and hport = 1080 (because that's the size of my monitor). Is it possible to change the initial size of the room/view port from the standard 512x704 that I have it at?
 

Yal

🐧 *penguin noises*
GMC Elder
I think you're looking for window_set_size() to change the size of the game window... not sure whether it works on mobile targets, but the manual doesn't claim it doesn't.
 
D

dubas

Guest
I think you're looking for window_set_size() to change the size of the game window... not sure whether it works on mobile targets, but the manual doesn't claim it doesn't.
That's exactly what I wanted, thank you! As long as I know the views are working for the computer I can figure a way out for the ios.
 
Top