fitting to screen size
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
fitting to screen size
I tried to scale a stack but it seemed to remain at 1.0 even though I tried 0.3
How do you cater for different sizes?
How do you cater for different sizes?
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: fitting to screen size
Well?
1. To size a stack to take up a whole screen is easy
(although people may get a bit miffed about your covering start bars and so on):
2. To resize a stack and preserve the positions of the objects on the stack means
messing around with the GEOMETRY MANAGER
which, personally, I would not go near with a 10 foot pole.
1. To size a stack to take up a whole screen is easy
(although people may get a bit miffed about your covering start bars and so on):
Code: Select all
on openStack
put item 3 of the screenRect into WW
put item 4 of the screenRect into HH
set the width of this stack to WW
set the height of this stack to HH
set the topleft of this stack to 0,0
end openStack
messing around with the GEOMETRY MANAGER
which, personally, I would not go near with a 10 foot pole.
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: fitting to screen size
If you wish to resize a stack in another way than using screenRect then you can do this sort of thing:
OR, if you want to be "a bit more clever" do something like this:
Code: Select all
on mouseUp
set the width of this stack to 400
set the height of this stack to 600
end mouseUp
Code: Select all
on mouseUp
put the width of this stack into WW
put the height of this stack into HH
put (HH * 0.3) into HH
put (WW * 0.3) into WW
set the width of this stack to WW
set the height of this stack to HH
end mouseUp
-
- Posts: 746
- Joined: Sun Feb 04, 2007 11:01 pm
- Location: McKenna, WA
Re: fitting to screen size
If you're writing a mobile app try this.
Also look up fullscreenmode in the dictionary.
Also look up fullscreenmode in the dictionary.
Code: Select all
on preOpenStack
if environment() is not "mobile" then exit to top
set the fullscreenmode of this stack to "exactFit"
end preOpenStack
Tom
MacBook Pro OS Mojave 10.14
MacBook Pro OS Mojave 10.14
Re: fitting to screen size
Thank you both for the excellent help. I will be exploring the scripts and read up the code in the dictionary.
I did a search here about screen sizing, before I posed my question and it did not look promising. I was not keen on spending lots of time hunting for an answer that did not exist, so asking for help proved to be the best solution.
I did a search here about screen sizing, before I posed my question and it did not look promising. I was not keen on spending lots of time hunting for an answer that did not exist, so asking for help proved to be the best solution.
-
- VIP Livecode Opensource Backer
- Posts: 9802
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: fitting to screen size
The stack will automatically fill the screen, and LC's resolution independence generally allows us to never have to think about pixel density except in very specialized cases.
Can you tell us more about the problem you're trying to solve?
Can you tell us more about the problem you're trying to solve?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: fitting to screen size
You might be jumping to conclusions as ajperks has notThe stack will automatically fill the screen
stated whether s/he is programming for desktop computers or handheld devices.
Re: fitting to screen size
Since this is the ANDROID forum, I think we can presume this without problems.richmond62 wrote: ↑Thu Jul 26, 2018 5:20 pmYou might be jumping to conclusions as ajperks has not
stated whether s/he is programming for desktop computers or handheld devices.
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: fitting to screen size
Also, when using fullscreenmode, try all the different mode options. Some will work better than others depending on the stack layout. I usually find showAll or noBorder to work best on mobile.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: fitting to screen size
No doubt . . .Since this is the ANDROID forum
BUT as I saw it in the "New posts" section . . .
Re: fitting to screen size
Well, obviously some people can type faster than they can think...
-
- VIP Livecode Opensource Backer
- Posts: 9802
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: fitting to screen size
"New Posts" is a query result, not a section. I'm not chastising, just sharing my own journey here: As a daily user of "New Posts", I've lost track of the number of times I've responded to posts here with inappropriate guidance because I hadn't checked the section they were posted in. I try to do that more often now.richmond62 wrote: ↑Thu Jul 26, 2018 6:23 pmNo doubt . . .Since this is the ANDROID forum
BUT as I saw it in the "New posts" section . . .
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Livecode Opensource Backer
- Posts: 9287
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: fitting to screen size
Erm, Yes, Well . . . about the time I walked into a public toilet and then realisedjust sharing my own journey here
the picture on the door did NOT represent a man in a kilt.
We can play this sort of game for ages.
Re: fitting to screen size
I have had chance to try some scripts as suggested above.
Also I need to clarify what I am doing, why I am doing it and what on.
I am attempting to fit a fixed card size, designed for a specific desktop monitor/screen to a smartphone. The resulting program can then be tested to see what works and what doesn't. I can set about reorganising the interface if the features of the program work. The fact the image will be small and distorted beyond reason, is not a concern. Neither is the fact that desktop buttons rather than smartphone style controls are used. They actually work well, from what is visible so far.
Once I find what works, I can create a new program that interfaces properly.
I am developing an android app for smartphones and tablets (Not apple) that also has a desktop interface. The Phone/tablet component is for viewing and interacting, like you might with a Facebook App, but the desktop component provides the design and creation of data that is not practical on a small screen, touch device.
OK, The Rectangle method works well for the stack, but I cannot resize the card the same way, so this is not a complete solution.
The fullscreenmode and options does not work at all, for me. It stays in the same location and size as the stack is saved in. Dictionary does not explain why it fails. No solution here.
I had placed the card content into a group with scroll bars, so with a smaller stack than card, I should be able to navigate around it. I am not able to get this to work either, but don't concern yourself with this.
Any more ideas?
Also I need to clarify what I am doing, why I am doing it and what on.
I am attempting to fit a fixed card size, designed for a specific desktop monitor/screen to a smartphone. The resulting program can then be tested to see what works and what doesn't. I can set about reorganising the interface if the features of the program work. The fact the image will be small and distorted beyond reason, is not a concern. Neither is the fact that desktop buttons rather than smartphone style controls are used. They actually work well, from what is visible so far.
Once I find what works, I can create a new program that interfaces properly.
I am developing an android app for smartphones and tablets (Not apple) that also has a desktop interface. The Phone/tablet component is for viewing and interacting, like you might with a Facebook App, but the desktop component provides the design and creation of data that is not practical on a small screen, touch device.
OK, The Rectangle method works well for the stack, but I cannot resize the card the same way, so this is not a complete solution.
The fullscreenmode and options does not work at all, for me. It stays in the same location and size as the stack is saved in. Dictionary does not explain why it fails. No solution here.
I had placed the card content into a group with scroll bars, so with a smaller stack than card, I should be able to navigate around it. I am not able to get this to work either, but don't concern yourself with this.
Any more ideas?
Re: fitting to screen size
I have tried other things, but scalefactor of stack seems to work perfectly for a set ratio.
I used a table field to form a grid so I could see what cells (sizing device) covered the screen area and then with a button and field to hold a variable, I could experiment. Yes, I know a table field could contain the scale value, but the cells are to small to put a value in, physically.
Thank you all for your help and advice. I can come back to it if I need to refine things.
on mouseup
answer fld "grid1"
set scalefactor of stack "GridSize" to fld "grid1"
end mouseup
I used a table field to form a grid so I could see what cells (sizing device) covered the screen area and then with a button and field to hold a variable, I could experiment. Yes, I know a table field could contain the scale value, but the cells are to small to put a value in, physically.
Thank you all for your help and advice. I can come back to it if I need to refine things.
on mouseup
answer fld "grid1"
set scalefactor of stack "GridSize" to fld "grid1"
end mouseup