Hi guys,
i am trying to shrink my 100*100 celled isometric map to fit my desktop screen on click of a button (or through scroll event).
The only possible option I have managed to get is the canvas zoom-in/out feature in melonJS. It is not suiting my requirement as the border cells are not shown inside my viewport.
Could you suggest if there is any better way to do this?
My current code looks something like this :
// register on mouse event
me.input.registerPointerEvent("wheel", me.game.viewport, function (event) {
me.event.publish("wheel", [ event ]);
},false);
this.mousewheel = me.event.subscribe("wheel", function (event) {
console.log("^^^");
var viewport = me.game.viewport;
//viewport.inViewport = true;
if ( event.deltaY >0 ){
console.log("scrolldown");
viewport.currentTransform.scale(0.999);
console.log(jq('canvas'));
}else{
console.log("scrollup");
viewport.currentTransform.scale(1.001);
}
});