[]关于纹理的显示问题

 
 
var sprite:Sprite=new Sprite();
sprite.pos(0, 0);
var texture:Texture=new Texture(Browser.window.sharedCanvas);
if (texture)
{
// texture.bitmap.alwaysChange=true; //小程序使用,非常费,这个参数可以根据自己的需求适当调整,如果内容不变可以不用设置成true
   sprite.graphics.drawTexture(texture, 0, 0,texture.width,texture.height);
this.addChild(sprite); 
}
 
 
 LayaUISample.max.js:19468 Uncaught TypeError: Cannot read property 'width' of undefined
    at Texture.moveUV (LayaUISample.max.js:19468)
    at GraphicsGL.__proto.drawTexture (LayaUISample.max.js:1462)
    at LobbyView.__proto.show (LayaUISample.max.js:42743)
    at LayaUISample.__proto.onLoaded (LayaUISample.max.js:1135)
    at Handler.__proto.runWith (LayaUISample.max.js:701)
    at ResInfo.loadComplete (LayaUISample.max.js:18073)
    at EventHandler.__proto.runWith (LayaUISample.max.js:702)
    at ResInfo.__proto.event (LayaUISample.max.js:471)
    at LoaderManager.__proto._endLoad (LayaUISample.max.js:17932)
    at Loader.onLoaded (LayaUISample.max.js:17908)
已邀请:

Aar0n

赞同来自:

好好看那个帖子和demo

要回复问题请先

商务合作
商务合作