pixijs / ui

Commonly used UI components for PixiJS

Home Page:https://pixijs.io/ui/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use bidirectional List?

MhhhxX opened this issue · comments

commented

I'm trying to use the List UI component but I have troubles with it. I tried to code something similar to the storybook here with rectangles in the list:

let container = new Container();
let g = new Graphics().beginFill("black", 0.1).drawRect(0,0,540, 600);

let list: List = new List();
g.addChild(list);
list.addChild(new Graphics().beginFill("red").drawRect(0,0, 540 / 2, 100));
list.addChild(new Graphics().beginFill('blue').drawRect(0,0,400, 100));
container.addChild(g);

I expected a bidirectional layout where the blue rectangle is under the red one because I didn't specify the type ListOption and the blue rectangle is too wide to fit in its parent but it always ends up in a horizontal layout like this:

Screen Shot 2023-05-20 at 21 58 28

Do you know what I'm doing wrong?

commented

Thank you for the fix!
I really would like to test it. I tried to add your library with the latest commit on master to my package.json file but it doesn't work:

"dependencies": {
    "pixi.js": "7.2.4",
    "@pixi/ui": "https://github.com/pixijs/ui/tarball/master"
  },

It says @pixi/ui not found when I need to import something.
Can you please give me some hints how to include the latest version to my project?

Made a patch version for you. You can use v0.7.1

commented

Thank you very much!!

No problem. Thank you for catching the bug ;)

commented

I can confirm that your fix work 👍
Screen Shot 2023-05-24 at 11 51 21

Thx again :)