button

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: BSD-3-Clause Imports: 7 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 {
	// contains filtered or unexported fields
}

Button object implementation

func New

func New(bl *block.Block, i *image.Image, t *text.Text) *Button

New create button object

func (Button) Click

func (B Button) Click()

Click define a click on object

func (Button) Clone

func (B Button) Clone(r *sdl.Renderer) (*Button, error)

Clone object and return a new

func (*Button) Close

func (B *Button) Close() error

Close sdl ressources needest to object

func (*Button) Draw

func (B *Button) Draw(wg *sync.WaitGroup, r *sdl.Renderer)

Draw object

func (Button) GetColor

func (B Button) GetColor() (r, g, b, a uint8)

GetColor object (current color by status)

func (Button) GetPosition

func (B Button) GetPosition() (int32, int32)

GetPosition object (x, y)

func (Button) GetSize

func (B Button) GetSize() (int32, int32)

GetSize object (width, height)

func (Button) GetStatus

func (B Button) GetStatus() uint8

GetStatus object

func (*Button) Init

func (B *Button) Init(r *sdl.Renderer) error

Init object to draw it. If error occurred, object can't be drawn

func (*Button) IsInit

func (B *Button) IsInit() bool

IsInit return status initialize

func (Button) IsOver

func (B Button) IsOver(xRef, yRef int32) bool

IsOver define if object and position parameters matches

func (*Button) MoveTo

func (B *Button) MoveTo(x, y int32)

MoveTo by increment position with x and y parameters

func (*Button) SetAction

func (B *Button) SetAction(f func(...interface{}), d ...interface{})

SetAction to get it on click button

func (*Button) SetStatus

func (B *Button) SetStatus(s uint8)

SetStatus change object's status

func (*Button) UpdateColor

func (B *Button) UpdateColor(red, green, blue, opacity uint8, r *sdl.Renderer)

UpdateColor to change color of initialized object

func (*Button) UpdatePosition

func (B *Button) UpdatePosition(x, y int32)

UpdatePosition object

func (*Button) UpdateSize

func (B *Button) UpdateSize(w, h int32)

UpdateSize to change size of initialized object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL