Page 1 of 2

stack size

Posted: Thu Oct 14, 2021 8:56 am
by Samuele
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

Re: stack size

Posted: Thu Oct 14, 2021 9:22 am
by richmond62
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/

Re: stack size

Posted: Thu Oct 14, 2021 9:26 am
by richmond62
I'm finishing a fairly simple game for children
As Italian may not be on everyone's language list, this information would be useful in English.

[If you need to communicate with me privately, please write in English, Scots, French or Bulgarian.]

Re: stack size

Posted: Thu Oct 14, 2021 9:31 am
by Samuele
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.

Re: stack size

Posted: Thu Oct 14, 2021 9:36 am
by Samuele
richmond62 wrote:
Thu Oct 14, 2021 9:26 am
I'm finishing a fairly simple game for children
As Italian may not be on everyone's language list, this information would be useful in English.

[If you need to communicate with me privately, please write in English, Scots, French or Bulgarian.]
ok, i was replying to an italian :wink:

Re: stack size

Posted: Thu Oct 14, 2021 11:04 am
by richmond62
That's OK, but all postings here are public, so will be read by lots of people.

Re: stack size

Posted: Thu Oct 14, 2021 11:06 am
by richmond62
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:

Code: Select all

put the screenRect
then you can set the WIDTH and the HEIGHT of your stack to fit.

Re: stack size

Posted: Thu Oct 14, 2021 2:58 pm
by SparkOut
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.

Re: stack size

Posted: Thu Oct 14, 2021 3:11 pm
by jmburnod
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

Re: stack size

Posted: Thu Oct 14, 2021 3:52 pm
by richmond62
That makes the whole thing back-to-front.

Re: stack size

Posted: Thu Oct 14, 2021 5:10 pm
by Samuele
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!

Re: stack size

Posted: Thu Oct 14, 2021 5:11 pm
by richmond62
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.

Re: stack size

Posted: Thu Oct 14, 2021 6:00 pm
by elanorb
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

Re: stack size

Posted: Thu Oct 14, 2021 6:03 pm
by elanorb
Sorry, I just noticed fullScreenMode had already been suggested!
jmburnod wrote:
Thu Oct 14, 2021 3:11 pm
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
The lesson might still be helpful though.

Re: stack size

Posted: Thu Oct 14, 2021 6:26 pm
by richmond62
This is how I manage things in the very rare occasions I need to resize stacks:
-
SShot 2021-10-14 at 20.22.27.png
-
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