I have created a game in createjs. For images I am using bitmap to load them. I am able to give them positioning in my grid. I'm trying to change its width and height but its not working.
// this is where i am loading the image.
buttonSolve = new createjs.Bitmap(loader.getResult("buttonCategory"));
centerReg1(buttonSolve);
// i have tried a bunch of methods but none worked.
// buttonSolve.setDrawSize(200, 100);
// buttonSolve.sourceRect = { width: 280, height: 150 };
// buttonSolve.width = buttonSize.w;
// buttonSolve.height = buttonSize.h;
// buttonSolve.setBounds(0, 0, 250, 400);
// this is centerReg1 function:
function centerReg1(obj) {
obj.regX = 195;
obj.regY = 80;
// obj.setBounds(0, 0, 250, 100);
// obj.scaleX = -2;
// obj.x = canvasW / 2 - 120;
// obj.y = (canvasH / 100) * 75;
// obj.sourceRect = { width: 280, height: 150 };
}
kindly someone tell me how to do this!
I am not 100% sure
but you can solve this issue by using
scaleX&scaleYproperties ofbuttonSolvebitmap2nd method
Here
originalWidth&originalHeightare the originalwidth&heightnewWidth&newHeightare the updatedwidth&height