Android and windows confusion

Hi everyone , I am currently working on a platformer game which I want to upload on itch.io
So , I want to make a platformer game which can be played by android and windows user (both)
for android users I will have to use GUI but for pc users they have keyboard
In Totall I want to ask that am I thinking right , is it possible to upload android as well as windows game together
Will pc users also see the GUI buttons which I made for android users??

You need this


Check if device is mobile and show the GUI or else, hide it.

Will applying this event automatically hide or show GUI?

No. You need to set it. Nothing happens automatically.

If I apply this condition or action will do what I want
Or there is a special way to do this all

Do I need to make a group of GUI assets and say-
If device is a mobile then show the GUI or if it is a pc then show them

You can do like this or make another layer, put your GUI on that layer and Hide that layer.

Hidden objects still have active collisions, and can cause problems with the game. You’ll be better off putting them on a GUI layer as @Muzan has mentioned, and hide the layer.

can someone share the picture of events or a gif file to do this all

:slightly_smiling_face:

Objects on a hidden layers also have active collision.

1 Like

thanks a lot everyone

I wanted to confirm one thing -
@MrMen is saying that “Hidden objects still have active collisions” and @jack is saying that " Objects on a hidden layers also have active collision"
so which way should I choose as both have active collision ,
Will this not create a problem?

Both are saying the same thing. Neither hiding an object nor hiding a layer will impact collisions at all.

If you want to disable collisions when it isn’t visible, you will need to set up your own logic to stop collisions when an object isn’t visible. If you are using the platform behavior, your easiest bet is to add an action to your events that disables (or enables) that behavior on your platforms whenever you make them not visible.

I could not understand your last line , why will I make the platforms invisible
@Silver-Streak

Yes, and you’ll have to decide on the way to deal with the way GDevelop behaves with hidden objects.

@jack’s screen snippet is a good solution - put the GUI controls in a group (in the editor). And at run time, delete these objects if the device doesn’t have a touchscreen.

Otherwise you can do as @Silver-Streak is suggesting, and check the buttons are visible before processing a touch on them.

ok :slightly_smiling_face:
I will follow this method -
put the GUI controls in a group (in the editor). And at run time, delete these objects if the device doesn’t have a touchscreen.