cocos2d / cocos2d-html5

Cocos2d for Web Browsers. Built using JavaScript.
https://www.cocos.com
3.07k stars 902 forks source link

Add Texture2D abstraction support #569

Closed ricardoquesada closed 11 years ago

ricardoquesada commented 12 years ago

cocos2d-html5 is not using the Texture2D abstraction internally... and although it might not needed it for "canvas" it is still very useful. Example:

Right now "anti aliasing" is supported in JSB, but in html5 is simply crashes because the method setAliasTexParams is not implemented, in the HTMLImage object.

This could be easily fixed if we use Texture2D as an abstraction of Image.

In canvas, the Texture2D object contains an HTMLImage, and in WebGL it contains a real texture object.

dingpinglv commented 11 years ago

Hi Riq,

We have modified cc.Sprite and subclasses to support cc.Texture2D on Canvas mode at https://github.com/cocos2d/cocos2d-html5/pull/1067

Thank you.