Skip to content

Conversation

@charlottetowell
Copy link

Adds new opt param scale for use in scaling an image. Currently only supports single scale factor for x and y.

Scales the image visually + updates the button hitbox as per scaled size.

Example use:

local button= {
    x = windowWidth,
    y = windowHeight,
    image = assets.button,
    hoveredImage = assets.buttonHover,
    scale = someScaleValue
}

function menuState:update(dt)
    if suit.ImageButton(button.image, {hovered=button.hoveredImage, scale=button.scale}, button.x, button.y).hit then
            print("Button clicked!")
    end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant