# Engine registerView problem

**URL:** <https://forum.babylonjs.com/t/engine-registerview-problem/25273>\
**Category:** Questions\
**Created:** [November 14, 2021, 5:29pm UTC](https://forum.babylonjs.com/t/engine-registerview-problem/25273 "2021-11-14T17:29:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ywlee](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ywlee/32/18273_2.png) [@ywlee](https://forum.babylonjs.com/u/ywlee)\
**Post date:** [November 14, 2021, 5:29pm UTC](https://forum.babylonjs.com/t/engine-registerview-problem/25273/1 "2021-11-14T17:29:12Z")

</div>

Hello everyone, as shown in the example, when the fourth parameter of`new BABYLON.Engine` is set to true(adaptToDeviceRatio = true), the newly register view will change, the ball is no longer in the center,  
Is this a bug?  
If it’s not how can I make two canvas same?

edit: Also, If I set the scene clearColor transparent, the view has another problem(also shown in example)

Thank you for reading!  
https://codepen.io/ywlee/embed/preview/LYjNbeN?default-tabs=js%2Cresult&height=300&host=https%3A%2F%2Fcodepen.io&slug-hash=LYjNbeN

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [November 14, 2021, 8:17pm UTC](https://forum.babylonjs.com/t/engine-registerview-problem/25273/2 "2021-11-14T20:17:53Z")

</div>

Maybe @Evgeni_Popov can help with this one ?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [November 15, 2021, 12:33am UTC](https://forum.babylonjs.com/t/engine-registerview-problem/25273/3 "2021-11-15T00:33:16Z")

</div>

I don’t reproduce the size problem in the code pen: are you able to make a repro in the Playground?

I tried myself:

[https://playground.babylonjs.com/#NENG7K#4](https://playground.babylonjs.com/#NENG7K#4)

It creates a view on the right and the main canvas used by the engine is made invisible so that it does not interfere with the view rendering.

I have a set a blue background color on the view canvas and set a transparent color for the scene: as you can see it does work as we can see the blue of the background. However, you need to pass `true` as the 3rd parameter of `registerView` for a transparent color to work.

Also, setting `adaptToDeviceRatio=true` at engine creation is the same thing as changing the hardware scaling level: in this PG I change this value and it does work as expected.

Note that you must use Babylon.js 5.0 for this to work as there were some bugs in 4.2 related to views/hardware scaling level/transparent colors.

---

<div class="post-metadata">

**Author:** ![ywlee](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ywlee/32/18273_2.png) [@ywlee](https://forum.babylonjs.com/u/ywlee)\
**Post date:** [November 15, 2021, 2:49pm UTC](https://forum.babylonjs.com/t/engine-registerview-problem/25273/4 "2021-11-15T14:49:02Z")

</div>

Thank you so much  
These problems had bothered me for a few days, turns out it’s just that I’m using the wrong version  
5.0.0 alpha.60 is perfect and solved all the issues  
Thank you guys again!
