Permalink
Browse files

Document the Texture class.

  • Loading branch information...
1 parent 954170d commit 6a25c9327bdae8b6f0287165ed4651a88a87a852 @jverkoey committed Feb 27, 2010
Showing with 27 additions and 24 deletions.
  1. +27 −24 dev/engine/class.texture.js
View
51 dev/engine/class.texture.js
@@ -29,47 +29,50 @@ goog.require('Breeze.Engine');
Breeze.Engine.Texture = function(path, didLoad) {
/**
* @type {boolean}
+ * @private
*/
this.loaded_ = false;
/**
* @type {function(Breeze.Engine.Texture)}
+ * @private
*/
this.didLoad_ = didLoad;
var img = new Image();
img.onload = this.didLoadTexture.bind(this);
- this._img = img;
+
+ /**
+ * @type {Image}
+ * @private
+ */
+ this.img_ = img;
// Start loading the image.
img.src = path;
};
-Breeze.Engine.Texture.prototype = {
-
- /**
- * @return {boolean}
- */
- isLoaded : function() {
- return this.loaded_;
- },
+/**
+ * @return {boolean}
+ */
+Breeze.Engine.Texture.prototype.isLoaded = function() {
+ return this.loaded_;
+};
- /**
- * @return {Image}
- */
- getImage : function() {
- return this._img;
- },
+/**
+ * @return {Image}
+ */
+Breeze.Engine.Texture.prototype.getImage = function() {
+ return this.img_;
+};
- /**
- * @param {Image} image
- */
- didLoadTexture : function(image) {
- this.loaded_ = true;
+/**
+ * @param {Image} image
+ */
+Breeze.Engine.Texture.prototype.didLoadTexture = function(image) {
+ this.loaded_ = true;
- if (this.didLoad_) {
- this.didLoad_(this);
- }
+ if (this.didLoad_) {
+ this.didLoad_(this);
}
-
};

0 comments on commit 6a25c93

Please sign in to comment.