uirichtext

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultColorDict = map[string]color.Color{
	"red":     color.RGBA{191, 44, 50, 255},
	"orange":  color.RGBA{237, 133, 48, 255},
	"yellow":  color.RGBA{255, 217, 94, 255},
	"green":   color.RGBA{34, 134, 74, 255},
	"cyan":    color.RGBA{2, 175, 189, 255},
	"blue":    color.RGBA{3, 94, 149, 255},
	"magenta": color.RGBA{61, 71, 132, 255},
	"brown":   color.RGBA{94, 57, 51, 255},
	"gray":    color.RGBA{150, 155, 161, 255},
	"white":   color.RGBA{255, 255, 255, 255},
	"black":   color.RGBA{0, 0, 0, 255},
}

* This component is in Lazy Development. This term means that the component can be used, but has many known issues.

Dictionary with the color-commands for the RichText. This dictionary used as default, you can modify this to add custom color-commands by default. Also you can create own colors dictionary.

Example usage in the smart text:

"Hello, [red]world[/red]!"

* IMPORTANT: type command with lower-case registry!

* NOTE: there are reserved command named as "reset".

Functions

This section is empty.

Types

type UIRichText

type UIRichText struct {
	*uitext.UIText
	// contains filtered or unexported fields
}

* This is component

Allows to draw colored text on the screen.

func New

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

func (*UIRichText) DrawUI

func (rt *UIRichText) DrawUI(gameBase interfaces.IGameBase, screen *ebiten.Image)

func (*UIRichText) DrawUIPriority

func (rt *UIRichText) DrawUIPriority() float64

func (*UIRichText) GetColorDict

func (rt *UIRichText) GetColorDict() map[string]color.Color

func (*UIRichText) GetOriginalText

func (rt *UIRichText) GetOriginalText() string

func (*UIRichText) GetRichTextOptions

func (rt *UIRichText) GetRichTextOptions() *interfaces.RichTextOptions

func (*UIRichText) GetText

func (rt *UIRichText) GetText() string

func (*UIRichText) SetColorDict

func (rt *UIRichText) SetColorDict(colorsDict map[string]color.Color)

func (*UIRichText) SetEnableHexCommands

func (rt *UIRichText) SetEnableHexCommands(v bool)

func (*UIRichText) SetEnableNamedCommands

func (rt *UIRichText) SetEnableNamedCommands(v bool)

func (*UIRichText) SetFontOptions

func (rt *UIRichText) SetFontOptions(fontOptions *interfaces.FontOptions)

func (*UIRichText) SetFontSize

func (rt *UIRichText) SetFontSize(fontSize float64)

func (*UIRichText) SetLineSpacingMultiplier

func (rt *UIRichText) SetLineSpacingMultiplier(multiplier float64)

func (*UIRichText) SetRichTextOptions

func (rt *UIRichText) SetRichTextOptions(rtOptions *interfaces.RichTextOptions)

func (*UIRichText) SetText

func (rt *UIRichText) SetText(text string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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