Class: AppBase

caph. AppBase

new AppBase()

A class abstracts the details of common caph-ui-related tasks, like initializing the rendering module, the input-focusing module, the scene manager, and so on, so that developers can focus on the details that make their app unique. You are also able to make your own application extended from this class.

Since:
  • 2.0.0
Example
var AppBase = caph.require('AppBase');
var app = new AppBase();
app.run();

Methods

<protected> _create()

Handles tasks to do in the creation sequence. Creation and Initialization will be invoked in sequence.

Since:
  • 2.0.0

<protected> _initialize()

Handles tasks to do in the initialization sequence. Creation and Initialization will be invoked in sequence.

Since:
  • 2.0.0

setup(option)

Extends the given object with this object's option parameter, which will be used during app's life status.

Parameters:
Name Type Argument Description
option Object <optional>

An option.

Properties
Name Type Argument Description
userCallback Object <optional>

An object containing user's callback function, which will be invoked in the progress of this app life status.

Properties
Name Type Argument Description
initialize Object <optional>

A function to be invoked in the initializing sequence of this app.

Since:
  • 2.0.0
Example
var AppBase = caph.require('AppBase');
var app = new AppBase();
app.setup({
     userCallback : {
         initialize : function() { // initilization };
     });
app.run();