Android Developing for Android

Xer0botXer0

Member
Good day guys,

So while GMS downloads the required repositories and such for me to port my games to android I've got some questions as I've never worked on a mobile game before.

How does the whole resolution thing work when it comes to mobiles ? Specifically android.
Just some error checking, if my room is 2000x2000, will it stretch ingame or just not show the entire room ?

Next would be the controls, like.. 'poke' and 'double poke' and 'drag start' 'dragging' 'drag release' ..
And how would I get the keyboard to pop up ? how can I receive keyboard input if it can popup ?

What other things are there to consider ?
 

O.Stogden

Member
You'd have to use the "camera" system in GMS2 to limit the view size to your devices display. Same as you'd use for your PC (PC's can't display 2000x2000 rooms either really). Without a camera, it'll try and display the entire room, but it won't display nicely, especially on small screens.

As for controls, tap is done by "mouse release" in my game, as tapping functions as a left mouse click. Dragging I believe would be seen as holding the left mouse button down.

Keyboard pop up, you can get that by doing get_string_async, which shows a pop-up dialog which asks for the user input. There's probably fancier and nicer looking ways than that, but that's a basic way of doing it.

Mostly it is scaling that you need to worry about, and the control scheme. Optimization may become something you need to look at if your game is intensive.
 

Xer0botXer0

Member
Thanks, but I'm still stuck.

There are different resolutions, so is there a function to get the resolution of the android device ?
Well I'm excited to say that my empty blue room just appeared on the phone. I'm now going to import a previous game and see how it runs on the phone haha!
 

O.Stogden

Member
display_get_height() and display_get_width() return the height and width of a devices display in pixels on any platform, including Android.
 

Xer0botXer0

Member
does Mouse_x and Mouse_y pick up as the tap position ?

I used to use "distance_to_point(mouse_x,mouse_y) < x && mouse_button_released.. etc for buttons but how would I go about that with a mobile ?
 

Xer0botXer0

Member
So without going overboard, I'm thinking the room can be any size, the view is then set to the devices resolution, then the gui is scaled to the resolution as to fit in screen. But I've seen some nasty things happening to art when it's stretched and shrunken.

The room objects would be fine since it doesn't need to be resized for the view.
 

O.Stogden

Member
You would probably place your GUI in the screen using display_get_gui_height etc. functions.

As for the size of the GUI, if it's actual graphics assets, you might need to design different ones depending on the size of the screen.
 
Top