# Moving the whole renderCanvas off-center content without cutting off borders

**URL:** <https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272>\
**Category:** Questions\
**Created:** [March 9, 2022, 5:11pm UTC](https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272 "2022-03-09T17:11:53Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![EvilTwinsNiceBrother](https://avatars.discourse-cdn.com/v4/letter/e/51bf81/32.png) [@EvilTwinsNiceBrother](https://forum.babylonjs.com/u/EvilTwinsNiceBrother)\
**Post date:** [March 9, 2022, 5:11pm UTC](https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272/1 "2022-03-09T17:11:53Z")

</div>

Hello,  
I am using a simple 3d Model display with an ArcRotateCamera.  
By default the whole contents is centered within the window.  
Now I would like to basically just move everything in the window 500px to the right.  
When I use css with “transform: translate(500px);” I get the desired result but the the canvas is obviously cut off on the left side.  
What would be the way to do this within the BabylonCanvas?  
I would like to keep all camera and interaction angles the same as it is in the centered version.

Thanks a lot

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [March 10, 2022, 11:26am UTC](https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272/2 "2022-03-10T11:26:45Z")

</div>

Hello! You want the canvas to move, but the object that is viewed through it to stay fixed on the screen, like the canvas is a “window” through which the object is seen? Like this?

 ![diagram](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/5/3565155bc76d6e708570e198b9b7f450eca2935a.png)

I think that this can be achieved by applying the inverse transformation to the camera’s target in world space, so, if you move the canvas 500px to the right, you have to transform the target to the left to the equivalent of 500px in world space.

---

<div class="post-metadata">

**Author:** ![EvilTwinsNiceBrother](https://avatars.discourse-cdn.com/v4/letter/e/51bf81/32.png) [@EvilTwinsNiceBrother](https://forum.babylonjs.com/u/EvilTwinsNiceBrother)\
**Post date:** [March 12, 2022, 2:37am UTC](https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272/3 "2022-03-12T02:37:53Z")

</div>

Hello,

well, my goal is slightly different 🙂  
This is the first state

 ![ExampleA](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/f/4/f4dab8a52318ae4085567657b849f5176f473052.png)  
Then everything gets moved by 500 px to the right:  
 ![ExampleB](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/3/8/388ca70cd3bdf0016b7ac1608da8c72c3807d259.png)

Does this make sense?

---

<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:** [March 13, 2022, 3:31pm UTC](https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272/4 "2022-03-13T15:31:56Z")

</div>

Are you looking into the camera targetScreenOffset property ? [Babylon.js Playground](https://playground.babylonjs.com/#ZS0KBC)

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [March 13, 2022, 7:48pm UTC](https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272/5 "2022-03-13T19:48:36Z")

</div>

> [@EvilTwinsNiceBrother](#):
>
> When I use css with “transform: translate(500px);”

Which element are you applying this to?

---

<div class="post-metadata">

**Author:** ![EvilTwinsNiceBrother](https://avatars.discourse-cdn.com/v4/letter/e/51bf81/32.png) [@EvilTwinsNiceBrother](https://forum.babylonjs.com/u/EvilTwinsNiceBrother)\
**Post date:** [March 14, 2022, 1:17pm UTC](https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272/6 "2022-03-14T13:17:23Z")

</div>

Thanks. That looks very promising. Will investigate.

---

<div class="post-metadata">

**Author:** ![EvilTwinsNiceBrother](https://avatars.discourse-cdn.com/v4/letter/e/51bf81/32.png) [@EvilTwinsNiceBrother](https://forum.babylonjs.com/u/EvilTwinsNiceBrother)\
**Post date:** [March 14, 2022, 1:22pm UTC](https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272/7 "2022-03-14T13:22:26Z")

</div>

I apply this to “canvasZone” and “renderCanvas”

---

<div class="post-metadata">

**Author:** ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)\
**Post date:** [March 14, 2022, 2:07pm UTC](https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272/8 "2022-03-14T14:07:56Z")

</div>

Here is a rough version using the Babylon Viewer it might help you.

[https://musing-joliot-0f7a2f.netlify.app/movecanvas](https://musing-joliot-0f7a2f.netlify.app/movecanvas)

Code at [Tiled/moveCanvas.html at master · BabylonJSGuide/Tiled · GitHub](https://github.com/BabylonJSGuide/Tiled/blob/master/moveCanvas.html)

---

<div class="post-metadata">

**Author:** ![EvilTwinsNiceBrother](https://avatars.discourse-cdn.com/v4/letter/e/51bf81/32.png) [@EvilTwinsNiceBrother](https://forum.babylonjs.com/u/EvilTwinsNiceBrother)\
**Post date:** [March 14, 2022, 9:17pm UTC](https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272/9 "2022-03-14T21:17:14Z")

</div>

Hello John.  
This is not was I want to achieve. as the text is no overlay to the babylon canvas.  
I guess targetScreenOffset might be the solution.

Cheers

---

<div class="post-metadata">

**Author:** ![EvilTwinsNiceBrother](https://avatars.discourse-cdn.com/v4/letter/e/51bf81/32.png) [@EvilTwinsNiceBrother](https://forum.babylonjs.com/u/EvilTwinsNiceBrother)\
**Post date:** [March 15, 2022, 5:36pm UTC](https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272/10 "2022-03-15T17:36:46Z")

</div>

@sebavan  
hello master sebavan.  
I am trying to find some intel on targetScreenOffset.  
Can’t find it in the API.  
Is it a new or undocumented feature?  
Cheers!

---

<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:** [March 15, 2022, 6:13pm UTC](https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272/11 "2022-03-15T18:13:53Z")

</div>

Available here [ArcRotateCamera | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera#targetscreenoffset)

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [April 14, 2022, 10:21am UTC](https://forum.babylonjs.com/t/moving-the-whole-rendercanvas-off-center-content-without-cutting-off-borders/28272/12 "2022-04-14T10:21:45Z")

</div>

Hello @EvilTwinsNiceBrother just checking in, was your question solved? 😃
