Jump to content

Making Sense of Tiling Sprite


Recommended Posts



var tilingSprite = new PIXI.TilingSprite(texture, window.innerWidth, window.innerHeight)


var count = 0;




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?

Link to comment
Share on other sites

when i try to loop a backgound using TilingSprite, i get Stuttering of the graphic:



// create an new instance of a pixi stage

var stage = new PIXI.Stage(0x97c56e, true);


// create a renderer instance

var renderer = PIXI.autoDetectRenderer(window.innerWidth, window.innerHeight, null);


// add the renderer view element to the DOM


renderer.view.style.position = "absolute";

renderer.view.style.top = "0px";

renderer.view.style.left = "0px";

requestAnimFrame( animate );


// create a texture from an image path

var texture = PIXI.Texture.fromImage("sky.jpg");

var tilingSprite = new PIXI.TilingSprite(texture, 1024,1024);




function animate() {


    requestAnimFrame( animate );


tilingSprite.tilePosition.x += 7;






Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...