How to "re-resize" Stack (elements)

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: FourthWorld, heatherlaine, Klaus, kevinmiller

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9853
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to "re-resize" Stack (elements)

Post by FourthWorld » Tue May 31, 2022 7:45 pm

When pursuing scaling, consider the impact on appearance of standard controls.

If you make a layout for a 4" phone and run it on an 11" tablet, buttons designed to be the expected size for a thumb become large enough for a fist.

If you're in a position to exclude some screen sizes from your distribution this won't matter as much. But with the full range of screens people use it might.

And then there's the question of screen ratio, esp with orientation change. Again, if you're in position to restrict the user rotating their device while using your app it may not matter. But given how often tablets are used in landscape and phones in portrait, it's worth thinking about.

Perhaps the best way to make layout decisions is to look at the apps you already have on your phone.

Find apps that have functionality and/or layouts similar to what you envision for yours, and see how those designers have made their layout decisions. Run the app on small and large devices, noting what gets scaled, what gets resized, and what gets repositioned. Also rotate your phone and see how the app's layout responds to the new screen dimensions.

LiveCode is flexible enough to handle a wide range of layout options. The hardest part isn't implementing any of them, but choosing which to use.

Let the apps you're already enjoying being your guide to good design.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bwmilby
Posts: 454
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: How to "re-resize" Stack (elements)

Post by bwmilby » Tue May 31, 2022 8:00 pm

@Richard You are correct in general, but for this specific use case I think the solution needed is just being able to shrink due to the pixel size difference between monitors.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9853
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to "re-resize" Stack (elements)

Post by FourthWorld » Tue May 31, 2022 8:02 pm

bwmilby wrote:
Tue May 31, 2022 8:00 pm
@Richard You are correct in general, but for this specific use case I think the solution needed is just being able to shrink due to the pixel size difference between monitors.
Perhaps it is. I'm unfamiliar with the details of how the app is intended to be used.

Where scaling produces results like those we see in similar apps, it's probably a good choice.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

redfield
Posts: 95
Joined: Thu Apr 04, 2019 1:41 pm

Re: How to "re-resize" Stack (elements)

Post by redfield » Wed Jun 01, 2022 10:54 am

bwmilby wrote:
Tue May 31, 2022 8:00 pm
... but for this specific use case I think the solution needed is just being able to shrink due to the pixel size difference between monitors.
Yes that's correct:
redfield wrote:
Sun May 22, 2022 7:34 pm
Is there a common way in Livecode to adjust windows (and their contents) of Desktop apps, according to the screen size?
However the kind of scaling I am aiming at seems to be too complicated or at least not achievable with the GM. I guess I will create two Stacks, one that looks "good" on a high resolution monitor and one for a lower resolution monitor, and let the user choose.

stam
Posts: 2741
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: How to "re-resize" Stack (elements)

Post by stam » Wed Jun 01, 2022 1:02 pm

It’s a good guess that what you want to achieve is doable through the GM and resizeStack handlers.

But no one can help unless you provide a visual cue as to what the result you’re after actually is.
At this point everyone trying to help is just guessing as to what “the kind of scaling you’re aiming at” actually is.

If you’re looking to resize both text size and field size, that is again very doable but needs extra work (although can be abstracted to a behaviour). Otherwise it’s a good educated guess that using the methods mentioned above can provide dynamic scaling you’re after.

As Richard suggested, what don’t you just provide an image or stack to illustrate what you’re after, and I’m sure you’d receive several more than a couple of recommendations on how to implement….

bwmilby
Posts: 454
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: How to "re-resize" Stack (elements)

Post by bwmilby » Wed Jun 01, 2022 1:51 pm

Profiles may be another option although the IDE does not really support their use in the GUI. You didn’t mention if you tried the scale option.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7257
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: How to "re-resize" Stack (elements)

Post by jacque » Wed Jun 01, 2022 5:18 pm

Since this is for desktop, do try Brian's suggestion and see how scalefactor works for you. If your stack has images I'd start with a layout that looks good at high resolution since scaling down usually looks better than scaling up.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9853
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to "re-resize" Stack (elements)

Post by FourthWorld » Wed Jun 01, 2022 5:33 pm

redfield wrote:
Wed Jun 01, 2022 10:54 am
I guess I will create two Stacks, one that looks "good" on a high resolution monitor and one for a lower resolution monitor, and let the user choose.
Ah, thank you. I understand now: the problem isn't that your objects need to move, but simply that LiveCode needs to provide resolution independence on the desktop as it has on mobile for years.

Hi-res monitors have been around for a while now. If LC isn't providing resolution independence automatically on Windows that should be a bug report.

In the meantime, the suggestions for scaleFactor are the best workaround.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”