Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Automatic Screen Scaling — Gideros Forum

Automatic Screen Scaling

DRSDRS Member
edited December 2013 in General questions
Hello,
I have a problem with Automatic Screen Scaling on a Galaxy SIII with scalemode "letterbox"
The position of in this case textwrap2 is outside the box i want to place it in.
I also have this with the listview component.
What can i do?
I have attached an example screenshot of my phone.

Thanks in advance.
Screenshot_2013-12-11-14-12-06.png
720 x 1280 - 229K

Comments

  • @DRS yes letterbox scales to fit dimensions into the screen and leaves out the whitespaces.
    If you want to draw the line around whole screen together with whitespaces, you should use absolute positioning, which can be done by calculating offsets:
    http://appcodingeasy.com/Gideros-Mobile/Ignore-Automatic-Screen-Scaling-when-positioning-objects
  • DRSDRS Member
    edited December 2013
    Thanks for the reply
    I understand and have read this.
    Only this are two existing objects (shape & textwrap) and they go outside there boundaries.
    How can I solve that?
    I cannot trust the coordinates or am I missing something?
  • @DRS sorry I was very sleeping when I was writing it yesterday :D

    What I meant was, you can draw the shape around the test with offsets , like this:
    --calculating offsets
    local dx = application:getLogicalTranslateX() / application:getLogicalScaleX()
    local dy = application:getLogicalTranslateY() / application:getLogicalScaleY()
    local dwidth = dx + application:getContentWidth()
    local dheight = dy + application:getContentHeight()
     
    --draw shape with offsets
    local shape = Shape.new()
    shape:setLineStyle(1, 0x000000, 1)
    shape:beginPath()
    shape:moveTo(-dx,-dy)
    shape:lineTo(-dx, dheight)
    shape:lineTo(dwidth, dheight)
    shape:lineTo(dwidth, -dy)
    shape:lineTo(-dx, -dy)
    shape:endPath()
    stage:addChild(shape)
Sign In or Register to comment.