Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
API: Orientation of getLogicalWidth() and friends — Gideros Forum

API: Orientation of getLogicalWidth() and friends

StoffeStoffe Member
edited November 2011 in Roadmap
First off, I can see both sides of this and that there is a point to always assume portrait mode so we always know what to expect from a function call. On the other hand, my application is in landscape mode and everything in it also uses landscape coordinates, which means that getLogicalWidth(), getDeviceWidth() etc needs to switch places. I've even added my own Application:getWidth() and getHeight() that switches this, along with some functions that returns actual device width.

What I am thinking about is either to take into consideration if the app is portrait or landscape, or possibly that it would at least be configurable which is width and which is height. It really messes with my head to have two different coordinate systems.
Tagged:

Comments

  • atilimatilim Maintainer
    One possibility can be adding new functions besides the current ones (as you've done) to get swapped values automatically if the orientation is landscape. Also after I read your post, I realized that our SceneManager has this problem currently which means It's easy to make mistakes with the current behavior :)

    I'll add these functions with the next version, thank you for the suggestion.

  • chipster123 & I are using this in "init.lua" as a temporary workaround for our landscape project:

    application.originalGetLogicalWidth = application.getLogicalWidth
    application.getLogicalWidth = function(self)
    return self:originalGetLogicalHeight()
    end

    application.originalGetLogicalHeight = application.getLogicalHeight
    application.getLogicalHeight = function(self)
    return self:originalGetLogicalWidth()
    end

    Likes: atilim

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.