0 votes

Hello. How can i show touch screenbuttons only on android devices? I use Canvas Layer for three of my buttons, and they are always showing on screen, even on pc version of the game

in Engine by (20 points)

1 Answer

+1 vote
Best answer

Not sure if restricted to Android but TouchScreenButton has the visibility mode option where you can put TouchScreenOnly.

Also via code with set_visibility_mode.

In project settings>display you can toggle emulate touchscreen to see the buttons in touch screen only mode.

by (7,832 points)
selected by

thank you, this is what i want

Hello,
using Godot 3.2.2 and set the visibility_mod to TouchScreenOnly.
But on a no Touch System the buttons still visable.

enter image description here

enter image description here

What did I wrong ?

To see it when you are not on a touch screen you must enable the option "emulate touch from mouse" on project settings.

Test it with the Platformer Demo if you can't see it in your project, it could be that is misplaced or behind another node (use the remote inspector to locate the node).

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.