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.
|
// Scene manages drawing and updating a bunch of components.
|
||||||
type Scene struct {
|
type Scene struct {
|
||||||
Components []interface{}
|
Components []interface{}
|
||||||
|
Disabled bool
|
||||||
Hidden bool
|
Hidden bool
|
||||||
ID
|
ID
|
||||||
Transform GeoMDef
|
Transform GeoMDef
|
||||||
|
@ -69,6 +70,9 @@ func (s *Scene) Scan() []interface{} { return s.Components }
|
||||||
|
|
||||||
// Update calls Update on all Updater components.
|
// Update calls Update on all Updater components.
|
||||||
func (s *Scene) Update() error {
|
func (s *Scene) Update() error {
|
||||||
|
if s.Disabled {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
needsSort := false
|
needsSort := false
|
||||||
curZ := -math.MaxFloat64 // fun fact: this is min float64
|
curZ := -math.MaxFloat64 // fun fact: this is min float64
|
||||||
for _, c := range s.Components {
|
for _, c := range s.Components {
|
||||||
|
|
|
@ -15,6 +15,7 @@ func init() {
|
||||||
|
|
||||||
// Tilemap renders a grid of tiles.
|
// Tilemap renders a grid of tiles.
|
||||||
type Tilemap struct {
|
type Tilemap struct {
|
||||||
|
Disabled bool
|
||||||
Hidden bool
|
Hidden bool
|
||||||
ID
|
ID
|
||||||
Map [][]Tile
|
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.
|
// Update calls Update on any tiles that are Updaters, e.g. AnimatedTile.
|
||||||
func (t *Tilemap) Update() error {
|
func (t *Tilemap) Update() error {
|
||||||
|
if t.Disabled {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
for j := range t.Map {
|
for j := range t.Map {
|
||||||
for i := range t.Map[j] {
|
for i := range t.Map[j] {
|
||||||
if tile, ok := t.Map[j][i].(Updater); ok {
|
if tile, ok := t.Map[j][i].(Updater); ok {
|
||||||
|
|
Loading…
Reference in a new issue