“Toto, I have a feeling we’re not in Corona anymore.”
Inspired by the 1939 movie, The Wizard of Oz.
Hello, Solar2D world!
The issues occupying my mind today concern not developing in the standard 320pt x 480pt content area, and, instead defining an 800pt x 1200pt content area (landscape: 1200w x 800h).
“I would still set your config.lua to 320 and 480”
’The’ Rob – commenting on the usage of the Ultimate config.lua
“This needs to be the very first decision you make when deciding what to do.”
’The’ Rob – commenting on choosing a dynamic or fixed config.lua
-- config.lua
application = {
content = {
width = 800,
height = 1200,
scale = "letterbox",
xAlign = 'center',
yAlign = 'center',
},
}
-- build.settings
settings = {
orientation =
{
default = "landscapeRight",
supported = { "landscapeRight", "landscapeLeft" },
},
}
Admittedly, I was entirely influenced to use a content area of 800pt x 1200pt
by the suggestion to modernize the 320pt x 480pt content area.
(Thanks to Rob and Brent apparently)
Even though, however, that there have also been suggestions to stick with the standard 320pt x 480pt content area. (Thanks! Rob and Brent!)
After I had chosen 800pt x 1200pt, I began to have doubts,
because I had heard rumors about unpredictable widgets.
I thought to myself,
Weren’t widgets in the movie, The Wizard of Oz?
![]()
I have read that a content area of 800pt x 1200pt is handy
in that both width and height are each evenly divisible by 2.
Apparently, more importantly, its usage was an attempt to steer new developer’s minds away from thinking in terms of actual screen ‘pixels’; and rather, as a scalable ‘point’ system during game/app development, aka ‘Corona Units’.
I’m trying to pay attention in class! – Spoiler alert! Foreshadowing.
Now, not that it matters, while both dimensions are evenly divisible by two,
its aspect ratio 1200/800 is (1.5 to 1) and not (2 to 1)
the same as the standard config.lua content area. 320x480.
I can understand (and accept) that it does not matter if the aspect ratio is two or not.
It would just feel good (to me) if my aspect ratio was two to one.
Now, I also read that the original 320pt x 480pt content area was still preferred by both Apple and Android. But, maybe times have changed things?
Continuing my research, RoamingGamer had discussed replacing the 380pt x 570pt background with 720pt x 1386pt as a recommended background.png for a ‘modernized’ background that kept black bars non existent on even taller phones.
And, Rob had discussed the 900pt x 1425pt as a recommended background for a content area of 800pt x 1200pt.
(Though I am thinking 900x1425 was recommended prior to the release of taller phones?)
Standing on the shoulders of giants,
I decided to turn my attention on those two backgrounds to tinker with a bit.
After comparing the two background dimensions with 800x1200,
I came up with my own background size of 900pt x 1860pt corona units.
Though, I feel I may have gone way out on a limb and taken things to the extreme?
Pun intended!
And, not that it matters, but, one reason 900x1860 appeals to me
(aside from fully covering tall device screens in the simulator anyway, is simply the aspect ratio.
1860/900 = 2.066666666666667
Note: I became aware that even on taller phones,
there are (far left and far right) areas of my 1860w (landscape) background.png
that will (bleed) ie. never-ever display;
unless of course, an even taller-more-narrow device is designed.
Perhaps the aspect ratio of the base-width and height of the Washington Monument!?
Regardless, according to the solard2D simulator, on all available virtual devices,
using my background.png of 1860x900, there are absolutely zero black bars.
Perfect!
Now, aside from possibly wasting a bit of texture memory,
ie. by having this extraneous pixel area that never-ever shows,
I see no major issue with this unused portion of the background.png,
but what do I know? I do not have a computer science degree. ![]()
Also, at this time, I can not discern if 2.066666666666667 is a good aspect ratio or not.
Perhaps it’s a nightmare waiting to pounce, like a cowardly lion!
“Put’em up! Put’em up!”
The Cowardly Lion
Or, maybe it does not matter at all?
– Disclaimer:
Don’t let my number-tinkering fool you.
I am not a math.wiz() at all.
I cheated all through high school Algebra! – Note: Still foreshadowing
So, what I mean is that deriving my own background.png
(in hopes of wiping black bars off of the screen)
did not come easy for me.
And, more importantly, behind the scenes, I do not know how solar2D deals with rounding.
Actually, now that I give it another thought, it must be entirely up to me.
-- Returns the integer 'larger' than or equal to x
-- math.ceil( x )
math.ceil( 2.066666666666667 ) -- question: this returns 2?
-- Returns the integer 'smaller' than or equal to x.
-- math.floor( x )
math.floor( 2.066666666666667 ) -- question: this returns 2 too? ;)
When comparing the aspect ratio of 1386/720
with the aspect ratio of 1860/900 they seemed close enough.
Not that I was on the verge of discovering some great mathematical enigma
like the Golden Ratio!, but, I felt I had my own Eureka moment, nonetheless!
So, I jumped out of the tub and dripped dried
while bathing in my mathematical accomplishment!
Not that this near-deuce-duo has anything to do with anything at all.
But, here it is.
1386/720 = 1.925
1860/900 = 2.066666666666667
Again, I do not know if one or the other is any better off; or if it even matters at all.
Fords and Chevys, right?
I drive a Toyota.
But, 2.066666666666667 just seems more closer to whole to me;
even with that 0.066666666666667 lingering in the Ether.
Just to feel genius, and to brush up on my mental arithmetic:
0.066666666666667 + 0.925 = 0.991666666666667
Darn, and I thought it was going spit out a smooth and cool numeral UNO!
At any rate, I think I may be splitting hairs.
And the take away is, existence is a messy place.
And never perfect! So, it seems it does not matter.
– Disclaimer
I claim to know just barely enough to be unharmingly-dangerous to myself!
The second reason the background.png of 1860pt x 900pt appealed to me,
other than the fact that it was inspired by both the
900pt x 1425pt and 720pt x 1386pt collectively,
is that each dimension is also evenly divisible by two.
1860 / 2 = 930
900 / 2 = 450
Again, this probably has nothing to do with anything.
And it just sits ‘nearly’ nice and neat (and square enough) in my mind.
Perfect!
Unpredictable Widgets
“Ding! Dong! The Witch is dead!”
Widgets have been haunting me ever since I have heard about these little buggers here on the forum.
Fortunately, for me, I have only needed the use of the widget.newButton().
But, as I have only seen my game on the solar2D simulator,
I have no idea if there is a device nightmare waiting for me when I see my button widgets scaling or
positioning themselves in unpredictable ways on actual devices;
that is, due to my choosing a content area other than 320pt x 480pt as suggested.
Now, I do recall reading that only “certain” widgets cause issues on varying devices when scaling.
And I am holding my breath hoping that button widgets
are immune to such unpredictable, flying-monkey
behavior.
Again, I am sharing my approach/understanding hoping someone will point out any issue I may be oblivious to.
Other than my obsession with quoting movies!
Thanks for putting up with it.
It is not lost on me that you are still here.
In conclusion, in the config.lua file I have set my content area to 800pt x 1200pt in corona units,
as well as set my game up to display in landscape orientation (1200w x 800h),
and, designed a custom background.png (just a bit larger than the content area) at 1860pt x 900pt corona units, to deal with the resulting black bars due to the Scale Mode that I have chosen, namely, ‘letterbox’.
To be clear, if not redundant!
-
Since I am not using the standard 320pt x 480pt content area,
can I expect my widget.newButton() to misbehave? -
Also, can I safely use 1860pt x 900pt as my current cure all background.png;
that is, for a content area defined as 800pt x 1200pt?
“I could think about things I never thunk a thought before.”*
The Scarecrow
“Some people without brains do an awful lot of talking, don’t they?”
The Scarecrow
“It looks like we came a long way for nothing.”
The Scarecrow
“There’s no place like home.”
Dorthy
“I’ll get you, my pretty, and your little dog, too!”
The Wicked Witch
Thanks for your time.
I hope this post at least got a chuckle out of ya!
I appreciate you reading it.
And any suggestions you have.
I sprinkled a bit of ‘comedy relief’ throughout this verbose post
…to make it worth your time?
I’ve always unwittingly been the class clown.
Except now, as an adult, I can’t cheat off of the chics sitting next to me!
I’m glad I have this forum though.
I’ve been eavesdropping for the past 7 months,
and I’ve been waking up in the online documentation.
True story…
At my first class reunion, two female classmates came up to me,
and told me that the teacher had encouraged them both to help me pass the class!
Let’s just say, I came across a bit distracted.
I had ‘mostly’ one thing on my mind back in the day.
DRUMS! DRUMS! DRUMS!
And, having long hair, (still do) I could hide my (1980’s) walk-man ear-buds from the teacher,
and jam out in class to the likes of Metallica, Master of Puppets on cassette tape.
After all these years, it sure feels good to still be young…
…at heart!
I jam on Sinatra too!
Footnote1:
For learning purposes, I intentionally alter the ordering of 800x1200 with 1200x800 and 900x1860 with 1860x900 to remind myself that even though I am designing my game for landscape only, ie. 1200w x 800h, the width and height must be defined as 800pt x 1200pt in the config.lua file,
and not 1200pt x 800pt.
Footnote2:
Also, for my own sake, I make an effort to remind myself that I am using ‘corona units’
and not pixels-per-se when developing my game.
I can’t wait to see my report card
…for once.
“You’re still here? It’s over! Go home! Go.”
Ferris Bueller
Thanks!
CG
“Tell me when it’s over.”
The Cowardly Lion