textqueue

package module
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: Apache-2.0 Imports: 11 Imported by: 1

README

textqueue

The textqueue component displays text input via event handlers in a vertical queue, with older texts fading away after a delay.

Documentation

Index

Constants

View Source
const DisplayTextEvent = "DisplayText"

Variables

View Source
var (
	// TextQueuePublish: Triggered to publish an update to a specific text queue
	TextQueuePublish = event.RegisterEvent[string]()
)

Functions

func PrintBind

func PrintBind(tq *TextQueue, str string) event.Response

Types

type TextQueue

type TextQueue struct {
	event.CallerID
	render.LayeredPoint
	// contains filtered or unexported fields
}

A TextQueue is a renderable entity that displays text in a column for a brief time before fading the text and dropping it. It accepts new text elements from the DisplayTextEvent event.

func New

func New(ctx *scene.Context, registeredEvents []event.UnsafeEventID, pos floatgeom.Point2, layer int, font *render.Font, sustainTime time.Duration) *TextQueue

New creates a customized TextQueue.

func (*TextQueue) CID

func (tq *TextQueue) CID() event.CallerID

func (*TextQueue) Draw

func (tq *TextQueue) Draw(buff draw.Image, xOff, yOff float64)

Draw the textqueue's contents

func (*TextQueue) GetDims

func (tq *TextQueue) GetDims() (int, int)

GetDims needs to have some size so give it the minimal one.

Jump to

Keyboard shortcuts

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