Page 1 of 1
EXACT POSITION ON A SCREEN
Posted: Sun Jul 03, 2011 2:55 pm
by cybernaut
Hello, I am new using LiveCode and I have a question:
I am creating an app and I can see than on inspector you can setup the position at which the stack will appears on a screen (standalone mac app) when is running. Since there many screens setup to diffeent resolution I am trying to setup one standard position on the screen for all the apps I am building.
Is there any more efficient way to do this rather that input the position to every stack or subtack or card you create?
Thanking you for your help.
Herman
Re: EXACT POSITION ON A SCREEN
Posted: Sun Jul 03, 2011 2:57 pm
by BvG
normally, you'd want the center of the screen. Which is available as "the screenLoc".
Re: EXACT POSITION ON A SCREEN
Posted: Sun Jul 03, 2011 3:03 pm
by cybernaut
BvG wrote:normally, you'd want the center of the screen. Which is available as "the screenLoc".
Please forgive me since I am new...where I can find this the screenLoc settings?
Herman
Re: EXACT POSITION ON A SCREEN
Posted: Sun Jul 03, 2011 3:10 pm
by Klaus
Hi herman,
this is no "setting"! Simply use it

Please check the LiveCode dictionary for info!
Example to "center" a stack on the screen:
Code: Select all
on preopenstack
set the loc of this stack to the screenloc
end preopenstack
Best
Klaus
Re: EXACT POSITION ON A SCREEN
Posted: Sun Jul 03, 2011 3:14 pm
by cybernaut
Klaus wrote:Hi herman,
this is no "setting"! Simply use it

Please check the LiveCode dictionary for info!
Example to "center" a stack on the screen:
Code: Select all
on preopenstack
set the loc of this stack to the screenloc
end preopenstack
Best
Klaus
Thank you, I guess I will have to read the dictionary!
Cheers
Herman
Re: EXACT POSITION ON A SCREEN
Posted: Sun Jul 03, 2011 3:20 pm
by cybernaut
Klaus wrote:Hi herman,
this is no "setting"! Simply use it

Please check the LiveCode dictionary for info!
Example to "center" a stack on the screen:
Code: Select all
on preopenstack
set the loc of this stack to the screenloc
end preopenstack
Best
Klaus
It worked!
I was thinking that when dictionary explain the syntaxis as ScreenLoc() I have to actually enter some numbers for the x and y position of the monitor.
But instead when the function is applied, automatically measures the resolution of screen and place the app in the centre. Very interesting!
Again, thank you
Herman