3

I am interested in LiveCodes Resolution Independence feature as, in the past, I have programatically had to resized my stack via the resizeStack handler.

I believe that you have to set the fullScreenMode with a given parameter e.g.

set the fullScreenMode of this stack to "exactFit"

Is this really all you have to do?

2 Answers2

4

You will be able to use fullScreenMode when you want your stack resized or scaled to take full advantage of the available screen that its been deployed too.

What this means is that, you create a stack at any size that you want, and then LiveCode automatically adjusts this to a given screen.

The main reason for the resolution independence feature is so you do not need to worry about the various sizes/dimensions of every mobile device that is available. This is especially useful when it comes to Android-

http://en.wikipedia.org/wiki/Comparison_of_Android_devices

An example of this in action is, when you deploy and non-retina iPhone sized stack (320 x 480 (3:2 aspect ratio) to a Galaxy S3 (1280 x 720) (16:9 aspect ratio).

As the aspect ratios do not match, then using “exactFit” will cause some elements to appear stretched/skewed, “letterBox” will add small black bars to top and bottom of screen, but aspect ratio will be kept in tact, “noBorder” will crop the stack and maintain aspect ratio however as cropping occurs some elements may be slightly cut and finally “noScale” centres the stack on screen with no scaling occurring.

The following is a great site for calculating the aspect ratios of a given resolution-

http://andrew.hedges.name/experiments/aspect_ratio/

and we also have a tutorial which explains how to use implement resolution independence here-

http://lessons.runrev.com/s/lessons/m/15262/l/156477-how-do-i-make-my-app-scale-to-fit-the-screen-on-all-devices

There are also the LiveCode release notes which explains the Resolution Independence features in more detail-

http://downloads.livecode.com/livecode/6_5_0/LiveCodeNotes-6_5_0.pdf http://downloads.livecode.com/livecode/6_5_1/LiveCodeNotes-6_5_1.pdf http://downloads.livecode.com/livecode/6_6_0/LiveCodeNotes-6_6_0_dp_1.pdf

Neil Roger
  • 681
  • 3
  • 6
2

The easiest way to use this feature is add it to your preOpenStack handler on your stack script:

on preOpenStack
   set the fullScreenMode of this stack to "exactFit"
end preOpenStack

The fullscreenmode can be set to any of the following values (taken straight from the LiveCode dictionary/API):

  • empty - The stack is resized (not scaled) to fit the screen. (default) This is the existing behavior.
  • exactFit - Scale the stack to fill the screen. This stretches the stack if the aspect ratio of the screen does not match that of the stack.
  • letterbox - Scale the stack, preserving the aspect ratio, so all content is visible. Some blank space may remain if the screen and stack aspect ratios do not match.
  • noBorder - Scale the stack to fill the screen, preserving the aspect ratio. If the stack and screen aspect ratios do not match, the left / right or top / bottom extremes of the stack are not visible.
  • noScale - The stack is not scaled, but is centered on the screen instead.
  • showAll - Scale the stack preserving aspect ratio so all content within the stack rect is visible. Portions of the stack outside the stack rect will be visible if the scaled stack does not fit the screen exactly.
Benjamin Beaumont
  • 910
  • 1
  • 6
  • 14