Android and windows confusion


#1

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??


#2

You need this


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


#3

Will applying this event automatically hide or show GUI?


#4

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


#5

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


#6

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


#7

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


#8

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 @Mixen has mentioned, and hide the layer.


#9

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


#10

:slightly_smiling_face:


#11

Objects on a hidden layers also have active collision.


#12

thanks a lot everyone


#13

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?


#14

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.


#15

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


#16

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.


#17

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.