added canvas_helper file
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
function getContext() {
|
||||
return document.getElementsByTagName('canvas')[0].getContext('2d');
|
||||
}
|
||||
|
||||
function random() {
|
||||
return Math.random();
|
||||
}
|
||||
|
||||
function getCanvasWidth() {
|
||||
return document.getElementsByTagName('canvas')[0].width;
|
||||
}
|
||||
|
||||
function getCanvasHeight() {
|
||||
return document.getElementsByTagName('canvas')[0].height;
|
||||
}
|
||||
Reference in New Issue
Block a user