gui

package
v0.0.0-...-ce589c3 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE_NO_COMPONENT = -1
	TYPE_BOOL         = 0
	TYPE_SLIDER       = 1
	TYPE_DROP_MENU    = 2
)
View Source
const (
	CHECKBOX_SIZE = 100
)
View Source
const NOTIFICATION_DURATION = 1
View Source
const NOTIFICATION_FONT_SIZE = 10

Variables

View Source
var (
	// Set the scale for the elements
	InterfaceScale float32 = 0.1
)

Functions

func InitNotification

func InitNotification()

func NewNotificationText

func NewNotificationText(notifText string)

func UpdateNotification

func UpdateNotification()

Types

type CheckBox

type CheckBox struct {
	HoverState bool
	// contains filtered or unexported fields
}

Checkbox is a button that be enabled or disabled

func NewCheckBox

func NewCheckBox(position graphic.Vector2, anchor graphic.Anchor) *CheckBox

Initialisation de la checkbox

func (*CheckBox) SetValue

func (c *CheckBox) SetValue(value *bool)

func (*CheckBox) Update

func (c *CheckBox) Update(containingRect graphic.Rect)

Fonction qui met à jour la checkbox

type ImageButton

type ImageButton struct {
	HoverState   bool
	PressedState bool
	// contains filtered or unexported fields
}

l'objet ImageButton désigne un bouton qui a pour hitbox et pour visuel une texture

func NewImageButton

func NewImageButton(position graphic.Vector2, texture rl.Texture2D, anchor graphic.Anchor) *ImageButton

Initialisation du bouton

func (*ImageButton) Update

func (b *ImageButton) Update(containingRect graphic.Rect)

Fonction de mise à jour du bouton

type ImageLabel

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

le TextLabel est un objet désignant une texture, qui est statique, et qui est destiné à être affiché.

func NewImageLabel

func NewImageLabel(texture rl.Texture2D, position graphic.Vector2, anchor graphic.Anchor) *ImageLabel

Initialisation du texte, qui est rendu sur une texture qui fait renderer

func (*ImageLabel) GetSize

func (i *ImageLabel) GetSize() graphic.Vector2

retourne la taille du label

func (*ImageLabel) Render

func (i *ImageLabel) Render(surfaceRect graphic.Rect)

Fonctions permettant d'afficher le texte

type Setting

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

l'objet Setting est un objet qui représente un paramètre à afficher graphiquement. Il joue le rôle d'interface et permet ainsi de simplifer la création de l'interface faite manuellement

func NewSetting

func NewSetting(name string, componentType int, font rl.Font, fontSize float32, position graphic.Vector2, anchor graphic.Anchor) *Setting

Initialisation d'un paramètre

func (*Setting) SetBool

func (s *Setting) SetBool(value *bool)

func (*Setting) SetSliderValue

func (s *Setting) SetSliderValue(value *float32, min float32, max float32)

func (*Setting) Update

func (s *Setting) Update(containingRect graphic.Rect)

Fonction qui met à jour le paramètre

type Slider

type Slider struct {
	HoverState bool
	// contains filtered or unexported fields
}

le slider, ou "curseur" est une barre verticale qui permet d'ajuster une valeur en déplaçant le rond qui est devant

func NewSlider

func NewSlider(position graphic.Vector2, anchor graphic.Anchor) *Slider

Initialisation du slider

func (*Slider) GetSize

func (s *Slider) GetSize() graphic.Vector2

func (*Slider) SetValue

func (s *Slider) SetValue(value *float32, min float32, max float32)

func (*Slider) Update

func (s *Slider) Update(containingRect graphic.Rect)

Fonction de mise à jour du slider

type TextLabel

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

le TextLabel est un objet désignant un texte, qui est statique, et qui est destiné à être affiché.

func Newlabel

func Newlabel(text string, font rl.Font, fontSize float32, position graphic.Vector2, anchor graphic.Anchor) *TextLabel

Initialisation du texte, qui est rendu sur une texture qui fait renderer

func (*TextLabel) GetSize

func (l *TextLabel) GetSize() graphic.Vector2

retourne la taille du label

func (*TextLabel) Render

func (l *TextLabel) Render(surfaceRect graphic.Rect)

Fonctions permettant d'afficher le texte

Jump to

Keyboard shortcuts

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