How to remove a particular grid from a batch added grid


These are bulk 3dguis, but I want to get rid of one of them, or at least control one of them, which I should do

Hi IP. I started experiments… trying to remove row 3 of buttons. (Am I on-topic? I hope so.)

https://www.babylonjs-playground.com/#HB4C01#250

After 5 seconds, I remove row 3… buttons 21 thru 30.

Success, but problems. (Sphere radius change is ONE problem)

PG Tour:

  • Lines 15-18 CAN be used to determine if spherePanel is drawn BY ROWS or BY COLUMNS.
  • Lines 43-46 - many console.log lines to “see” container structures and children controls.
  • Lines 54-60 is ONE way to remove row… but I used shorter method.
  • Lines 63-65 ANOTHER way to remove 10 controls… by removing control #20… 10 times. (used)
  • Line 80 set rows = 5 instead of 6. But this makes panel._rowThenColum = false;
  • Line 82 set panel._rowThenColum = true again.

https://www.babylonjs-playground.com/#HB4C01#251 - here I test using line 68 to remove row. It fails, as you can see, but we can easily see the change in spherePanel radius… after rows = 5 setting. SpherePanel radius gets wider. This means that both row and column values are used internally… to calculate a default spherePanel sphere radius. You can set that radius value yourself, too… if wanted.

Line 68 row-removal method CAN work… but you must modify lines 68-71… like this: https://www.babylonjs-playground.com/#HB4C01#252

That’s all I have tested so far… just removing one row of a rows-oriented spherePanel.

I hope I am on-topic. Quite a challenging task, eh? nod.

Keep listening for more ideas… and tell me/us if on-topic or not. Tell us more details, if you like.

It might be better/wiser to remove/destroy old spherePanel and make new one when changes are needed. Editing/refreshing current spherePanel seems to be hard work.

A couple notes: You can activate/remark large blocks of code in the playground… by highlighting many lines, and then typing control /. Also, although the button labels start with “Button #1”… it is actually panel.children[0]

Update: Want to see a column removed? Ok. https://www.babylonjs-playground.com/#HB4C01#253
After 5 seconds, the 4th column is removed. (buttons 37 thru 42 in this BY-COLUMNS spherePanel PG). Line 17 is what caused the grid to become “by-columns” (“columns-oriented”?)… with button numbers vertically sequenced. Other by-columns adjustments were made in lines 63, 64, 78 and 82.

1 Like