Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Change Letterbox White Bars to Black — Gideros Forum

Change Letterbox White Bars to Black

MillerszoneMillerszone Member
edited September 2011 in General questions
Is it possible to change the Letterbox White bars to black?
Actually I would always like to keep the background black when using Scaling.

Thank you.
Mike

Sample picture(you can see the top and bottom letterbox white bars):

Comments

  • atilimatilim Maintainer
    Next version will come with Stage:setBackgroundColor and Stage:getBackgroundColor (which will be released in about 2 weeks)

    Before waiting for the next version, you can keep your image a bit larger to fill the empty areas or you can add a large solid rectangle with Shapes like:
    -- assume your logical dimensions are 320x480 and your stage orientation is portrait
    local background = Shape.new()
     
    background:setFillStyle(Shape.SOLID, 0xff0000) -- fill color is red
    background:beginPath()
    background:moveTo(-100, -100)
    background:lineTo(320+100, -100)
    background:lineTo(320+100, 480+100)
    background:lineTo(-100, 480+100)
    background:closePath()
    background:endPath()
     
    stage:addChild(background)

    Likes: Learner

    +1 -1 (+1 / -0 )Share on Facebook
  • Worked great. I was using landscape, so had to change a few numbers.

    Thank you.
Sign In or Register to comment.