Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Logical Size — Gideros Forum

Logical Size

paul_k_clarkpaul_k_clark Member
edited January 2013 in General questions
Hi, I am trying to use the logical height in drawing for my game but I get two different sizes. The code:


Screen = gideros.class(Sprite)
S_HEIGHT = application:getLogicalHeight()
function Screen:init(lvl)
print("application:getLogicalHeight()="..application:getLogicalHeight())
print("S_HEIGHT="..S_HEIGHT)


should print the same value for both prints but instead prints:


application:getLogicalHeight()=960
S_HEIGHT=480


The properties of my game specify the logical coordinates of 480x320

Any ideas?

Comments

  • BJGBJG Member
    edited January 2013 Accepted Answer
    When I run this code...
     
    Screen = gideros.class(Sprite)
    S_HEIGHT = application:getLogicalHeight()
    function Screen:init(lvl)
    print("application:getLogicalHeight()="..application:getLogicalHeight())
    print("S_HEIGHT="..S_HEIGHT)
    end
    s = Screen.new()
    ...it gives me two identical values; I haven't found how to make it fail like your example. Are you running the latest version...? Incidentally I thought gideros.class had been deprecated in favour of Core.class. You might also consider "getContent" instead of "getLogical" to take account of orientation.

    http://appcodingeasy.com/Gideros-Mobile/Difference-between-content-logical-and-device-dimensions-in-Gideros-Mobile
  • @BJG Thanks for that. I created a new project and the results were identical. After searching around my code I found a "setLogicalDimensions" statement which was setting it. Don't know when I put that in there :).
Sign In or Register to comment.