Is there an easy way to get the x,y coordinates of a stack

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
shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Is there an easy way to get the x,y coordinates of a stack

Post by shawnblc » Wed Feb 26, 2014 2:54 am

For instance, when I put my mouse over a certain location on my stack, I'd like to be able to get the x,y coordinates. Is there an easy way to do this so when I'm designing my layout or moving objects around I can have this info?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Is there an easy way to get the x,y coordinates of a sta

Post by FourthWorld » Wed Feb 26, 2014 3:01 am

See the screenMouseLoc function and the mouseMove message in the Dictionary.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: Is there an easy way to get the x,y coordinates of a sta

Post by shawnblc » Wed Feb 26, 2014 3:54 am

FourthWorld wrote:See the screenMouseLoc function and the mouseMove message in the Dictionary.
Thanks bud. Way easier than I was trying. You led me down the right road though. Thank you.

Code: Select all

-- get the mouse location x,y
on mouseMove
   put the mouseLoc into fld "fld1"
end mouseMove

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Is there an easy way to get the x,y coordinates of a sta

Post by Simon » Wed Feb 26, 2014 4:04 am

Hi shawnblc,
So you don't have to include a fld every time try just
"put the mouseLoc"
See what happens.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

shawnblc
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 342
Joined: Fri Jun 01, 2012 11:11 pm

Re: Is there an easy way to get the x,y coordinates of a sta

Post by shawnblc » Wed Feb 26, 2014 4:21 am

Simon wrote:Hi shawnblc,
So you don't have to include a fld every time try just
"put the mouseLoc"
See what happens.

Simon

Excellent Simon. I stepped away from my LC learning for awhile due to work, but I'm getting back into it. :)

Post Reply