tywang2006 Posted August 17, 2016 Share Posted August 17, 2016 I did some code here this._iconSprite = GameAsset.icons[id]; this._iconSprite.x = (this.symbolWidth - this._iconSprite.width) / 2; this._iconSprite.y = (this.symbolHeight - this._iconSprite.height) / 2 - offset; this._renderer.render(this._iconSprite, this._renderTexture, true); Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 17, 2016 Share Posted August 17, 2016 We'll fix that issue anyway, but the time spent on it depends on how much information you give us. If you need it RIGHT NOW, please convert it to pixiv4 code first and confirm that its not working properly in our examples page http://pixijs.github.io/pixi-examples-v2/#/basics/render-texture.js Quote Link to comment Share on other sites More sharing options...
tywang2006 Posted August 17, 2016 Author Share Posted August 17, 2016 PIXI.loader.add('../assets/icons/icons.json').load(onAssetLoaded); function onAssetLoaded(loader:any, resource:any):void { let renderer:any = new PIXI.CanvasRenderer(600, 600); renderer.backgroundColor = 0x000000; window.document.body.appendChild(renderer.view); var sprite = new PIXI.Sprite(PIXI.Texture.fromFrame('icon0')); var spriteNew = new PIXI.Sprite(); spriteNew.texture = PIXI.RenderTexture.create(sprite.width, sprite.height); var stage = new PIXI.Container(); stage.addChild(spriteNew); function render() { spriteNew.x+=1; sprite.x+=0.1; renderer.render(sprite,spriteNew.texture); renderer.render(stage); requestAnimationFrame(render); } render(); } i can duplicate it with above code Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.