rezoner / playground

Playground.js is a framework for your javascript based games. It gives you out-of-box access to essentials like mouse, keyboard, sound and well designed architecture that you can expand to your needs.
MIT License
459 stars 50 forks source link

Specify own canvas/ remove black overlay #24

Closed samuraiseoul closed 8 years ago

samuraiseoul commented 8 years ago

Hi there, not sure if this is the best place to ask for help or not, but I like the feel of your framework, but I can't figure out how to set my own canvas where I want it in the dom and also how to remove the black overlay from the screen. I just more or less want to make a small game that fits into another site. Any suggestions?

rezoner commented 8 years ago

You can specify container providing an element or selector. In case below I want it to be embedded in an element with id="mydiv"

playground({
  container: "#mydiv"
});

Just remember the chronology - first load CSS, then setup HTML and then load the script - otherwise it will not know what the #mydiv is or if you don't setup CSS it will not know where the div is on the screen :)

Not sure what do you mean with the black overlay - the loading screen with PLAYGROUND.js text?