Getting the screen dimensions- dynamically | developer.brewmp.com Getting the screen dimensions- dynamically | developer.brewmp.com

Developer

Getting the screen dimensions- dynamically

Is there a dynamic way to grab the screen dimensions in TrigML? I find myself wanting to use them to aid in positioning and I don't want to hardcode them as variables.

Thanks,

kris

Most of your positioning can be accomplished with the TrigML positioning attributes, such as the edge constraints left, right, top, and bottom. If you really want to get the screen resolution you could write an actor to return the proper value. I don't think any of the common actors currently do this.

Most of your positioning can be accomplished with the TrigML positioning attributes, such as the edge constraints left, right, top, and bottom. If you really want to get the screen resolution you could write an actor to return the proper value. I don't think any of the common actors currently do this.

Hi,
Is there a way to get the screen width and height in TrigML or the "/sys" actor?
In BREW for example we get AEEDeviceInfo.cxScreen and AEEDeviceInfo.cyScreen.
And in javascript there is screen.width and screen.height.
The TrigML docs and examples did not seem to show any way to get the screen dimensions. Do we have to write our own actor to do this?
Thx
_

Hi,
Is there a way to get the screen width and height in TrigML or the "/sys" actor?
In BREW for example we get AEEDeviceInfo.cxScreen and AEEDeviceInfo.cyScreen.
And in javascript there is screen.width and screen.height.
The TrigML docs and examples did not seem to show any way to get the screen dimensions. Do we have to write our own actor to do this?
Thx
_

Admins, any answers?
If there's no way to get the width and height, this would be a good feature request.

Admins, any answers?
If there's no way to get the width and height, this would be a good feature request.

Hi Admins, any ideas on this?
If there's no way to get the width and height, this would be a good feature request.

Hi Admins, any ideas on this?
If there's no way to get the width and height, this would be a good feature request.

Hi
how can i read the screen size using trigml,or is it possible to get it from /sys actor?

Hi
how can i read the screen size using trigml,or is it possible to get it from /sys actor?

no there is not a call to make (that I know of) but with a little creative code, getting the screen size is a snap.
You can get the screen size by using two small images. One 10 pixels wide x 1 pixel high and the second 10 pixels high x 1 pixel wide.
You set the width (w) and height (h) to "_fill" and set the scale to "_keepaspect" like the code attached. Then you get the scalepercent and divide by the image size being scaled (10) {{/elem/scrwidth/scalepercent} div 10}
My test phone is a Samsung u520 with a listed screen size of 176x220 yet when I run this app I get 176x200. My phone is taking the top 20 pixels to display the current phone status.
Note: I did not do this but be sure to reload the layers empty to clear the images and release the resources. Also I used separate layers just for demonstration. You can use any layer.
Enjoy

no there is not a call to make (that I know of) but with a little creative code, getting the screen size is a snap.
You can get the screen size by using two small images. One 10 pixels wide x 1 pixel high and the second 10 pixels high x 1 pixel wide.
You set the width (w) and height (h) to "_fill" and set the scale to "_keepaspect" like the code attached. Then you get the scalepercent and divide by the image size being scaled (10) {{/elem/scrwidth/scalepercent} div 10}
My test phone is a Samsung u520 with a listed screen size of 176x220 yet when I run this app I get 176x200. My phone is taking the top 20 pixels to display the current phone status.
Note: I did not do this but be sure to reload the layers empty to clear the images and release the resources. Also I used separate layers just for demonstration. You can use any layer.
Enjoy