Expandable TouchScreenButton

Godot Version

4.2.2

Question

How can I make a TouchScreenButton expandable in Godot so that it doesn’t stretch on the edges? When using a regular ‘Button’ we can edit the theme and Under Sytle.normal we can add StyleBoxTexture that behaves like a NinePatchRect to prevent stretching on the edges. How can I achieve this with a TouchScreenButton?

and why TouchScreenButton is under Node2D not under Control?

it’s the way it’s, main difference with touchscreenbutton vs control’s button is while pressing on touchscreenbutton will count as a pressed, meanwhile control’s button only count it as button_down

use 9-slice shader
issues found with that shader is it’s in godot 3 shader code, there’s need a conversion for it

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.