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

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -