Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Understanding Letterbox Scalling
Started by RicardoGraca Mar 12 2012 03:03 AM

- - - - -
91 replies to this topic
[TOPIC CONTROLS]
Page 3 of 4 1 2 3 4
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#51

RicardoGraca

[GLOBAL: userInfoPane.html]
RicardoGraca
  • Contributor

  • 190 posts
  • Corona SDK

It happens on the actual device. Funny thing is that all other directions work fine.
uid: 61899 topic_id: 23200 reply_id: 116850

  • dodi_games likes this

[TOPIC: post.html]
#52

thedavebaxter

[GLOBAL: userInfoPane.html]
thedavebaxter
  • Contributor

  • 559 posts
  • Corona SDK

What a fantastic thread, thanks CluelessIdeas.

This subject has always confused me but it just clicked after reading your post.

Dave
uid: 117617 topic_id: 23200 reply_id: 118488


[TOPIC: post.html]
#53

chris.l.frederick

[GLOBAL: userInfoPane.html]
chris.l.frederick
  • Enthusiast

  • 35 posts
  • Corona SDK

I don't understand how this forum topic/method can be stickied considering that this implementation has a pretty major bug; parts of the screen don't respond to touch events. Any update on this?
uid: 60707 topic_id: 23200 reply_id: 120423


[TOPIC: post.html]
#54

nglenister

[GLOBAL: userInfoPane.html]
nglenister
  • Enthusiast

  • 38 posts
  • Corona SDK

Hi!

Excellent post!!

I was wondering what your thoughts are with regards to sprite resizing? Given that dynamic resizing won't work for animated sprites, is there a recommended way of dealing with them? At the moment my background images look perfect on iPad retina but the sprites look crap?

Neil
uid: 173326 topic_id: 23200 reply_id: 122263


[TOPIC: post.html]
#55

nglenister

[GLOBAL: userInfoPane.html]
nglenister
  • Enthusiast

  • 38 posts
  • Corona SDK

Hi!

Excellent post!!

I was wondering what your thoughts are with regards to sprite resizing? Given that dynamic resizing won't work for animated sprites, is there a recommended way of dealing with them? At the moment my background images look perfect on iPad retina but the sprites look crap?

Neil
uid: 173326 topic_id: 23200 reply_id: 122264


[TOPIC: post.html]
#56

nglenister

[GLOBAL: userInfoPane.html]
nglenister
  • Enthusiast

  • 38 posts
  • Corona SDK

Hi!

Excellent post!!

I was wondering what your thoughts are with regards to sprite resizing? Given that dynamic resizing won't work for animated sprites, is there a recommended way of dealing with them? At the moment my background images look perfect on iPad retina but the sprites look crap?

Neil

P.S Sorry about the spam posting above! Accident and I can't delete them :/
uid: 173326 topic_id: 23200 reply_id: 122265


[TOPIC: post.html]
#57

thedavebaxter

[GLOBAL: userInfoPane.html]
thedavebaxter
  • Contributor

  • 559 posts
  • Corona SDK

Am testing my app on a Nexus 7 (works fine on iOS) and place my buttons using -

Main.lua -
local storyboard.globals.topY = display.screenOriginY

In my button code I use -
pencilButton.y = storyboard.globals.topY + 20

On all iOS devices the button is fine but on the Nexus 7 the button is off the top of the screen.

EDIT: Ignore this, it all works fine. For some reason the Nexus was installing a old version.

Dave
uid: 117617 topic_id: 23200 reply_id: 123245


[TOPIC: post.html]
#58

Alyousef

[GLOBAL: userInfoPane.html]
Alyousef
  • Enthusiast

  • 55 posts
  • Corona SDK

Awesome post! I really appreciate it :)

~ShiaDev
uid: 147340 topic_id: 23200 reply_id: 132303


[TOPIC: post.html]
#59

trickster_boi

[GLOBAL: userInfoPane.html]
trickster_boi
  • Observer

  • 11 posts
  • Corona SDK

Does this only apply to backgrounds? What about buttons? :S
uid: 184921 topic_id: 23200 reply_id: 137119


[TOPIC: post.html]
#60

jollzy

[GLOBAL: userInfoPane.html]
jollzy
  • Observer

  • 27 posts
  • Corona SDK

Hi rxmarccall

https://www.dropbox.com/s/mmlfxont1uo5oqj/UniversalBuildSkeleton.zip
I think the above link is no longer works can you re-post it some where?

Thanks
uid: 115578 topic_id: 23200 reply_id: 142491


[TOPIC: post.html]
#61

rxmarccall

[GLOBAL: userInfoPane.html]
rxmarccall
  • Contributor

  • 751 posts
  • Corona SDK

@jollzy,
Sorry that file is missing, I cleaned out my dropbox a few months back and can't seem to find it anymore. Maybe @RSCdev still has a copy of it around? If not I can make another one, it's not too hard I just don't have the time at the moment. I will; get to it if he doesn't have a copy!
uid: 19620 topic_id: 23200 reply_id: 142514


[TOPIC: post.html]
#62

nglenister

[GLOBAL: userInfoPane.html]
nglenister
  • Enthusiast

  • 38 posts
  • Corona SDK

@jollzy @rxmarccall I still have a copy of it. Hopefully this works: https://www.dropbox.com/s/82x2akdf0wixiea/UniversalBuildSkeleton.zip
uid: 173326 topic_id: 23200 reply_id: 142517


[TOPIC: post.html]
#63

nglenister

[GLOBAL: userInfoPane.html]
nglenister
  • Enthusiast

  • 38 posts
  • Corona SDK

Also, don't forget, that template works nicely for iPhone 5 res, however, you'll need to add a "Default-568h.png" 640x1136 to your root directory otherwise you'll get a letterbox effect. I'd also recommend using this for your config file: http://www.coronalabs.com/blog/2012/12/04/the-ultimate-config-lua-file/
uid: 173326 topic_id: 23200 reply_id: 142518


[TOPIC: post.html]
#64

jainteq

[GLOBAL: userInfoPane.html]
jainteq
  • Observer

  • 8 posts
  • Corona SDK

I'm highly impressed to see the comprehensive resources being offered by you.



[TOPIC: post.html]
#65

apilling63

[GLOBAL: userInfoPane.html]
apilling63
  • Enthusiast

  • 34 posts
  • Corona SDK

so glad I found this post. +1



[TOPIC: post.html]
#66

Hendrix000007

[GLOBAL: userInfoPane.html]
Hendrix000007
  • Contributor

  • 177 posts
  • Corona SDK

thanx for a real deep expl. of letterbox Ricardo

[TOPIC: post.html]
#67

thedavebaxter

[GLOBAL: userInfoPane.html]
thedavebaxter
  • Contributor

  • 559 posts
  • Corona SDK

For iPhone 5, I had to change -

 

bottomY = display.contentHeight - display.screenOriginY

 

To -

 

bottomY = 568

 

Basically if it's a iPhone 5 I use the number 568 instead, this seems to work fine so far for me.

 

Dave



[TOPIC: post.html]
#68

Tim @ Playful Media

[GLOBAL: userInfoPane.html]
Tim @ Playful Media
  • Observer

  • 21 posts
  • Corona SDK

Here is a handy screen size and resolution reference for most of the devices out there.

 

http://screensiz.es



[TOPIC: post.html]
#69

jainteq

[GLOBAL: userInfoPane.html]
jainteq
  • Observer

  • 8 posts
  • Corona SDK

Your provided best information for my work it is cool thanks

 

 
Thanks and Kind Regards,
Jainteq


[TOPIC: post.html]
#70

evidence

[GLOBAL: userInfoPane.html]
evidence
  • Enthusiast

  • 83 posts
  • Corona SDK

Hi,

 

Just out of curiosity, doesn't a resolution of 360 by 570 go against the texture optimization suggestions located here. Would 360 by 512 not be a better idea, and just suffer the black lines at the top/bottom of the screen on high devices?

 

Going from 1MB to 2MB in texture memory for 58 pixels; is it a good trade?



[TOPIC: post.html]
#71

Tim @ Playful Media

[GLOBAL: userInfoPane.html]
Tim @ Playful Media
  • Observer

  • 21 posts
  • Corona SDK

evidence - The black bars (letterbox) is frowned upon now and in some cases will not be approved. Aside from that, why wouldn't you want to give the user the best experience possible. The devices that have larger screens have them for a reason so why not use them? Imagine if every app had black bars because of texture space, what would be the point of having a larger screen?

 

If texture space / size is very crucial then my suggestion is that you create the image at 360 x 570 as a master file but save it out as 360 x 512. This will squish the image in one direction and look odd when you view the image directly but when the app scales it back out to 360 x 570 it will look normal. Scaling in one direction often produces results far better than scaling in both directions and if you run a test, I bet 9/10 times you will not really see a difference on the device. Try it :)



[TOPIC: post.html]
#72

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,205 posts
  • Enterprise

You could make your backround 323x512 and load it as 360x570.  It will scale up some and not be quite as sharp, but it would keep your texture on a 512  boundary.

 

But given most of the times you need this, it's a background image.  Most scenes only have one full screen image loaded at once, it's not going to kill your memory usage.  Now if you have a photo slide show and you're loading a couple of dozen full screen photos at once, then you might have some memory problems.


  • elifares likes this

[TOPIC: post.html]
#73

evidence

[GLOBAL: userInfoPane.html]
evidence
  • Enthusiast

  • 83 posts
  • Corona SDK

Tim, providing the best user experience is what I am aiming for i.e. preventing low memory warnings. I will try this scaling and see how it looks.

 

Just for consideration I made this graphic to illustrate the amount of texture memory used for each resolution. http://img46.imageshack.us/img46/3064/n8tc.png

 

Blue is for iphone, phone 4 and iphone 5. Green is for Samsung Galaxy S2, S3 and S4. Black is the amount of texture memory required after an image is scaled up.

 

As you can see, to support the S4 you need 2048 x 2048 x 4(rgb+a) = 16MB of texture memory for one background image.



[TOPIC: post.html]
#74

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,205 posts
  • Enterprise

@evidence, "best user experience" is an open ended desire.  Lower quality images to save some texture memory may not be the best user experience if your app doesn't look good.   There are probably other ways to optimize image than worry about a few background images.



[TOPIC: post.html]
#75

evidence

[GLOBAL: userInfoPane.html]
evidence
  • Enthusiast

  • 83 posts
  • Corona SDK

On the flip side your app can be the most beautiful work of art on the planet, but it wont matter much if it crashes with low memory warnings every 5mins. As you said perhaps only an issue in certain situations e.g. a photo flip book, but I thought it was worth pointing out that staying within the texture boundary was not my idea; It is part of the Corona documentation. That said the scaling up method is also mentioned as a work around in the same document.




[topic_controls]
Page 3 of 4 1 2 3 4
 
[/topic_controls]