Open eviltik opened 2 years ago
A lot of the time there will be a single panel, so let's stick with an option to use a constructor CanvasUI(content, config). That would automatically add a CanvasPanel(content, config) to the panels array.
Ho yes i see now !
I was working on that on my approach yesterday. Because of keyboard and mouse behavior (same as xr controllers, mouse events are setted twice).
I started a dev-mouse-controller branch based on your dev branch. Let me try.
A lot of the time there will be a single panel,
Well, not sure about that ;)
That would automatically add a CanvasPanel(content, config) to the panels array. Looks like we need a new class. CanvasPanel.
Not all is clear for me, I'm trying to figure out better. Any additional explanations are welcome.
Just to be sure we are in sync :
CanvasUI is used to handle controllers and an array of CanvasPanels CanvasPanel is a single Quad mesh with a CanvasTexture
const ui = new CanvasUI(content, config)
would create a singleton CanvasUI with a single CanvasPanel
The same as
const ui = new CanvasUI()
ui.add(content, config)
Currently, we are creating Canvas UI widgets by instantiating a Canvas class.
Just thinking to tend to something like datGUIXR.