uilib

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawText

func DrawText(renderer *sdl.Renderer, text string, position sdl.Point, color sdl.Color, font *ttf.Font)

DrawText is a function that draws text on the screen based on the provided position, color, and font.

func InitFont

func InitFont(fontTtf []byte, font **ttf.Font, size int) error

func InitSDL

func InitSDL() error

func InitTTF

func InitTTF() error

func LoadFont

func LoadFont(rwops *sdl.RWops, size int) (*ttf.Font, error)

LoadFont loads a font from RWops and returns the font object

func LoadTexture

func LoadTexture(renderer *sdl.Renderer, imagePath string) (*sdl.Texture, error)

func RenderImage

func RenderImage(renderer *sdl.Renderer, imagePath string)

func RenderText

func RenderText(text string, color sdl.Color, font *ttf.Font) (*sdl.Surface, error)

RenderText renders text to an SDL surface

func RenderTexture

func RenderTexture(renderer *sdl.Renderer, imagePath string, startQuadrant, endQuadrant string)

func RenderTextureAdjusted

func RenderTextureAdjusted(renderer *sdl.Renderer, imagePath string, rect sdl.Rect)

func WrapText

func WrapText(text string, font *ttf.Font, maxWidth int) []string

WrapText splits a long text into multiple lines based on the specified maximum width.

Types

This section is empty.

Jump to

Keyboard shortcuts

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