Jump to content

Scale shapes without scaling borders?


Recommended Posts

I'm having trouble understanding the docs: https://pixijs.download/v4.8.1/docs/PIXI.Graphics.html#nativeLines

Where do I set this value? I'm on v6. I tried setting it this way,

const graphics = new PIXI.Graphics({ nativeLines: true });

...but I get all variety of errors, this being one of them. I get others if I comment out every line where I call any method on the graphics instance, and I still get errors.

this._geometry.drawShape is not a function
    at Graphics.drawShape (graphics.js:2805)
    at Graphics.startPoly (graphics.js:2473)
    at Graphics.beginTextureFill (graphics.js:2692)
    at Graphics.beginFill (graphics.js:2671)
    at main.js:96
    at Array.forEach (<anonymous>)
    at paintCandles (main.js:81)
    at main.js:100


While I'm asking about this, is there a part of the library to help with zoom and pan calculations? The project I'm working on is a charting system, and it needs to load historical data as the user zooms and pans back into the older data.

Edited by robtacular
Link to comment
Share on other sites

Okay, I found the answer. Browsed around the repo, so glad this is in TS. Updated my call to `lineStyle`:

graphics.lineStyle(1, color, 1, 0.5, true);

Thanks for the help!

Also, I see that I linked to the wrong version of the docs, I neglected to check that when I followed a search result link.

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