EXACT POSITION ON A SCREEN

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

Post Reply
cybernaut
Posts: 13
Joined: Wed Feb 09, 2011 2:57 pm

EXACT POSITION ON A SCREEN

Post by cybernaut » Sun Jul 03, 2011 2:55 pm

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

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: EXACT POSITION ON A SCREEN

Post by BvG » Sun Jul 03, 2011 2:57 pm

normally, you'd want the center of the screen. Which is available as "the screenLoc".
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

cybernaut
Posts: 13
Joined: Wed Feb 09, 2011 2:57 pm

Re: EXACT POSITION ON A SCREEN

Post by cybernaut » Sun Jul 03, 2011 3:03 pm

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

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: EXACT POSITION ON A SCREEN

Post by Klaus » Sun Jul 03, 2011 3:10 pm

Hi herman,

this is no "setting"! Simply use it :D
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

cybernaut
Posts: 13
Joined: Wed Feb 09, 2011 2:57 pm

Re: EXACT POSITION ON A SCREEN

Post by cybernaut » Sun Jul 03, 2011 3:14 pm

Klaus wrote:Hi herman,

this is no "setting"! Simply use it :D
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

cybernaut
Posts: 13
Joined: Wed Feb 09, 2011 2:57 pm

Re: EXACT POSITION ON A SCREEN

Post by cybernaut » Sun Jul 03, 2011 3:20 pm

Klaus wrote:Hi herman,

this is no "setting"! Simply use it :D
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

Post Reply