Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

TilingSprite resize


lukasyno
 Share

Recommended Posts

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);
Link to comment
Share on other sites

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.

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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