rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.22k stars 263 forks source link

grid buttons - no of elements in a row #142

Closed sthakral closed 3 years ago

sthakral commented 3 years ago

Hi,

In the grid buttons - if we increase the no of buttons per row, we don't see all elements. For example, in your demo https://codepen.io/rexrainbow/pen/MWaExGE if we have buttons array as 62 instead of 34, we only see 4 buttons. What controls the no of elements per row?

rexrainbow commented 3 years ago

Number of items in a row/column is set from the dimension of buttons array in line 40, which can not be changed after created. To append/remove item dynamically, try fixwidthsizer, see this demo

sthakral commented 3 years ago

Please check again. If I wanted a single row of 12 buttons, I'd describe the buttons array as 1*12 array. But in that case I only get a single button, not the expected 12. Change line 40 to buttons: [ [btns['7'], btns['8'], btns['9'], btns['4'], btns['5'], btns['6'], btns['1'], btns['2'], btns['3'], btns['<'], btns['0'], btns['.']] ],

rexrainbow commented 3 years ago

Thanks for reporting this bug. It has been fixed, please download latest version of rexUI (or upgrade npm package)