cocos creator 2.0.10版本readPixels 在安卓中不可用,读取到的data是[0,0,0,0]。
但在web环境是可用的。请问大神们有没有遇到同样的问题?
let rt = _textureIdMapRenderTexture[tex.getId()];
console.log( " rt:",rt);
if (!rt) {
rt = new cc.RenderTexture();
rt.initWithSize(tex.width, tex.height);
rt.drawTextureAt(tex, 0, 0);
_textureIdMapRenderTexture[tex.getId()] = rt;
}
let data = rt.readPixels(null, rect.x + posInRect.x, rect.y + rect.height - posInRect.y, 1, 1);
