Skip to content

Feature Request: Button & Text Styles #15

@minutekiwi

Description

@minutekiwi

It would be helpful to be able to create globally named styles for buttons that can be used throughout the program. It would also allow btnText to be reactively styled like button images, which is helpful when a button's background color may change as a result of player input.

// Idle = Untouched | Hover = Touched
// Command, based off of "touchableRes"
buttonStyle Name ImageIdle ImageHover ImageClick ImageSelect

// Allow text to be styled and applied to buttons, and change on selection
// Command
buttontextStyle targetName_text IdleText HoverText ClickText SelectText


// Applied example
// Create RoundButton and an assosciated textStyles
~buttonStyle RoundButton RoundButton_idle.png RoundButton_hover.png RoundButton_click.png RoundButton_selected.png
~textStyle RoundButton_text "Arial.ttf | textSize 36 | textColour #000000 | textShadow 0" "textSize 40" "" "textColor #f1ae19"

~button0 button1 "Example Text 1" 20 20 150 style RoundButton script system/config.txt display 

I put some image examples as well. In this example, the "Click" text simply inherits the "Hover" text (as buttons cannot be clicked without being hovered).

Image

Image

Having this option would be especially useful for choices in script!

"Let's make a choice right now.

~button0 choiceopt1 "Option 1: Good Ending" style DefaultChoice 0 0 150
~button0 choiceopt2 "Option 2: Good Ending" style DefaultChoice 0 200 150
~button0 choiceopt3 "Option 3: Bad Ending" style BadChoice 0 400 150

.fadein choice.* 300 

"The first two choice use one style, and the last choice uses a different style. Also, buttonStyles could be globally defined, so I can use it throughout the story.

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