# Is it sprite ? or GUI？How to position on the house ？ manual？

**URL:** <https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709>\
**Category:** Questions\
**Tags:** gui, sprite\
**Created:** [May 10, 2021, 12:25pm UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709 "2021-05-10T12:25:14Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![musk](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/musk/32/17156_2.png) [@musk](https://forum.babylonjs.com/u/musk)\
**Post date:** [May 10, 2021, 12:25pm UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709/1 "2021-05-10T12:25:14Z")

</div>

![20210510201205](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/0/60b9fc205d073244f31e8219232614f825ab6202.jpeg)

demo: [campus Albano](https://campusalbano.se/view/all)

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [May 10, 2021, 12:35pm UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709/2 "2021-05-10T12:35:23Z")

</div>

You may use GUI here, like in the example - [https://playground.babylonjs.com/#XCPP9Y#20](https://playground.babylonjs.com/#XCPP9Y#20)  
In order to position one needs to know the name of the mesh where GUI label should be attached to, for example:  
`myLabel.linkWithMesh(sphere);`

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [May 10, 2021, 12:41pm UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709/3 "2021-05-10T12:41:06Z")

</div>

Lol. How did you decypher this question 🧙 I didn’t even know which part to look at.  
If this was really the question, total respect to you. And then, yes, I believe your answer works;)

---

<div class="post-metadata">

**Author:** ![babylonjs197s](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@babylonjs197s](https://forum.babylonjs.com/u/babylonjs197s)\
**Post date:** [June 10, 2021, 3:36am UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709/4 "2021-06-10T03:36:57Z")

</div>

I have the same question as you. Have you found the solution

---

<div class="post-metadata">

**Author:** ![msDestiny14](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/msdestiny14/32/9572_2.png) [@msDestiny14](https://forum.babylonjs.com/u/msDestiny14)\
**Post date:** [June 10, 2021, 4:10am UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709/5 "2021-06-10T04:10:47Z")

</div>

The solution is what labris has posted. Using GUI we can link it to a mesh, in the example demo, the buildings.

---

<div class="post-metadata">

**Author:** ![babylonjs197s](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@babylonjs197s](https://forum.babylonjs.com/u/babylonjs197s)\
**Post date:** [June 10, 2021, 6:08am UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709/6 "2021-06-10T06:08:00Z")

</div>

What I want to achieve is to let the pop-up box of GUI move with the wizard. What should I do

---

<div class="post-metadata">

**Author:** ![musk](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/musk/32/17156_2.png) [@musk](https://forum.babylonjs.com/u/musk)\
**Post date:** [June 10, 2021, 6:16am UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709/7 "2021-06-10T06:16:29Z")

</div>

i have a playground can help you 😉  
[https://www.babylonjs-playground.com/#ZI9AK7#1432](https://www.babylonjs-playground.com/#ZI9AK7#1432)

---

<div class="post-metadata">

**Author:** ![babylonjs197s](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@babylonjs197s](https://forum.babylonjs.com/u/babylonjs197s)\
**Post date:** [June 10, 2021, 7:57am UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709/8 "2021-06-10T07:57:28Z")

</div>

I tried this scheme, but he couldn’t bind to the spirit. I didn’t know if it was the problem of the spirit coordinates. I created a circle with the coordinate position of X: 0, Y: 0, Z: 0. I also set the coordinates of the spirit as X: 0, Y: 0, Z: 0, but the position of the spirit was obviously higher than that of the circle

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/7/173670e1443e99b7230f216f1ec2553443cf1588.png)

const spriteManagerTrees = new BABYLON.SpriteManager(‘camerasManager’, ‘/static/gltf/image/camera.png’, 20000, {  
width: 512,  
height: 1024  
}, \_that.scene2)  
spriteManagerTrees.isPickable = true  
for (let i = 0; i \< 3; i++) {  
// Mutliple trees  
const myCamera = new BABYLON.Sprite(‘cameras’, spriteManagerTrees)  
myCamera.width = 2  
myCamera.height = 4  
myCamera.isPickable = true  
myCamera.useAlphaForPicking = true  
myCamera.investigationType = ‘arcCamera’  
myCamera.position.x = 0  
myCamera.position.y = 0  
myCamera.position.z = 0  
myCamera.actionManager = new BABYLON.ActionManager(\_that.scene2)  
myCamera.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickUpTrigger, function (res) {  
console.log(res)  
let pickResult = \_that.scene2.pickSprite(res.pointerX, res.pointerY)  
if (pickResult.hit) {  
\_that.showExplain(pickResult)  
}  
}))

---

<div class="post-metadata">

**Author:** ![musk](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/musk/32/17156_2.png) [@musk](https://forum.babylonjs.com/u/musk)\
**Post date:** [June 10, 2021, 8:45am UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709/9 "2021-06-10T08:45:56Z")

</div>

here:  
myCamera.width = 2  
myCamera.height = 4  
width and height will affect the myCamera’s position

---

<div class="post-metadata">

**Author:** ![babylonjs197s](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@babylonjs197s](https://forum.babylonjs.com/u/babylonjs197s)\
**Post date:** [June 10, 2021, 9:10am UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709/10 "2021-06-10T09:10:56Z")

</div>

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/1/c1c9501f40af69040fb2dc3e959a98069eb7ac98.png)  
Well, thank you very much, but there is a new problem. He can’t follow the camera. As long as I turn the camera position, I will deviate. Is there any good solution to provide  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/6/5/653d72208b9b15bcc64e5fe3b270789547dc7b3b.png)

---

<div class="post-metadata">

**Author:** ![musk](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/musk/32/17156_2.png) [@musk](https://forum.babylonjs.com/u/musk)\
**Post date:** [June 10, 2021, 9:28am UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709/11 "2021-06-10T09:28:31Z")

</div>

you need to use GUI

---

<div class="post-metadata">

**Author:** ![babylonjs197s](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@babylonjs197s](https://forum.babylonjs.com/u/babylonjs197s)\
**Post date:** [June 10, 2021, 9:38am UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709/12 "2021-06-10T09:38:08Z")

</div>

I don’t know how to do it. Can I give you an example 😁

---

<div class="post-metadata">

**Author:** ![musk](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/musk/32/17156_2.png) [@musk](https://forum.babylonjs.com/u/musk)\
**Post date:** [June 10, 2021, 9:58am UTC](https://forum.babylonjs.com/t/is-it-sprite-or-gui-how-to-position-on-the-house-manual/20709/13 "2021-06-10T09:58:34Z")

</div>

I’m not sure to understand, Can’t that playground help you? [https://www.babylonjs-playground.com/#ZI9AK7#1433](https://www.babylonjs-playground.com/#ZI9AK7#1433)
