1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Android Developing for Android

Discussion in 'Game Design, Development And Publishing' started by Xer0botXer0, Feb 11, 2020.

  1. Xer0botXer0

    Xer0botXer0 Member

    Joined:
    Jun 29, 2016
    Posts:
    704
    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 ?
     
  2. O.Stogden

    O.Stogden Member

    Joined:
    Jul 25, 2018
    Posts:
    247
    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.
     
  3. Xer0botXer0

    Xer0botXer0 Member

    Joined:
    Jun 29, 2016
    Posts:
    704
    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!
     
  4. O.Stogden

    O.Stogden Member

    Joined:
    Jul 25, 2018
    Posts:
    247
    display_get_height() and display_get_width() return the height and width of a devices display in pixels on any platform, including Android.
     
  5. Xer0botXer0

    Xer0botXer0 Member

    Joined:
    Jun 29, 2016
    Posts:
    704
    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 ?
     
  6. O.Stogden

    O.Stogden Member

    Joined:
    Jul 25, 2018
    Posts:
    247
  7. Xer0botXer0

    Xer0botXer0 Member

    Joined:
    Jun 29, 2016
    Posts:
    704
    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.
     
  8. O.Stogden

    O.Stogden Member

    Joined:
    Jul 25, 2018
    Posts:
    247
    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.
     

Share This Page