Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Following the Enchant.js tutorial I cannot find a way to define the place the game is rendered in the page. It either takes the maximum possible area or limits itself to the given size (using game.scale = 1).

share|improve this question
up vote 6 down vote accepted

There are two possible ways to do this.

The "fast" hack is to call your game's html page from an iframe. This is not recommended because of the iframe implications and cross-browser differences regarding attributes and, more important, you will not be able to capture input from keyboard.

The best way is to create the div and give it the id 'enchant-stage'. It's direct, 100% cross-browser compliant and lets you capture keyboard input.

<div id="enchant-stage"></div>
share|improve this answer
how did you know about "enchant-stage" ? – onmyway133 Dec 14 '13 at 17:04
@entropy around 5-6 months ago I ended up here and it was awesome! haha – pctroll Dec 17 '13 at 13:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.