(sorry for my english=/) I create an array when 'onload'.
(this:
var $ = {
ratio: 0.7,
screen: 500,
margin: 10,
canvas: document.getElementById("canvas"),
ctx: document.getElementById("canvas").getContext("2d"),
}
and $.canvas
and $.ctx
is give 'null'.
this work if i rewrite it
...
canvas: function(){return document.getElementById("canvas")}
...
but if i want to call this the variable looks like this $.canvas () how can i make this variable without '()'???