Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Cropping Question — Gideros Forum

Cropping Question

andybarillaandybarilla Member
edited March 2012 in General questions
I was playing around with the cropping settings and screen sizes and came up with a template as mentioned in another discussion (http://www.giderosmobile.com/forum/discussion/comment/3467#Comment_3467).

I'm not sure how the cropping is actually working though. I did a test with the following image. It uses this file: http://www.nevermorelabs.com/share/logoSplash.png and the code is nothing more than
stage:addChild(Bitmap.new(Texture.new("logoSplash.png")))
with cropping turned on and orientation set to landscape.

However, I get the following screenshots which show that the cropping isn't centered. I'm not sure if this is the intended behavior or not. If it is, can you let me know what the logic is behind it so I can make sure my bleed areas are setup correctly.

http://www.nevermorelabs.com/share/cropTest.png (480x320)
http://www.nevermorelabs.com/share/cropTest2.png (320x240)

Comments

  • atilimatilim Maintainer
    Hi,

    The size of your background image is 512x320. When I set the logical dimensions as 320x512 then cropping works well.

    But most probably you want to set your logical dimensions as 320x480. Then positioning the background image to (-16, 0) solves your problem:
    local bg = Bitmap.new(Texture.new("logoSplash.png"))
    bg:setPosition(-16, 0)
    stage:addChild(bg)
    Also there is another way. Center your bitmap by calling setAnchorPoint and position it at the center of your screen:
    local bg = Bitmap.new(Texture.new("logoSplash.png"))
    bg:setAnchorPoint(0.5, 0.5)
    bg:setPosition(480 / 2, 320 / 2)
    stage:addChild(bg)
    Or if you want to be more generic:
    local bg = Bitmap.new(Texture.new("logoSplash.png"))
    bg:setAnchorPoint(0.5, 0.5)
    bg:setPosition(application:getContentWidth() / 2, application:getContentHeight() / 2)
    stage:addChild(bg)

    Likes: andybarilla

    +1 -1 (+1 / -0 )Share on Facebook
  • I changed the logical dimensions to match the background image. I tried a bunch of resolutions and they all look perfect now.

    Thanks
Sign In or Register to comment.