screenreader

package
v0.3.26 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InactiveUI = &UI{
	Elements: []Element{
		&TextButton{
			ElementPosition: ElementPosition{
				Camera: func() *gfx.Camera {
					var cam gfx.Camera

					cam.SetDefaults()
					cam.Position.Identity()
					cam.MarkDirty()

					return &cam
				}(),
				Sx: 1,
				Sy: 1,
			},
			Center:  true,
			Font:    sprites.FontD3Streetism,
			Text:    func() string { return "Enable Screen Reader Mode" },
			VisText: func() string { return "Enable Screen Reader Mode (requires refresh)" },
			Click: func() {
				s := internal.LoadSettings()

				s.ScreenReader = true

				s.LimitGPULevel = 1
				s.DPIScale = 0.5

				internal.SaveSettings(s)
			},
		},
	},
}

Functions

This section is empty.

Types

type Button

type Button struct {
	ElementBase
	ElementPosition
	Sprite func() *sprites.Sprite
	Text   func() string
	Click  func()
}

type Element

type Element interface {
	// contains filtered or unexported methods
}

type ElementBase

type ElementBase struct {
	ComputeVisible func() bool
	AriaRole       string
	// contains filtered or unexported fields
}

type ElementPosition

type ElementPosition struct {
	Camera  *gfx.Camera
	X, Y, Z float32
	Sx, Sy  float32
	EdgeX   int8
	EdgeY   int8

	UpdatePosition func(*ElementPosition)
}

type Label

type Label struct {
	ElementBase
	ElementPosition
	Font    sprites.FontID
	Center  bool
	Text    func() string
	VisText func() string
}

type LeafElement

type LeafElement interface {
	Element
	// contains filtered or unexported methods
}

type Paragraph

type Paragraph struct {
	ElementBase
	ElementPosition
	Sprite *sprites.Sprite
	Text   func() string
}

type TextButton

type TextButton struct {
	ElementBase
	ElementPosition
	Font    sprites.FontID
	Center  bool
	Text    func() string
	VisText func() string
	Click   func()
}

type UI

type UI struct {
	Elements []Element
	// contains filtered or unexported fields
}

func (*UI) Init

func (ui *UI) Init()

func (*UI) Release

func (ui *UI) Release()

func (*UI) Update

func (ui *UI) Update()

type Wrapper

type Wrapper struct {
	ElementBase
	Elements []Element
}

Jump to

Keyboard shortcuts

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