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

Class:Hintcard

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", "GameContainer" );
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 56

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 192

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 67

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

Defined in: Adventure/Hintcard.js, line 91

Create a new hint.

Returns:

String
deactivateHint
deactivateHint(key, recurse)

Defined in: Adventure/Hintcard.js, line 111

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 122

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 146

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 181

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 203

Obfuscate hint data.
processLonghand
processLonghand()

Defined in: Adventure/Hintcard.js, line 215

Process hint data in longhand format.
processShorthand
processShorthand()

Defined in: Adventure/Hintcard.js, line 254

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

Defined in: Adventure/Hintcard.js, line 362

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:

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

Defined in: Adventure/Hintcard.js, line 430

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 48

Default value: true

The active state of the Hintcard.
hints
hints :Object

Defined in: Adventure/Hintcard.js, line 41

Default value: {}

Container for hints.
introduction
introduction :String

Defined in: Adventure/Hintcard.js, line 34

Default value: ""

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