ui

package
v0.0.0-...-1e47bcc Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

ui :)

Index

Constants

View Source
const ButtonHeight float64 = 40

yeah

View Source
const DefaultFontSize int = 26

yeah

View Source
const Separation int = 8

yeah

Variables

This section is empty.

Functions

func Button

func Button(pos core.Vec2, size core.Vec2, text string, style ButtonStyle, onPressed func())

makes a button :)

func CycleButton

func CycleButton(pos core.Vec2, size core.Vec2, current *int, options ...string)

it's a button that cycles. writes the index into current

func DrawBoldText

func DrawBoldText(text string, pos core.Vec2, fontSize int, color core.Color)

as the name implies, it draws bold text

func DrawDangerButton

func DrawDangerButton(pos core.Vec2, size core.Vec2)

as the name implies, it draws a danger button

func DrawDialog

func DrawDialog(pos core.Vec2, size core.Vec2)

it's just a dark background

func DrawHoverOutline

func DrawHoverOutline(pos core.Vec2, size core.Vec2)

draw on top of a button/text input when it's focused

func DrawItalicText

func DrawItalicText(text string, pos core.Vec2, fontSize int, color core.Color)

as the name implies, it draws italic text

func DrawPressedButton

func DrawPressedButton(pos core.Vec2, size core.Vec2)

this is used for every button when pressed because i'm lazy

func DrawPrimaryButton

func DrawPrimaryButton(pos core.Vec2, size core.Vec2)

as the name implies, it draws a primary button

func DrawRegularText

func DrawRegularText(text string, pos core.Vec2, fontSize int, color core.Color)

as the name implies, it draws regular text

func DrawSecondaryButton

func DrawSecondaryButton(pos core.Vec2, size core.Vec2)

as the name implies, it draws a secondary button

func DrawSlider

func DrawSlider(pos core.Vec2, size core.Vec2, grabber float64)

slider. grabber is on a range from 0 to 1

func DrawTextInput

func DrawTextInput(pos core.Vec2, size core.Vec2)

as the name implies, it draws a text input

func FreeTheme

func FreeTheme()

similar to LoadTheme but in reverse

func LoadTheme

func LoadTheme()

sets up theme stuff

func Slider

func Slider(pos core.Vec2, size core.Vec2, label string, min float64, max float64, out *float64)

makes a slider lol. writes into out

func TextInput

func TextInput(pos core.Vec2, size core.Vec2, placeholder string, out *string)

single-line text input. please note it's very barebones (not good). writes whatever the user wrote to out

func ToggleButton

func ToggleButton(pos core.Vec2, size core.Vec2, text string, out *bool)

it's a button that toggles. writes the result into out

Types

type ButtonStyle

type ButtonStyle int
const (
	ButtonStylePrimary ButtonStyle = iota
	ButtonStyleSecondary
	ButtonStyleDanger
)

Jump to

Keyboard shortcuts

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