coffeescript - Putting Canvas and Context in another Object? -
the following part of configuration file (config.coffee):
define [], () -> config = world: canvas: {} context: {} init: (canvasname) -> config.world.canvas = document.getelementbyid canvasname config.world.context = config.world.canvas.getcontext '2d' character: canvas: {} context: {} init: (canvasname) -> config.character.canvas = document.getelementbyid canvasname config.character.context = config.character.canvas.getcontext '2d'
as can see, i've put canvas object , context object in object, called config!
could work? because no browser feedback.
thank you!
Comments
Post a Comment