Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0

Defined in: Adventure/Hintcard.js, line 5

Engine class

Description

Hintcard is a repository for game hint options. Hintcard is created automatically by Game. This is an internal class that authors should not need to construct. However, authors can set hint options from their game file as shown below.

Example:

var MyGame = new AdventureJS.Game( "MyGame", "GameDisplay" );
MyGame.Hintcard.set({

});

Private Constructor:

var foo = new AdventureJS.Hintcard(game)

Parameters:

  • game Game
    A reference to the game instance.
Inherited Overrides

Methods Collapse all  |  Expand all

activateHint
activateHint(key, recurse)

Defined in: Adventure/Hintcard.js, line 55

Parameters:

  • key String
    A name or id to search for.
  • recurse Boolean
    Whether to activate recursively.
Activate a hint, with optional recurse.

Returns:

activateHint
activateHint(key, recurse)

Defined in: Adventure/Hintcard.js, line 191

Parameters:

  • key String
    A name or id to search for.
  • recurse Boolean
    Whether to activate recursively.
Reveal a hint, with optional recurse.

Returns:

countHints
countHints()

Defined in: Adventure/Hintcard.js, line 66

Get a count of the number of hints in each group.
createHint
createHint() → {String}

Defined in: Adventure/Hintcard.js, line 90

Create a new hint.

Returns:

String
deactivateHint
deactivateHint(key, recurse)

Defined in: Adventure/Hintcard.js, line 110

Parameters:

  • key String
    A name or id to search for.
  • recurse Boolean
    Whether to deactivate recursively.
Deactivate a hint, with optional recurse.

Returns:

findHintByKey
findHintByKey(key, root) → {Object|null}

Defined in: Adventure/Hintcard.js, line 121

Parameters:

  • key String
    An object key to search for.
  • root Object
    The root object level to begin search.
Find hint by key. Looks recursively.

Returns:

Object | null
findHintByName
findHintByName(key, root) → {Object|null}

Defined in: Adventure/Hintcard.js, line 145

Parameters:

  • key String
    An object key to search for.
  • root Object
    The root object level to begin search.
Find hint by name. Looks recursively.

Returns:

Object | null
hideHint
hideHint(key, recurse)

Defined in: Adventure/Hintcard.js, line 180

Parameters:

  • key String
    A name or id to search for.
  • recurse Boolean
    Whether to activate recursively.
Hide a hint, with optional recurse.

Returns:

obfuscateHint
obfuscateHint()

Defined in: Adventure/Hintcard.js, line 202

Obfuscate hint data.
processLonghand
processLonghand()

Defined in: Adventure/Hintcard.js, line 214

Process hint data in longhand format.
processShorthand
processShorthand()

Defined in: Adventure/Hintcard.js, line 253

Process hint data in shorthand format.
set
set(props) → {AdventureJS.Hintcard}

Defined in: Adventure/Hintcard.js, line 361

Parameters:

  • props Object
    A generic object containing properties to copy to the instance.
Provides a chainable shortcut method for setting a number of properties on the instance.

Returns:

AdventureJS.Hintcard Returns the instance the method is called on (useful for chaining calls.)
toggleHint
toggleHint(key, property, bool, recurse)

Defined in: Adventure/Hintcard.js, line 429

Parameters:

  • key String
    A name or id to search for.
  • property String
    A property to toggle.
  • bool Boolean
    Activate or deactivate.
  • recurse Boolean
    Whether to activate recursively.
Toggle a hint property, with optional recurse.

Returns:

Properties  | 

active
active :Boolean

Defined in: Adventure/Hintcard.js, line 47

Default value: true

The active state of the Hintcard.
hints
hints :Object

Defined in: Adventure/Hintcard.js, line 40

Default value: {}

Container for hints.
introduction
introduction :String

Defined in: Adventure/Hintcard.js, line 33

Default value: ""

Optional introductory text to show at the top of the hintcard.