ipop Posted July 28, 2013 Share Posted July 28, 2013 With var tilingSprite = new PIXI.TilingSprite(texture, window.innerWidth, window.innerHeight) var count = 0; stage.addChild(tilingSprite); The stage is filled by the same tile repeating is that what PIXI.TilingSprite does? How do you reference an array of tiles, and then display them using .TilingSprite? or is this for scrolling a background, for example? Quote Link to comment Share on other sites More sharing options...
ipop Posted July 28, 2013 Author Share Posted July 28, 2013 when i try to loop a backgound using TilingSprite, i get Stuttering of the graphic: // create an new instance of a pixi stagevar stage = new PIXI.Stage(0x97c56e, true); // create a renderer instancevar renderer = PIXI.autoDetectRenderer(window.innerWidth, window.innerHeight, null); // add the renderer view element to the DOMdocument.body.appendChild(renderer.view);renderer.view.style.position = "absolute";renderer.view.style.top = "0px";renderer.view.style.left = "0px";requestAnimFrame( animate ); // create a texture from an image pathvar texture = PIXI.Texture.fromImage("sky.jpg");var tilingSprite = new PIXI.TilingSprite(texture, 1024,1024);stage.addChild(tilingSprite);//stage.addChild(tilingSprite1); function animate() { requestAnimFrame( animate ); tilingSprite.tilePosition.x += 7; renderer.render(stage);} https://www.dropbox.com/s/k49119yz1griq2q/sky.jpg 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.