Handles view operations of the game

Inheritance

Constructors

GameView(GameMode _gameMode, LevelManager _levelManager)

GameView constructor with given gameMode and levelManager

Properties

isRunning → bool

If the game is currently running

read-only
onInput → Stream<Vector2>

Stream of movement vectors

read / write
onSelectLevel → Stream<int>

When a level has been chosen to play

read / write
hashCode → int

The hash code for this object.

read-only, inherited
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

closeGameView(bool failed) → Future

Closes the game view and shows the menu where failed indicates whether the game was lost before

createActor(Actor actor) → dynamic

Creates a new actor in the view based on the model.

hintBig(String text, Duration duration) → Future

Shows a big hint label with text in the upper center of the screen for the given duration

openGameView() → Future

Creates a new game view and hides the menu.

removeActor(Actor actor) → dynamic

Removes the actor from the view.

activate(Element el) → void

Activates el by adding the "active" class to it

inherited
clearCache() → dynamic

Clears the Cache

inherited
create(Element host, String id) → Element

Creates a new div with the given id on the host and returns the Element

inherited
deactivate(Element el) → void

Deactivates el by removing the "active" class from it

inherited
get(String id) → Element

Gets an Element from the DOM by the id or from the cache if available

inherited
hide(Element el) → void

Hides el by adding the "hidden" class to it

inherited
move(Element el, Vector2 position) → void

inherited
nextFrame() → Future<num>

Returns a Future that resolves before the next animation frame with the given runtime

inherited
noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
remove(String id) → void

Removes an Element from the DOM by the id

inherited
rotate(Element el, Vector2 rotation) → void

inherited
scale(Element el, Vector2 scale) → void

inherited
setDimensions(Element el, Vector2 size) → void

inherited
show(Element el) → void

Shows el by removing the "hidden" class from it

inherited
timeout(Duration duration, { Function before, Function after }) → Future

Returns a Future that resolves after Duration and optionally calls before and after the Duration.

inherited
toString() → String

Returns a string representation of this object.

inherited
transform(Element el, { Vector2 position, Vector2 rotation, Vector2 scale }) → void

Updates the transform on el using optional Vectors. This function prevents seperate manual transform updates, that either update rotatiom, position or scale to override each other.

inherited
wait(Duration duration) → Future

Returns a Future that resolves after duration

inherited