uitext

package
v0.0.0-...-e7326f8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UIText

type UIText struct {
	ID string
	// contains filtered or unexported fields
}

UI text. This can be used as a text in the world.

func New

func New(tf interfaces.ITransform, text string, f *text.GoTextFaceSource, fontSize float64) *UIText

Returns a new UI text instance. This text can be as UI, as pinned to the world game object.

func (*UIText) DrawUI

func (t *UIText) DrawUI(gb interfaces.IGameBase, screen *ebiten.Image)

func (*UIText) DrawUIPriority

func (t *UIText) DrawUIPriority() float64

func (*UIText) GetFontFace

func (t *UIText) GetFontFace() *text.GoTextFace

Returns GoTextFace object (see ebiten/v2/text/v2).

func (*UIText) GetFontFaceSource

func (t *UIText) GetFontFaceSource() *text.GoTextFaceSource

Returns GoTextFaceSource object (see ebiten/v2/text/v2).

func (*UIText) GetFontOptions

func (t *UIText) GetFontOptions() *interfaces.FontOptions

Returns the font options.

func (*UIText) GetID

func (t *UIText) GetID() string

Implementation of goi.Component

func (*UIText) GetText

func (t *UIText) GetText() string

Returns current text.

func (*UIText) GetTransform

func (t *UIText) GetTransform() interfaces.ITransform

Returns the transform used by this text object.

func (*UIText) SetFontColor

func (t *UIText) SetFontColor(fontColor color.Color)

Changes the color of the text.

func (*UIText) SetFontDirectly

func (t *UIText) SetFontDirectly(font *text.GoTextFace)

Directly install "font" value to the given font. It is bypasses "FontSize" parameter of the font options.

This function useful for UIText interfaces, such as RichText.

* BE CAREFUL!

func (*UIText) SetFontOptions

func (t *UIText) SetFontOptions(fontOptions *interfaces.FontOptions)

Changes the font options.

func (*UIText) SetFontSize

func (t *UIText) SetFontSize(fontSize float64)

Sets a size of the font.

* IMPORTANT: This function changes the value of the line spacing.

func (*UIText) SetLineSpacing

func (t *UIText) SetLineSpacing(lineSpacing float64)

Sets the line spacing option directly.

* BE CAREFUL!

func (*UIText) SetLineSpacingMultiplier

func (t *UIText) SetLineSpacingMultiplier(multiplier float64)

Changes the multiplier of linespacing.

func (*UIText) SetText

func (t *UIText) SetText(text string)

Changes the displaying text.

Jump to

Keyboard shortcuts

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