# Config.width

**URL:** <https://phaser.discourse.group/t/config-width/10537>\
**Category:** Phaser 3\
**Created:** [October 28, 2021, 4:41pm UTC](https://phaser.discourse.group/t/config-width/10537 "2021-10-28T16:41:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dwana](https://avatars.discourse-cdn.com/v4/letter/d/e47c2d/32.png) [@dwana](https://phaser.discourse.group/u/dwana)\
**Post date:** [October 28, 2021, 4:41pm UTC](https://phaser.discourse.group/t/config-width/10537/1 "2021-10-28T16:41:58Z")

</div>

Hello, I trying to add a background to my game, I am trying to use config.height / 2, I have seen this in a tutorial so I know it must work. But when I try and do this.add.image(config.height/2 , config.width/2, ‘bkg’); The game screen is only black. I tried without the /2 and some of the image shows and some black shows, so I know it is somewhat working. For this to work do i need an image that is same size as canvas? Should it not center it anyway even if image larger than canvas? I have uploaded picture of what happens when i try and use this. Also, when i use just numbers ie 400, 300 (half of canvas size) the image shows correctly.

 ![bk](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/9/9d6c99bd25ba1d210b08119f822bb136711c3222.png)  
 ![bk2](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/b/b1c607f276748c165e417a407bdc8f2777f0f16d.png)

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [October 28, 2021, 10:09pm UTC](https://phaser.discourse.group/t/config-width/10537/2 "2021-10-28T22:09:53Z")

</div>

Open the browser dev console so you can see any errors.

I do

```
this.add.image(0.5 * this.scale.width, 0.5 * this.scale.height, 'bkg')
```

---

<div class="post-metadata">

**Author:** ![J14P](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/j14p/32/8161_2.png) [@J14P](https://phaser.discourse.group/u/J14P)\
**Post date:** [March 22, 2024, 8:31pm UTC](https://phaser.discourse.group/t/config-width/10537/3 "2024-03-22T20:31:53Z")

</div>

Thank you so very much!!! You saved me with this fix.
