Jump to content

Something strange with PIXI.Graphics / .geometry.points


Recommended Posts

Hi all!

I have something like this

   let spline = new PIXI.Graphics()

And I want to get all points like this

let points = spline.geometry.points;
 let values = [];
  for (let i = 0i < points.lengthi += 2) {
      values.push({ x: points[i], y: points[i + 1] });

But cycle doesn't work, because of this


Then I decided display points and points.length

    console.log("points: ");
    console.log("points.length = " + points.length);

and what I see


Then I tried to get just one (first element)

    console.log("first element");



I really don't understand what is it and how it works.
Someone know, what it can be?



Link to comment
Share on other sites

20 hours ago, ivan.popelyshev said:

1. output array or object is async thing , you see the future value, after updateBatches()

2. its in "shape.points", not just "points", its related to how shapes are structured in pixi, its pure architectural reason.

Hm hm, I see.
I figured out that for my purpose I can use .currentPath.points


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