Rabbi Rex Texas
Rabbi Rex Texas

Reputation: 11

Scaling a Game Maker app for mobile-device screens

I'm having a difficult time getting an HTML5 app I designed in Game Maker to scale for display on mobile-device screens. I've tried using this little bit of code, to set the width and height of a the main game room, in a setup object, before switching to that room:

room_set_width(rm_playspace,browser_width);

But that seems be doing absolutely nothing.

Have you successfully designed software for mobile devices with Game Maker? How did you get your software to scale for proper viewing on mobile devices with differently sized screens?

Upvotes: 1

Views: 4162

Answers (3)

Consti Const
Consti Const

Reputation: 21

You could also just resize the surface and before, the view.

Upvotes: 0

gnysek
gnysek

Reputation: 318

Don't forget to set view_port_xxx and view_size_xxx for proper sizes. You can use window_get_width() and display_get_width() etc. for that - refer to manual for more info.

Upvotes: 1

Dmi7ry
Dmi7ry

Reputation: 1777

room_set_width( ind, w );

Description

With this function you can change (or set) the width of any room in your game except the current one.

so you need to go to another room, and then resize the first room and go back into it.

another option that you can try - just restart the room immediately after resizing, like

room_set_width(room, 640)
room_set_height(room, 480)
window_set_size(640, 480) // also you can use window_set_rectangle
room_restart()

(room should not be a persistent)

Upvotes: 1

Related Questions