javascript - How can I get a PixelsObject from a Texture in Incisor? - Stack Overflow

I'm following the Incisor API documentation to create a PixelsObject from a graphic. I've con

I'm following the Incisor API documentation to create a PixelsObject from a graphic. I've confirmed that pawn.png is in my Assets directory and visible in LiveView. However, I’m getting an exception on the second line of code, and the console log is never displayed.

Here's a simple block of code that will reproduce the error:

class ProjectMain {
    init() {
        let pawn = new GraphicObject(nc.graphicAssets.pawn, nc.mainScene, "Pawn");
        let pawnPixelsObject = nc.pixelsObjects.getPixelsObject(pawn.materialMaster.mainTexture);
        console.log(pawnPixelsObject);
    }
}

Can anyone help me understand why an exception occurs?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745352048a4623892.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信