I would like to count scale of canvas but i have problem how to write it directly using xui.js - my try:
xui.extend (
{
canvasSetup:function(scale)
{
var canvas = document.getElementById(x$(this));
var context = canvas.getContext('2d');
context.save();
context.translate(0, 0);
context.scale(scale, scale);
draw(context);
context.restore();
}
});
and call function like this
x$("#canvas")
.attr('width', cont_w + 'px')
.attr('height', cont_h + 'px')
;
x$('#canvas').canvasSetup('2');
I am a beginner and I have a problem with the correct code writing of this. (and also with English), so thank you very much for any help.
this works - maybe usefull