Skip to content

Commit

Permalink
fix: rename default to div 'game'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebring committed Oct 12, 2021
1 parent c1295a1 commit d32caa0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/crafty/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ Crafty.extend({
* @param Number height - Height of the stage
* @param String or HTMLElement stage_elem - the element to use for the stage
*
* Sets the element to use as the stage, creating it if necessary. By default a div with id 'cr-stage' is used, but if the 'stage_elem' argument is provided that will be used instead. (see `Crafty.viewport.init`)
* Sets the element to use as the stage, creating it if necessary. By default a div with id 'game' is used, but if the 'stage_elem' argument is provided that will be used instead. (see `Crafty.viewport.init`)
*
* Starts the `UpdateFrame` interval. This will call the `UpdateFrame` event for every frame.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/crafty/graphics/dom-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Crafty._registerLayerTemplate("DOM", {
* @kind Property
* @private
*
* A div inside the `#cr-stage` div that holds all DOM entities.
* A div inside the `#game` div that holds all DOM entities.
*/
_div: null,

Expand Down
6 changes: 3 additions & 3 deletions lib/crafty/graphics/viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ Crafty.extend({
*
* Initialize the viewport.
* If the arguments 'width' or 'height' are missing, use `window.innerWidth` and `window.innerHeight` (full screen model).
* The argument 'stage_elem' is used to specify a stage element other than the default, and can be either a string or an HTMLElement. If a string is provided, it will look for an element with that id and, if none exists, create a div. If an HTMLElement is provided, that is used directly. Omitting this argument is the same as passing an id of 'cr-stage'.
* The argument 'stage_elem' is used to specify a stage element other than the default, and can be either a string or an HTMLElement. If a string is provided, it will look for an element with that id and, if none exists, create a div. If an HTMLElement is provided, that is used directly. Omitting this argument is the same as passing an id of 'game'.
*
* Usually you don't have to initialize the viewport by yourself, it's automatically initialized by calling `Crafty.init()`. Multiple `init`s will create redundant stage elements. Use `Crafty.viewport.width`, `Crafty.viewport.height` or `Crafty.viewport.reload` to adjust the current viewport's dimensions.
*
Expand Down Expand Up @@ -611,7 +611,7 @@ Crafty.extend({

//check if stage exists
if (typeof stage_elem === 'undefined')
stage_elem = "cr-stage";
stage_elem = "game";

var crstage;
if (typeof stage_elem === 'string')
Expand All @@ -634,7 +634,7 @@ Crafty.extend({
* @comp Crafty.stage
* @kind Property
*
* The `#cr-stage` div element.
* The `#game` div element.
*/

//create stage div to contain everything
Expand Down
2 changes: 1 addition & 1 deletion src/freerunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export declare interface FGame {
cc<T extends CComponent>(component: CComponent) : T
e<T extends Entity>(components: string): T
fps: number
init(width?:number, height?:number, element?:HTMLElement|null): this
init(width?:number, height?:number, element?:HTMLElement|string|null): this

/**
* Set background color to html color name.
Expand Down

0 comments on commit d32caa0

Please sign in to comment.