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

How to change x,y origin of renderer to bottom left and flip the y coordinates?


ksoo
 Share

Recommended Posts

var stage = new PIXI.Container();
//dont forget to change that every resize!
stage.position.y = renderer.height / renderer.resolution;
stage.scale.y = -1;

// you need to flip every texture too! 
var texture = PIXI.Texture.fromImage("myTexture.png");
texture.rotate = 8;

// that stuff isnt changed, code like you did it before
var spr = new PIXI.Sprite(texture);
spr.position.x = 100;
spr.position.y = 100;
stage.addChild(spr);

renderer.render(stage);

 

Dont forget to flip ALL the textures you are using. According to http://pixijs.github.io/examples/index.html?s=demos&f=texture-rotate.js&title=Texture%20Rotate&v=dev it can be done by assigning 8 to texture.rotate.

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