Sha256: 3015310b58b995001fd6118d80806c94a977997241031e274c790d7114ede194

Contents?: true

Size: 1.22 KB

Versions: 17

Compression:

Stored size: 1.22 KB

Contents

/**
 * class Jax.View
 * 
 * Provides a container class around which View functions can be stored.
 * 
 * This is useful because other parts of Jax will set up helper methods and
 * delegation methods for a View to make use of.
 * 
 * For example, one of the most common tasks for a View is to clear the
 * rendering canvas:
 * 
 *     this.glClear(GL_COLOR_BIT | GL_DEPTH_BUFFER_BIT);
 *     
 * The _glClear_ method is delegated into the Jax.Context associated with
 * this view.
 * 
 * By default, in addition to all WebGL methods, the following delegates and
 * properties are created by Jax:
 * 
 *   * *world*   - the instance of Jax.World that houses all of the objects in
 *                 the scene
 *   * *player*  - the instance of Jax.Player for this context containing information
 *                 about the human user.
 *   * *context* - the instance of Jax.Context that this view is associated with.
 * 
 **/
Jax.View = (function() {
  return Jax.Class.create({
    initialize: function(view_func) {
      this.view_func = view_func;
    },
    
    /**
     * Jax.View#render() -> Jax.View
     *
     * Renders this View. Returns itself.
     **/
    render: function() {
      this.view_func();
      return this;
    }
  });
})();

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
jax-2.0.12 lib/assets/javascripts/jax/mvc/view.js
jax-2.0.11 lib/assets/javascripts/jax/mvc/view.js
jax-2.0.10 lib/assets/javascripts/jax/mvc/view.js
jax-2.0.9 lib/assets/javascripts/jax/mvc/view.js
jax-2.0.8 lib/assets/javascripts/jax/mvc/view.js
jax-2.0.7 lib/assets/javascripts/jax/mvc/view.js
jax-2.0.6 lib/assets/javascripts/jax/mvc/view.js
jax-2.0.5 lib/assets/javascripts/jax/mvc/view.js
jax-2.0.4 lib/assets/javascripts/jax/mvc/view.js
jax-2.0.3 lib/assets/javascripts/jax/mvc/view.js
jax-2.0.2 lib/assets/javascripts/jax/mvc/view.js
jax-2.0.1 lib/assets/javascripts/jax/mvc/view.js
jax-2.0.0 lib/assets/javascripts/jax/mvc/view.js
jax-0.0.0.9 src/jax/mvc/view.js
jax-0.0.0.8 src/jax/mvc/view.js
jax-0.0.0.7 src/jax/mvc/view.js
jax-0.0.0.6 src/jax/mvc/view.js