GUI Control linkOffset issue

I have a scenario whereas I will pick from a number of meshes which have different sizes. I have created an GUI advancedTexture containing a number of controls and link it to the mesh.

Now , I want the advancedTexture to appear exactly on the right and top side of the mesh. In order to do that I need to calculate the mesh height and width which Babylon returns in Babylon units.

However both linkOffsetX and linkOffsetXInPixels use pixels as a unit of measurement and I don’t want to use pixels since meshes will have varying sizes + pixels will behave differently on ipads and mobiles.

Here is a simple demo

Maybe @Evgeni_Popov has a nice idea for this :slight_smile: (disclaimer: I am still a GUI N00b)

Unfortunately you will have to update the linkOffsets manually as we do not provide other ways to move the links

The idea should be to project the mesh bounding box (with Vector3.Project). this will give you pixel informations on where the box is on your screen
Should be easy then to move the linkOffsets

1 Like

Thanks for clarifying that linkOffsets are in pixels ONLY.

1 Like