components

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 4 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 DURATION = 3

Variables

View Source
var (
	CheckBoxRect graphic.Rect
)
View Source
var (
	ImageButtonPhysicalPosition graphic.Vector2
)
View Source
var (
	SliderRect graphic.Rect
)

Functions

func InitFont added in v1.1.0

func InitFont()

func NewNotificationText added in v1.1.0

func NewNotificationText(notifText string)

func UpdateNotification added in v1.1.0

func UpdateNotification()

Types

type CheckBox

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

la CheckBox est une case à cocher

func NewCheckBox

func NewCheckBox(position graphic.Vector2, horizontalAnchor int8, verticalAnchor int8) *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, horizontalAnchor int8, verticalAnchor int8) *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, horizontalAnchor int8, verticalAnchor int8) *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, horizontalAnchor int8, verticalAnchor int8) *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, horizontalAnchor int8, verticalAnchor int8) *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, horizontalAnchor int8, verticalAnchor int8) *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