New to Lens Studio. I am trying to move a Screen Image around the screen. The ScreeImage object is instantiated as a child of an orthographic camera. Here's what I am trying:
// Get the transform:
var transform = script.getSceneObject().getTransform();
// Get the world position
var pos = transform.getWorldPosition();
// Change the x
pos.x = Math.max(pos.x, -5.0);
// Reassign the world position
Now I know that objects that were created via Screen Image don't have a Transform component and they have a ScreenTransform instead (like Unity's RectTransform) so I'm assuming this is why getting the transform doesn't work, but I cannot find any straight forward way to access and control the position of ScreenTransform elements in the docs. I find weird that the SceneObject class doesn't have a getScreenTransform method. Could someone point me in the right direction please?
Please sign in to leave a comment.