button

package
v0.0.0-...-c9c00bb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button struct {
	Width  int
	Height int

	BgColour *color.NRGBA
	X        int
	Y        int
	Image    *ebiten.Image
	// contains filtered or unexported fields
}

Button represents a button.

func NewButton

func NewButton(width int, height int, text string, textOffsetX int, textOffsetY int, textColour *color.NRGBA, font font.Face, bgColour *color.NRGBA, x int, y int) Button

NewButton is a contructor that creates a new button.

func (*Button) Draw

func (b *Button) Draw(screen *ebiten.Image)

Draw is used to draw a button to the screen.

func (*Button) GetText

func (b *Button) GetText() string

GetText is used to get the text on a button.

func (*Button) IsMouseOver

func (b *Button) IsMouseOver() bool

IsMouseOver returns true if the mouse cursor is over the button image.

func (*Button) SetBgColour

func (b *Button) SetBgColour(colour *color.NRGBA)

SetBgColour is used to change the background colour of a button.

func (*Button) SetText

func (b *Button) SetText(text string)

SetText is used to change the text on a button.

func (*Button) SetTextColour

func (b *Button) SetTextColour(colour *color.NRGBA)

SetTextColour is used to change the colour of text on a button.

func (*Button) SetX

func (b *Button) SetX(x int)

SetX is used to change the X value of a button.

func (*Button) SetY

func (b *Button) SetY(y int)

SetY is used to change the X value of a button.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳