gg/ox/feats.go

57 lines
868 B
Go
Raw Permalink Normal View History

2024-05-28 11:24:12 +03:00
package ox
2024-06-01 16:07:28 +03:00
import "surdeus.su/core/gg"
type Drawity struct {
2024-06-01 22:01:17 +03:00
ObjectImpl
2024-06-01 16:07:28 +03:00
Visibility
Colority
Shaderity
Floatity
2024-06-01 22:01:17 +03:00
Layer
2024-06-01 16:07:28 +03:00
}
2024-05-28 11:24:12 +03:00
// 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
}
2024-06-01 22:01:17 +03:00
func (v *Visibility) ToggleVisibility() bool {
2024-06-01 16:07:28 +03:00
v.Visible = !v.Visible
return v.IsVisible()
}
2024-05-28 11:24:12 +03:00
// Feat to embed to make colorful objects.
type Colority struct {
2024-06-01 16:07:28 +03:00
Color gg.Color
2024-05-28 11:24:12 +03:00
}
// The structure to embed into shaderable
// objects.
type Shaderity struct {
2024-06-01 16:07:28 +03:00
gg.ShaderOptions
2024-05-28 11:24:12 +03:00
}
2024-06-01 16:07:28 +03:00
func (s Shaderity) GetShaderOptions(
) *gg.ShaderOptions {
2024-05-28 11:24:12 +03:00
return &s.ShaderOptions
}
2024-06-01 16:07:28 +03:00
type Floatity struct {
Floating bool
}
func (s Floatity) IsFloating() bool {
return s.Floating
}
2024-06-01 22:01:17 +03:00
type Layer = gg.Layer