Building for different orientations

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Building for different orientations

Post by Traxgeek » Sun Dec 07, 2014 4:21 pm

May I ask before I begin please ?

I have built a mobile app in portrait mode. It can flip between 'right way up' and 'upside down' with no problems (clever LC !) BUT, for the moment, I have inhibited landscape mode.
Now I have the basics of my app running pretty bug-free I'm keen to try to get it to work in landscape too... so, to my question (before I begin and commit to the wrong idea from day 1)...

I guess there are (as always) many ways to handle this - it's simply understanding the 'norm' / best way (if there is one) / advantages / disadvantages of each method...
I have thought of 2 ways / methods :

Method 1
Use maths to physically re-jig the screen controls to suit the different aspect ratios
Advantage : each user control only exists once which I guess cuts down on both script size and overall app size. Debugging is simpler
Disadvantage : the math required at the outset to re-design the screen layout
Question : Does one simply undertake the resize math on detecting a screen orientation change (app becomes sluggish/noticeable slower on resize ?) or is this undertaken some other way / some other time ?

Method 2
Create two cards (one portrait and one landscape) for each app 'page' / screen view and display the correct card for the current orientation
Advantage : really simple to check / design. No math required meaning it's not necessary to deploy and try on your mobile device each time one THINKS the layout may be correct
Disadvantage : overhead. Basically controls / cards are duplicated - increasing app size. What to do about control specific scripts ? - duplicate them with each duplicated control OR move them to card level scripts and call them as required ?

Method 3
Some other method I've not thought of ? ? ?

I guess some of the decision will be based upon the number of controls per card. In my case between 20 and 100. And, maybe, the 'type' of controls - e.g. : 3 of the 6 cards I have use 1 or more datagrids.

Would anyone who's used to doing this kind of stuff give me some 'starters-for-ten'-advice/thoughts/pitfalls-to-beware-of/things-to-consider-before-starting please ?

AS always, thanks for sharing. Much appreciated.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”