LucaMs Expert Licensed User Longtime User Mar 31, 2018 #1 Probably I forgot how to use the module Scale. Starting from this example layout (variant 480x320-1): On my tablet (1280x800-1): Code used (no scripts): Code: Activity.LoadLayout("Lay1") ' Scale.Rate = 0.3 Scale.Initialize Scale.ScaleAll(Activity, True) Why Button2 is not placed correctly? Attachments ModScaleTest.zip ModScaleTest.zip 14.1 KB · Views: 606
Probably I forgot how to use the module Scale. Starting from this example layout (variant 480x320-1): On my tablet (1280x800-1): Code used (no scripts): Code: Activity.LoadLayout("Lay1") ' Scale.Rate = 0.3 Scale.Initialize Scale.ScaleAll(Activity, True) Why Button2 is not placed correctly?
LucaMs Expert Licensed User Longtime User Mar 31, 2018 #2 In the project I wrote also: Code: ' *** Code below "works". Activity.LoadLayout("Lay2") Scale.SetReferenceLayout(1280,800,1) but this is wrong; it works because I tested the layout on a device with the same resolution and density of the layout. On another device, 800x480-1.5 it looks so: Note also the strange "color" of buttons (I have not set colors). Upvote 0
In the project I wrote also: Code: ' *** Code below "works". Activity.LoadLayout("Lay2") Scale.SetReferenceLayout(1280,800,1) but this is wrong; it works because I tested the layout on a device with the same resolution and density of the layout. On another device, 800x480-1.5 it looks so: Note also the strange "color" of buttons (I have not set colors).
klaus Expert Licensed User Longtime User Mar 31, 2018 #3 You should NOT use anchors nor any designer scripts these will alter the scale function. SacleAll is the same as %x and %y. Remember, the Scale module was written before anchors did exist. Upvote 0
You should NOT use anchors nor any designer scripts these will alter the scale function. SacleAll is the same as %x and %y. Remember, the Scale module was written before anchors did exist.
LucaMs Expert Licensed User Longtime User Mar 31, 2018 #4 klaus said: You should NOT use anchors Click to expand... Well, I cannot exclude anchors totally; I have reset the default anchors for Button2 (and removed the script for Label1) but now the result is: Code: Activity.LoadLayout("Lay1") ' Scale.Rate = 0.3 Scale.Initialize Scale.ScaleAll(Activity, True) Last edited: Mar 31, 2018 Upvote 0
klaus said: You should NOT use anchors Click to expand... Well, I cannot exclude anchors totally; I have reset the default anchors for Button2 (and removed the script for Label1) but now the result is: Code: Activity.LoadLayout("Lay1") ' Scale.Rate = 0.3 Scale.Initialize Scale.ScaleAll(Activity, True)
klaus Expert Licensed User Longtime User Mar 31, 2018 #5 Sorry, for an %x and %y scaling, on tablets, you need to set Scale.Rate = 1. If you use a ScaleRate less than 1 you need to reposition the views. Or put the layout onto a Panel and center this one. It's quite some time time that I hadn't have a look the this module. Upvote 0
Sorry, for an %x and %y scaling, on tablets, you need to set Scale.Rate = 1. If you use a ScaleRate less than 1 you need to reposition the views. Or put the layout onto a Panel and center this one. It's quite some time time that I hadn't have a look the this module.