Dragging the rectangle around is also very slow or does only work if the mouse is moved slowly…
The ultimate goal is to drag and drop the rectangle-control between two different stackpanels, but for now the drop won’t work at all
thank you @adam ! I knew this thread in the old forum before but took a closer look again and was able to find the mistake I made for the slow moving. The key was to call the onPointerMoveObservable also in the container of the rectangle …I just used the advancedTexture before, so the event was only fired when the mouse was over the rectangle.
The problem is: It seems to work only with buttons! When I use rectangle, then the onPointerUpObservable does not fire.
Any idea what I am doing wrong?
It would be no problem for me to extend from the Button-class and modify the look, but maybe here is some bug in the BABYLON.GUI)
@Devin_Wright this is a nice workaround to get a button behave like a rectangle!
Still can’t find the reason why Rectangle is not working
Looking in the source shows:
-Button extends Rectangle
-Rectangle extends Container
Looking at the lines you pointed out, the _processPicking method (which is inherited from the Container-class) is different in the Button-class, but I am not able to fully understand the code yet
Question is: what makes the Button firing the onPointerUp (which is wanted), but why is it not working if I extend from a Rectangle?
(This is just for a better understanding/bugfixing! I like the workaround with the Button and it’s ok in my case…but want to know why it’s not working the other way)