Jump to content

PIXI.Graphics has some odd behavior


BasomtiKombucha
 Share

Recommended Posts

Hi!

I've noticed some really strange behavior when rendering WebGL primitives with pixi. Is this an issue, or should it behave like this?

 

First, when asking for the primitives dimensions, they are always increased by 20:

var graphics = new PIXI.Graphics();graphics.lineStyle(1, 0xffd900, 1);graphics.drawRect(0, 0, 1, 100);stage.addChild(graphics);console.log(graphics.width);console.log(graphics.height);

output:

22121

Second, when asked for its dimensions before there are any, the dimensions in the whole object break and there does not seem to be a way to get them once they really are in there:

var graphics = new PIXI.Graphics();graphics.lineStyle(1, 0xffd900, 1);console.log(graphics.width);graphics.drawRect(0, 0, 1, 100);stage.addChild(graphics);console.log(graphics.width);

output:

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