Using Cocos Creator, in my script I can access the image and the data of a texture by calling
cc.Texture2D.getHtmlElementObj() when the game runs on the web/HTML5, but how can I achieve the same when in a native system?
I get the error
getHtmlElementObj() is not a function when I try to run it in the simulator, which I guess I can understand because there is no HTML or DOM elements in a native system. cc._renderContext is also undefined in native.
If so, what is the best way to access a texture image's raw data(pixel information) in native system? I would like to be able to access the texture image's data in all platforms.