Hello guys , please i need to open an image when i click in the first time a button , and close the image when i click in the same button a second time , i try it with this code but i know it is wrong , can someone help me ?
var button1 = BABYLON.GUI.Button.CreateImageOnlyButton(bt, “bt.png”);
var test =0;
button1.onPointerUpObservable.add(function() {
test =1;
if (test==1) { advancedTexture.addControl(plan_image); }
if (test==0) {advancedTexture.RemoveControl(plan_image); test=1;}
}
);
advancedTexture.addControl(button1);
advancedTexture.addControl(plan_image);
Thanks