Hiding Info Button and detecting screen size?
I was wondering if it is possible to do the following in Lens Studio:
1) Suppress the "i"/Info button from showing up with your Lens, above the record button. It doesn't show up during development, but shows up after you submit the Lens. It takes up valuable pre-record screen space and I'd rather not have it if possible.
2) Is there any way to gain any information about the user's screen size? If I am utilizing 2D/Billboarding, there are times where I could place assets on the screen that end up underlapping the Snapchat UI on smaller screen devices (iPhone 5SE, for example). If I could detect some metrics I could at least move the elemnts around in script.
HI Wade!
(1) Unfortunately the info button cannot be suppressed once you submit the lens, but I have added this to our feature request list!
(2) Yes! You can use the width and height of the device camera texture to get the screen size. Let me know if it works for you!
Hello Risa !
How can I get the width and the height of the device camera texture ? I tried to get the aspect ratio like this :
// @input Component.Camera camera
function getScreenSize(){
print("Camera aspect : " + script.camera.aspect);
}
getScreenSize();
But the result is always the same : Camera aspect : 1. I also tried script.camera.size and the result is always 10.
Thank you in advance,
Maureen :)
Hi Maureen!
One thing to keep in mind is that the camera info such as camera.size or the deviceCameraTexture.getWidth() are only ready on Lens Turned On. So if you are setting those on Initialized, they are not ready yet. Hope this help!
Best,
Risa
Hi Risa,
Thanks a lot, that works !
Maureen
but how do you actually get the deviceCameraTexture? i have tried absolutely anything. i can pass camera via @input Component.Camera camera but then what?
documentation shows nothing and i have tried everything from the code hinter
i have found it, you have to make
//@input Asset.Texture camTexture;
and have to assign it in the properties explorer. this was so unintuitive