How can i show touch screenbuttons only on android devices?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By everancii
:warning: Old Version Published before Godot 3 was released.

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

:bust_in_silhouette: Reply From: eons

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.

thank you, this is what i want

everancii | 2016-12-21 00:42

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

What did I wrong ?

tim.t | 2020-08-19 15:31

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).

eons | 2020-08-23 20:07