I am using sigma.js and try to add background image instead of background color. It work find but not possible to zoom in/out. Someone already add a question here but no answer yet. So anyone have a solution of this issue?
After a simple lucky search i found the following solution:
var c = s.camera;
// Zoom out - single frame :
c.goTo({
ratio: c.ratio * c.settings('zoomingRatio')
});
// Zoom in - single frame :
c.goTo({
ratio: c.ratio / c.settings('zoomingRatio')
});
// Zoom out - animation :
sigma.misc.animation.camera(c, {
ratio: c.ratio * c.settings('zoomingRatio')
}, {
duration: 200
});
// Zoom in - animation :
sigma.misc.animation.camera(c, {
ratio: c.ratio / c.settings('zoomingRatio')
}, {
duration: 200
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With