text

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Text

type Text struct {
	// contains filtered or unexported fields
}

Text object implementation

func New

func New(txt string, size int, fontURL string, x, y int32) (*Text, error)

New create Text object

func (Text) Click

func (T Text) Click()

Click define a click on object

func (Text) Clone

func (T Text) Clone(r *sdl.Renderer) (*Text, error)

Clone object and return a new

func (*Text) Close

func (T *Text) Close() error

Close sdl ressources needest to object

func (Text) Draw

func (T Text) Draw(wg *sync.WaitGroup, r *sdl.Renderer)

Draw object

func (Text) GetColor

func (T Text) GetColor() (r, g, b, a uint8)

GetColor object (current color by status)

func (Text) GetIDSDL

func (T Text) GetIDSDL() uint8

GetIDSDL provide the idSDL session. Useful for timer display

func (Text) GetPosition

func (T Text) GetPosition() (int32, int32)

GetPosition object (x, y)

func (Text) GetSize

func (T Text) GetSize() (int32, int32)

GetSize object (width, height)

func (Text) GetStatus

func (T Text) GetStatus() uint8

GetStatus object

func (Text) GetTxt

func (T Text) GetTxt() string

GetTxt provide txt string

func (*Text) Init

func (T *Text) Init(r *sdl.Renderer) error

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

func (Text) IsInit

func (T Text) IsInit() bool

IsInit return status initialize

func (Text) IsOver

func (T Text) IsOver(xRef, yRef int32) bool

IsOver define if object and position parameters matches

func (*Text) MoveTo

func (T *Text) MoveTo(x, y int32)

MoveTo by increment position with x and y parameters

func (*Text) NewIDSDL

func (T *Text) NewIDSDL() uint8

NewIDSDL provide and set a new idSDL session.

func (*Text) SetAction

func (T *Text) SetAction(f func(...interface{}), d ...interface{})

SetAction to get it on click button

func (*Text) SetStatus

func (T *Text) SetStatus(s uint8)

SetStatus change object's status

func (*Text) SetUnderPosition

func (T *Text) SetUnderPosition(x, y int32)

SetUnderPosition to underText

func (*Text) SetVariantStyle

func (T *Text) SetVariantStyle(r, g, b, a uint8, status ...uint8) error

SetVariantStyle define styles to interact with object.

func (*Text) SetVariantUnderStyle

func (T *Text) SetVariantUnderStyle(r, g, b, a uint8, status ...uint8) error

SetVariantUnderStyle define styles under to interact with object.

func (*Text) UpdateColor

func (T *Text) UpdateColor(red, green, blue, opacity uint8, r *sdl.Renderer)

UpdateColor to change color of initialized object

func (*Text) UpdatePosition

func (T *Text) UpdatePosition(x, y int32)

UpdatePosition object

func (*Text) UpdateSize

func (T *Text) UpdateSize(w, h int32)

UpdateSize to change size of initialized object

func (*Text) UpdateText

func (T *Text) UpdateText(str string, r *sdl.Renderer) error

UpdateText to change text of initialized object

Jump to

Keyboard shortcuts

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