muiebitengine

package module
v0.0.0-...-029ca66 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 14 Imported by: 0

README

microui for Ebitengine

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultAtlasRects = []microui.Rect{
		{},
		iconClose,
		iconResize,
		iconCheck,
		iconCollapsed,
		iconExpanded,
		atlasWhite,
	}
)

Functions

func RemoveAllFonts

func RemoveAllFonts()

func RemoveFont

func RemoveFont(f Font)

func UIFont

func UIFont(f Font) microui.Font

UIFont returns a microui.Font from a Font interface. If the font is not registered, it will be registered. The font can be removed with RemoveFont.

Types

type Driver

type Driver interface {
	UpdateInputs()
	Draw(screen *ebiten.Image)
	DefaultFont() Font
}

func New

func New(ctx *microui.Context, options ...DriverOption) Driver

type DriverOption

type DriverOption func(*driverOptions)

func WithAtlasTexture

func WithAtlasTexture(tex *ebiten.Image) DriverOption

func WithDefaultFont

func WithDefaultFont(f Font) DriverOption

func WithScrollMultiplier

func WithScrollMultiplier(x, y float64) DriverOption

type Font

type Font interface {
	Draw(dst *ebiten.Image, text string, x, y int, clr color.Color)
	TextWidth(text string) int32
	TextHeight() int32
	// contains filtered or unexported methods
}

func GetFont

func GetFont(id microui.Font) Font

type FontBase

type FontBase struct {
	// contains filtered or unexported fields
}

type FontFaceWrapper

type FontFaceWrapper struct {
	FontBase
	font.Face
	OffsetX       int
	OffsetY       int
	GetTextWidth  func(text string) int32
	GetTextHeight func() int32
}

func (*FontFaceWrapper) Draw

func (w *FontFaceWrapper) Draw(dst *ebiten.Image, tx string, x, y int, clr color.Color)

func (*FontFaceWrapper) TextHeight

func (w *FontFaceWrapper) TextHeight() int32

func (*FontFaceWrapper) TextWidth

func (w *FontFaceWrapper) TextWidth(str string) int32

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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