gg/ox/feats.go
2024-06-02 00:01:17 +05:00

56 lines
868 B
Go

package ox
import "surdeus.su/core/gg"
type Drawity struct {
ObjectImpl
Visibility
Colority
Shaderity
Floatity
Layer
}
// Feat to emded for turning antialias on and off.
type Antialiasity struct {
Antialias bool
}
// Feat to embed for turning visibility on and off.
type Visibility struct {
Visible bool
}
func (v Visibility) IsVisible() bool {
return v.Visible
}
func (v *Visibility) ToggleVisibility() bool {
v.Visible = !v.Visible
return v.IsVisible()
}
// Feat to embed to make colorful objects.
type Colority struct {
Color gg.Color
}
// The structure to embed into shaderable
// objects.
type Shaderity struct {
gg.ShaderOptions
}
func (s Shaderity) GetShaderOptions(
) *gg.ShaderOptions {
return &s.ShaderOptions
}
type Floatity struct {
Floating bool
}
func (s Floatity) IsFloating() bool {
return s.Floating
}
type Layer = gg.Layer