EaselJS Learning Module

Matt Karl edited this page Sep 1, 2015 · 3 revisions

The EaselJS Learning module is designed to create some convenience methods for automatically tracking events in EaselJS games.

Dependencies

Installing

In order to use the Learning module, make sure to include the module's JavaScript file within the springroll.json file within your project. The module needs to be included after the core. Notice that learning.css is only added to the librariesDebug list.

"libraries": [
	"components/springroll/dist/core.min.js",
	"components/springroll/dist/modules/learning.min.js"
	"components/springroll/dist/modules/easeljs-display.min.js",
	"components/springroll/dist/modules/easeljs-learning.min.js"
],
"librariesDebug": [
	"components/springroll/dist/core.js",
	"components/springroll/dist/modules/learning.js",
	"components/springroll/dist/modules/learning.css",
	"components/springroll/dist/modules/easeljs-display.js",
	"components/springroll/dist/modules/easeljs-learning.js"

]

Getting Coordinates

This module has standard Application methods for getting the X and Y position and converting them into a normalized global position suitable for tracking with the Learning Module. See normalizePosition and currentPosition.

Dwell Time Events

Dwell time is a common measure of duration that the user stays idle without making a selection or action. There's a utility for handling automatically tracking dwell time events. Check out DwellTimer for more information.

// Create DwellTimer, this will automatically 
// track events to the Learning module
DwellTimer.create(playButton); 

// Remove the tracking of dwell time events
DwellTimer.destroy(playButton);