ScreenOrganizer

ScreenOrganizer

Holds and references the Objects that make up a games various screens, and has methods for switching between them with graphical transitions.


Constructor

new ScreenOrganizer(game, screenClasses, screenConfigsopt)

Parameters:
Name Type Attributes Description
game CanvasObjectContainer

A reference to the CanvasObjectContainer that is holding the whole game.

screenClasses Array

An Array of Classes or Objects that this screen organizer will hold. Other CanvasObjectContainers or CanvasObjects that will act as different screens for the game.

screenConfigs Array <optional>

An optional Array of methods to call when each screen is initialized.

Members

_aid

_cColor :String

Type:
  • String

_screens :Array

Holds a reference to each screen.

Type:
  • Array

_thrott

constructor

coverShape

coverTimer

currentScreen

gameTitleScreen

myEvents

pr

rectRef

transitioning

Methods

addScreenUnderCover(e)

Parameters:
Name Type Description
e

changeScreen(toThis)

Change to the screen without removing other screens.

Parameters:
Name Type Description
toThis Number

getCoverAnimationRate() → {Number}

Returns:
Type
Number

getCoverColor() → {String}

Returns:
Type
String

getGameReference() → {Object}

Returns:
Type
Object

getScreens() → {Array}

Returns:
Type
Array

getTransitionStatus() → {Boolean}

Returns true if a transition is currently happening.

Returns:
Type
Boolean

getWaitForUnderCoverChanges() → {Boolean}

Returns:
Type
Boolean

init(game, screenClasses, screenConfigs)

Acts like a super function.

Parameters:
Name Type Description
game Object

A reference to the CanvasObjectContainer that holds the whole game.

screenClasses Array

An Array of Classes or Objects that will make up the game. If you pass Classes, they will be instantiated.

screenConfigs Array

An optional Array of methods to call when each related class is added

initializeTransition()

initRemoveCover(e)

Parameters:
Name Type Description
e

removeCoverByFadeOut(ts)

Parameters:
Name Type Description
ts

setCoverAnimationRate(toThis)

Parameters:
Name Type Description
toThis Number

setCoverColor(toThis)

Parameters:
Name Type Description
toThis

setWaitForUnderCoverChanges(toThis)

If set to true then the transition will wait for any under cover changes to complete before transitioning back.

Parameters:
Name Type Description
toThis Boolean

showCoverAndKill(ts)

Transitions foward and removes all children from theGame. Used by switchScreen.

Parameters:
Name Type Description
ts

showCoverNoKill(ts)

Transition foward without removing screens. Used by changeScreen.

Parameters:
Name Type Description
ts

switchScreen(toThis)

Switch to a screen and remove all others.

Parameters:
Name Type Description
toThis

transitionBackward() → {Boolean}

Returns:

Returns true when transition is complete

Type
Boolean

transitionForward() → {Boolean}

Returns:

Returns true when transition is complete

Type
Boolean

uncoverDone(e)

Parameters:
Name Type Description
e