lukasyno Posted June 26, 2013 Share Posted June 26, 2013 Hello, how i can resize tilingSprite effective?Is any easy way? Quote Link to comment Share on other sites More sharing options...
Seby Posted June 26, 2013 Share Posted June 26, 2013 Yeah, you can do it with this : var myTS....myTS.scale.x = 0.5;myTS.scale.y = 0.5; Quote Link to comment Share on other sites More sharing options...
lukasyno Posted June 26, 2013 Author Share Posted June 26, 2013 Yeah, you can do it with this : var myTS....myTS.scale.x = 0.5;myTS.scale.y = 0.5; No. I want resize viewport not change scale.I have TilingSprite on fullScreen in browser and if user change window size i want change viewport size on tilingSprite. Quote Link to comment Share on other sites More sharing options...
Seby Posted June 26, 2013 Share Posted June 26, 2013 If you want resize the size of the View port : renderer.view.style.width = window.innerWidth + "px";renderer.view.style.height =window.innerHeight + "px"; Quote Link to comment Share on other sites More sharing options...
enpu Posted June 26, 2013 Share Posted June 26, 2013 I think he means the viewport of the TilingSprite.The only way i found to do it, is to remove the sprite from stage, change width/height and add it to the stage again. Example:var sprite = new PIXI.TilingSprite(texture, 100, 100);stage.addChild(sprite);...stage.removeChild(sprite);sprite.width = 200;stage.addChild(sprite); Quote Link to comment Share on other sites More sharing options...
xerver Posted June 26, 2013 Share Posted June 26, 2013 The proper way to change the viewport size of a PIXI viewport is to call the resize function of the renderer: renderer.resize(width, height); That will properly update the canvas size, and perform the necessary calculations. You should not be resizing the canvas on your own (especially if you are using WebGL). For more information, see the implementation of resize for the CanvasRenderer and the WebGLRenderer. Quote Link to comment Share on other sites More sharing options...
lukasyno Posted June 26, 2013 Author Share Posted June 26, 2013 @Seby, rolnaaba, Thank you but you don't understand me..@enpu WOW yes exactly what I mean, your hackstage.removeChild(sprite);sprite.width = 200;stage.addChild(sprite);work very nice but i think this is PIXI.TilingSprite BUG (I will report this...).. Quote Link to comment Share on other sites More sharing options...
Seby Posted June 26, 2013 Share Posted June 26, 2013 Sorry I'm just french and english is a bit hard for me Quote Link to comment Share on other sites More sharing options...
lukasyno Posted June 26, 2013 Author Share Posted June 26, 2013 Sorry I'm just french and english is a bit hard for me Easy! 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.