最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin2浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论