Pin Me Down

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
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Pin Me Down

Post by richmond62 » Sun Sep 11, 2022 9:57 am

SShot 2022-09-11 at 11.54.14.png
-
I might be trying to be too clever . . .

Certainly I cannot work out WHY the second set the points (in the mouseUp statement) does NOT set the points.
Attachments
PIN ME DOWN.livecode.zip
Stack.
(1.3 KiB) Downloaded 106 times

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: Pin Me Down

Post by bn » Sun Sep 11, 2022 10:47 am

Hi Richmond,

try this

Code: Select all

local doMove = false

on mouseDown
   put true into doMove
   put the loc of me into fld "fSTART"
   put the loc of me into fld "fFINISH"
   reset the templateGraphic
   if there is not a graphic "LYNE" then
      create grc "LYNE"
   end if
   
   -- set layer to be able to click again into "me" 
   -- otherwise "me" is partially covered by "LYNE"
   set the layer of grc "LYNE" to the layer of me -1
   
   set the style of grc "LYNE" to "line"
   set the lineSize of grc "LYNE" to 4
   --   set the height of grc "LYNE" to 100
   --   set the width of grc "LYNE" to 100
   --send "choose browse tool" to me
   choose "browse" tool -- I think it is not needed; how would you get here in edit mode
   put fld "fSTART" into XSTART
   set the points of grc "LYNE" to (XSTART & cr & XSTART)
end mouseDown

on mouseMove
   if doMove then
      put the mouseLoc into fld "fFINISH"
      set the points of grc "LYNE" to field "fStart" & cr & the mouseLoc
   end if
end mouseMove

on mouseUp
   put fld "fSTART" into XSTART
   put fld "fFINISH" into XFIN
   set the points of grc "LYNE" to (XSTART & cr & XFIN)
   put false into doMove
end mouseUp

-- you are outside of the starting object and it will only get a mouseRelease
on mouseRelease
   mouseUp
end mouseRelease
Kind regards
Bernd

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: Pin Me Down

Post by richmond62 » Sun Sep 11, 2022 10:50 am

you are outside of the starting object and it will only get a mouseRelease
Bless You! :)

I had absolutely no idea about that.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: Pin Me Down

Post by richmond62 » Sun Sep 11, 2022 12:21 pm

SShot 2022-09-11 at 14.18.59.png
-
Cripes: long-winded process . . .
Attachments
PIN ME DOWN.livecode.zip
Stack.
(2.03 KiB) Downloaded 104 times

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: Pin Me Down

Post by bn » Sun Sep 11, 2022 1:35 pm

richmond62 wrote:
Sun Sep 11, 2022 12:21 pm
Cripes: long-winded process . . .
Richmond,

I do not understand what the rules of this game are. Hence I have no idea what you are asking; if you are asking anything at all.

KInd regards
Bernd

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: Pin Me Down

Post by richmond62 » Sun Sep 11, 2022 2:08 pm

This is NOT a game, it is an attempt to make one of
those funny login things that I have on my Android phone.
-
PIN.jpg
-
And, No, I wasn't a question, it was just a moan about
how long-winded doing it was.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: Pin Me Down

Post by richmond62 » Sun Sep 11, 2022 4:31 pm

AND, having got "that" far, the big question is how one stores that pattern so that
next time I make the same pattern the thing "lets me into the Magic Kingdom",
and when I make a mistake it does not let me in.

Mind you, before that, there is another problem:
-
SShot 2022-09-11 at 18.35.04.png
-
So code has to be altered so one can ONLY end up one's mouse-drag over one of the other
spots (i.e. NOT the one one started dragging from).

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Pin Me Down

Post by jacque » Sun Sep 11, 2022 5:47 pm

You need the current behavior to draw the line but it shouldn't be used to store the pattern because people are not exact when drawing it. Instead, store the location of every dot they enter, which is a fixed point. When tracking a login attempt, use the dot locations and then compare that list with the stored one.

BTW, it is legal to reuse the starting point later in the pattern, or duplicate any of the others as well.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: Pin Me Down

Post by richmond62 » Mon Sep 12, 2022 10:32 am

Coo; talk about a "dark night of the soul" . . . lay awake half the night over this little problem:
-
Screen Shot 2022-09-12 at 12.31.21 PM.png
-
Screen Shot 2022-09-12 at 12.31.41 PM.png
-
Is there a way to COMBINE 2 or more graphics into 1 graphic WITHOUT
silly things such as that central linking line?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: Pin Me Down

Post by bn » Mon Sep 12, 2022 11:11 am

Hi Richmond,

the trick is to insert empty lines in the list of points. That will not show the connecting line.


PinMeDowRichmond.livecode.zip
(1.66 KiB) Downloaded 117 times


allLines.png
someLinesHidden.png


Kind regards
Bernd

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: Pin Me Down

Post by richmond62 » Mon Sep 12, 2022 12:12 pm

That's super, Bernd.

You're the man!

Post Reply