Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Getting device screen resolution — Gideros Forum

Getting device screen resolution

cstogiancstogian Member
edited January 2013 in General questions
Hello,
I am trying to obtain the resolution of the device. There was a thread some time ago mentioning that you can do this with application:getHardwareWidth() and application:getHardwareHeight(), however these give me the compiler error "attempt to call method 'getHardwareWidth' (a nil value)". Is there any way to determine the screen resolution of the device?
Thank you.

Comments

  • twisttaptwisttap Member
    edited January 2013 Accepted Answer
    @cstogian Check the Gideros Reference Manual here: http://www.giderosmobile.com/documentation/reference_manual.html#Application:getLogicalWidth

    also if you are lazy enuf, you can check this :)
     
    print( " Logical Width ".. application:getLogicalWidth() )
    print( " Logical Height ".. application:getLogicalHeight() )
    print( " Device Width ".. application:getDeviceWidth() )
    print( " Device Height ".. application:getDeviceHeight() )
    print( " Application Dimensions ".. application:getContentWidth() .."x".. application:getContentHeight() .." px" )
  • Thanks, getDeviceWidth and getDeviceHeight are what I need. That thread with getHardwareWidth threw me off the track.
Sign In or Register to comment.