stack size
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
stack size
hi, i am devoloping an app for mobile but i don't know what is the best size for to stack(vertical), so it doesn't seem weird in the phone, thanks
Samuele.
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: stack size
The dimensions of your stack should be the same as those of your target phone . . .
SO, that means that of you are targetting more than one device you have to use code
that will change the size of the stack depending on which kind of phone it ends up on.
This website will give you phone dimensions: https://www.gsmarena.com/
SO, that means that of you are targetting more than one device you have to use code
that will change the size of the stack depending on which kind of phone it ends up on.
This website will give you phone dimensions: https://www.gsmarena.com/
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: stack size
As Italian may not be on everyone's language list, this information would be useful in English.I'm finishing a fairly simple game for children
[If you need to communicate with me privately, please write in English, Scots, French or Bulgarian.]
Re: stack size
thank you, but now i have 2 questions 1) how do i write the code that changes the stack size depending on the phone? 2)in what size livecode stacks work? (cm, mm pixels...)
thank you.
thank you.
Samuele.
Re: stack size
ok, i was replying to an italianrichmond62 wrote: ↑Thu Oct 14, 2021 9:26 amAs Italian may not be on everyone's language list, this information would be useful in English.I'm finishing a fairly simple game for children
[If you need to communicate with me privately, please write in English, Scots, French or Bulgarian.]
Samuele.
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: stack size
That's OK, but all postings here are public, so will be read by lots of people.
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: stack size
LiveCode stacks are measured in pixels.
As I have NEVER made anything for mobile platform I hope
someone better qualified will answer your other questions.
However, what I do know is that one canget the screenSize for any monitor like this:
then you can set the WIDTH and the HEIGHT of your stack to fit.
As I have NEVER made anything for mobile platform I hope
someone better qualified will answer your other questions.
However, what I do know is that one canget the screenSize for any monitor like this:
Code: Select all
put the screenRect
Re: stack size
On a mobile platform there is no "windowing" and the stack ALWAYS takes up the entire available screen area. Each card ALWAYS takes the size if the stack.
You can use the effective screenrect and the working screenrect to get more detail about the dimensions you have for the actual size you need to work to. (You can't set the height or width of a card or stack on mobile.) There are a number of screen configurations on iOS devices and literally hundreds on Android.
If you plan for a typical target device, you can try the fullscreenMode setting to scale it accordingly when different devices are used. See some of the posts here by jacque to get some great info.
You can use the effective screenrect and the working screenrect to get more detail about the dimensions you have for the actual size you need to work to. (You can't set the height or width of a card or stack on mobile.) There are a number of screen configurations on iOS devices and literally hundreds on Android.
If you plan for a typical target device, you can try the fullscreenMode setting to scale it accordingly when different devices are used. See some of the posts here by jacque to get some great info.
-
- VIP Livecode Opensource Backer
- Posts: 2718
- Joined: Sat Dec 22, 2007 5:35 pm
- Location: Genève
- Contact:
Re: stack size
Hi All,
I have the same goal for iPad.
You may use fullscreenMode if each control doesn't move.
If some controls move, you have to set the loc of each control regarding screenrect.
Best regards
Jean-Marc
I have the same goal for iPad.
You may use fullscreenMode if each control doesn't move.
If some controls move, you have to set the loc of each control regarding screenrect.
Best regards
Jean-Marc
https://alternatic.ch
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: stack size
tahnks , yes ,in my mobile it does fit to the screen but then it becomes a little strange because it is not enlarged proportionally, do you have any ideas how to make it fit the screen but in a way that the stack enlarges proportionally (width and height) thank you!
Samuele.
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: stack size
The stack will NOT enlarge proportionally,
so you have to include code to reposition components.
As mentioned above, this is where screenRect comes into play.
so you have to include code to reposition components.
As mentioned above, this is where screenRect comes into play.
Re: stack size
Hi,
You might want to look at the fullScreenMode property. This lets you set the full screen scaling mode of your stack.
There is a lesson here
https://lessons.livecode.com/m/4069/l/1 ... ll-devices
I hope that helps.
Elanor
You might want to look at the fullScreenMode property. This lets you set the full screen scaling mode of your stack.
There is a lesson here
https://lessons.livecode.com/m/4069/l/1 ... ll-devices
I hope that helps.
Elanor
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode
Re: stack size
Sorry, I just noticed fullScreenMode had already been suggested!
The lesson might still be helpful though.
Elanor Buchanan
Software Developer
LiveCode
Software Developer
LiveCode
-
- Livecode Opensource Backer
- Posts: 9454
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: stack size
This is how I manage things in the very rare occasions I need to resize stacks:
- -
Yes, it is extremely childish!
But when the stack is resized all the buttons, fields and pictures move to where they should be.
Everything is in the stackScript:
- -
Yes, it is extremely childish!
But when the stack is resized all the buttons, fields and pictures move to where they should be.
Everything is in the stackScript:
Code: Select all
on preOpenStack
set the width of stack "ScreenSizer" to 500
set the height of stack "ScreenSizer" to 400
set the loc of btn "get SCREENSIZE" to 250, 50
set the loc of img "monster" to 250, 200
set the loc of fld "ff" to 250, 345
set the loc of img "z1" to 29, 48
set the loc of img "z2" to 29, 351
set the loc of img "z3" to 470, 48
set the loc of img "z4" to 470, 351
set theloc of img "guff" to 250,15
end preOpenStack
on resizeStack nWIDD, nHITE, oWIDD, pHITE
set the loc of btn "get SCREENSIZE" to (nWIDD / 2), 50
set the loc of img "monster" to (nWIDD / 2), (nHITE / 2)
set the loc of fld "ff" to (nWIDD / 2), (nHITE - 55)
set the loc of img "z1" to 29, 48
set the loc of img "z2" to 29, (nHITE - 49)
set the loc of img "z3" to (nWIDD - 30), 48
set the loc of img "z4" to (nWIDD - 30), (nHITE - 49)
set the loc of img "guff" to (nWIDD / 2), 15
end resizeStack
- Attachments
-
- ScreenSizer.livecode.zip
- Here's the stack.
- (49.58 KiB) Downloaded 114 times