Disabled
This commit is contained in:
parent
4d6c6889de
commit
6e8a3e67df
2 changed files with 9 additions and 1 deletions
|
@ -30,6 +30,7 @@ type ZPositioner interface {
|
|||
// Scene manages drawing and updating a bunch of components.
|
||||
type Scene struct {
|
||||
Components []interface{}
|
||||
Disabled bool
|
||||
Hidden bool
|
||||
ID
|
||||
Transform GeoMDef
|
||||
|
@ -69,6 +70,9 @@ func (s *Scene) Scan() []interface{} { return s.Components }
|
|||
|
||||
// Update calls Update on all Updater components.
|
||||
func (s *Scene) Update() error {
|
||||
if s.Disabled {
|
||||
return nil
|
||||
}
|
||||
needsSort := false
|
||||
curZ := -math.MaxFloat64 // fun fact: this is min float64
|
||||
for _, c := range s.Components {
|
||||
|
|
|
@ -15,6 +15,7 @@ func init() {
|
|||
|
||||
// Tilemap renders a grid of tiles.
|
||||
type Tilemap struct {
|
||||
Disabled bool
|
||||
Hidden bool
|
||||
ID
|
||||
Map [][]Tile
|
||||
|
@ -45,6 +46,9 @@ func (t *Tilemap) Draw(screen *ebiten.Image, geom ebiten.GeoM) {
|
|||
|
||||
// Update calls Update on any tiles that are Updaters, e.g. AnimatedTile.
|
||||
func (t *Tilemap) Update() error {
|
||||
if t.Disabled {
|
||||
return nil
|
||||
}
|
||||
for j := range t.Map {
|
||||
for i := range t.Map[j] {
|
||||
if tile, ok := t.Map[j][i].(Updater); ok {
|
||||
|
|
Loading…
Reference in a new issue