# Nonexistant world!

**URL:** <https://phaser.discourse.group/t/nonexistant-world/2316>\
**Category:** Phaser 3\
**Created:** [May 2, 2019, 7:52am UTC](https://phaser.discourse.group/t/nonexistant-world/2316 "2019-05-02T07:52:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SlavomirDurej](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/slavomirdurej/32/1330_2.png) [@SlavomirDurej](https://phaser.discourse.group/u/SlavomirDurej)\
**Post date:** [May 2, 2019, 7:52am UTC](https://phaser.discourse.group/t/nonexistant-world/2316/1 "2019-05-02T07:52:42Z")

</div>

Total newbie (to Parser) here, so please be patient 🙂

OK, so , even if official tutorials for phaser [https://phaser.io/tutorials/how-to-use-phaser-with-typescript](https://phaser.io/tutorials/how-to-use-phaser-with-typescript) you see a code mentioning this.game.world… (at the bottom of the page) however, no such variable is available in the game’s scope.

1. Is this something that has been now deprecated?
2. if so, what’s the preffered way to get the stage/canvas dimensions?

I’m using Typescript, btw

---

<div class="post-metadata">

**Author:** ![Gecko](https://avatars.discourse-cdn.com/v4/letter/g/c4cdca/32.png) [@Gecko](https://phaser.discourse.group/u/Gecko)\
**Post date:** [May 2, 2019, 8:31am UTC](https://phaser.discourse.group/t/nonexistant-world/2316/2 "2019-05-02T08:31:44Z")

</div>

This tutorial is for Phaser 2 CE, Phaser 3 works well with TypeScript, to start a fresh game you just need to put that:

```javascript
import 'phaser';

const GameCfg: GameConfig = {
    type: Phaser.AUTO,
    parent: 'content',
    width: 640,
    height: 480,
    resolution: 1,
    backgroundColor: "#EDEEC9",
    plugins: {
        global: [],
        scene: []
    },
    scene: []
};

new Phaser.Game(GameCfg);

```

`parent` is the targeted DOM element in your HTML file 😉

---

<div class="post-metadata">

**Author:** ![SlavomirDurej](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/slavomirdurej/32/1330_2.png) [@SlavomirDurej](https://phaser.discourse.group/u/SlavomirDurej)\
**Post date:** [May 2, 2019, 12:14pm UTC](https://phaser.discourse.group/t/nonexistant-world/2316/3 "2019-05-02T12:14:25Z")

</div>

Thank you Gecko, I know how to create a simple game instance, my question was more about if we don’t use world variable in Phaser 3 what would be the best way to obtain dimensions of the stage…

For example one can use :

```
    let hei = this.sys.game.config.height;
    let hei2 = this.game.config.height;

```

to get the height, but I’m not sure what’s the difference between those 2 approaches, or if it’s the best one…

---

<div class="post-metadata">

**Author:** ![jackfreak](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@jackfreak](https://phaser.discourse.group/u/jackfreak)\
**Post date:** [May 3, 2019, 3:04pm UTC](https://phaser.discourse.group/t/nonexistant-world/2316/4 "2019-05-03T15:04:05Z")

</div>

Hi @SlavomirDurej, as version 3.16.2, the best way to get the size of the game canvas is `this.scale.gameSize.width` and `this.scale.gameSize.height` being `this` a reference to your scene. The ScaleManager is now in charge of that. See [https://photonstorm.github.io/phaser3-docs/Phaser.Scale.ScaleManager.html](https://photonstorm.github.io/phaser3-docs/Phaser.Scale.ScaleManager.html)

The `world` variable still exist but when you use Physics and is accesible from `this.physics.world`. It references the World instance in charge of handling the collisions and overlaps of all bodies in it. See [https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.World.html](https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.World.html)
