textwrapper

package module
v0.0.0-...-e258d13 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: MIT Imports: 7 Imported by: 1

README

Ebiten Text Wrapper

Little addon to the ebiten engine for creating wrappable text from a string slice. Currently only supports left to right horizontal wrapping.

USE AT YOUR OWN RISK

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TextWrapper

type TextWrapper struct {
	X, Y, W float64
	Color   color.Color
	// contains filtered or unexported fields
}

func NewTextWrapper

func NewTextWrapper(fontData []byte) *TextWrapper

Create

func (*TextWrapper) Draw

func (t *TextWrapper) Draw(screen *ebiten.Image)

Render

func (*TextWrapper) GetFace

func (t *TextWrapper) GetFace() *text.GoTextFace

func (*TextWrapper) SetSize

func (t *TextWrapper) SetSize(newSize float64, lineHeight float64)

func (*TextWrapper) SetText

func (t *TextWrapper) SetText(newText []string)

Actions Set text allows you to use mutltiple lines of input in the form of a string slice. New lines will be inserted where needed as the text wraps across the bounds set by the W (width) property of the TextWrapper

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳