Skip to content

Make button text change when state chagnes #160

@xescugc

Description

@xescugc

So I want to do something like
button_normal

I opened a PR for the color of the text, that is fine. But I was wondering which would be the approach to make the text of the button also move down when pressed.

I was thinking on adding a IsPressed (similar to the IsFocused) and then, somehow, change the text position. My only guess would be to expose the ButtonOption.TextPosittion so it can be changed thorough the button directly but that would not even work also as it's a TextPosition which is Start|Center|End.

The other option is to go with the ButtonOption.TextPading so I would need to expose that be able to change it.

The ultimate end solution is to write the text on the image of the button myself with an ebiten/text.Draw() but I would rather add the possibility to EbitenUI if possible hehe.

Which would be the right way to do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions