hi,
I am working on a scene where in I created 4 image buttons. They are using SVG images over a colored background. I am stretching them so they look nice. Well now they are looking nice, but the problem is that the click only registers in the last part of the button just
before border and not anywhere else. I tried all sort of stuff but doesn’t seem to work. Any suggestions ?
Button Creation
var yrect1 = BABYLON.GUI.Button.CreateImageOnlyButton(“grect1”, “assets/pawnimg.svg”);
yrect1.image.stretch = BABYLON.GUI.Image.STRETCH_UNIFORM;
yrect1.color = "yellow";
yrect1.background = "yellow";
yrect1.width = .1;
yrect1.height = "160px";
yrect1.image.height = "100px";
yrect1.onPointerUpObservable.add(function() {
grect1.children[0].detectPointerOnOpaqueOnly = true;
pawnSelection("y")
});
yrect1.left = 300;
yrect1.alpha = 0;
const calpha = new BABYLON.Animation(“xSlide”, “alpha”, frameRate, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CONSTANT);
const keyFrames = [];
keyFrames.push({
frame: 0,
value: 0
});
keyFrames.push({
frame: 60,
value: 1
});
calpha.setKeys(keyFrames);
scene.beginDirectAnimation(yrect1, [calpha], 0, 2 * frameRate, true);
advancedTexture.addControl(yrect1);