Hi,
Thanks for the feed back on the LED experiments and I'm studying the code to scale objects.
I have an updated version of my LED stack almost ready to go, including a demo of a working 4 LED panel that can be connected from 3 different mini-apps on the card: a timer, a text entry, and a mini game. I really wanted to be able to drag a line from one mini app to the display to activate the display but drawing that connecting line has kept me occupied for the last few days.
The attached stack demos a working strategy for creating connecting lines, maintaining the connection while objects are moved, but disconnecting the lines has me temporarily stumped. Any ideas?
- Mike
Vector Graphics Experiments
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Vector Graphics Experiments
- Attachments
-
- MGB Connecting Objects.livecode.zip
- (2.73 KiB) Downloaded 21 times
Mike Roberts
https://mygiantbrain.com
https://mygiantbrain.com
-
- VIP Livecode Opensource Backer
- Posts: 4016
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Vector Graphics Experiments
Hi Mike,
the short answer is to change the code in the template script regarding deleting graphic "line" to this code:
Code: Select all
else
## uncouple the deletion of graphic "line" from its script
put the long iD of me into tID
send "delete tID" to this card in 5 milliseconds
## end uncouple
end if
exit mouseDown
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 4016
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Vector Graphics Experiments
Mike,
If you want to 'embellish' your line graphic here is a change to your createALine handler:
It makes it easier for the user to hit the end of the graphic.
Kind regards
Bernd
If you want to 'embellish' your line graphic here is a change to your createALine handler:
Code: Select all
command createALine pObject
if there is not a graphic "Line" and gIsDragging then
create graphic "Line"
set the endArrow of the last graphic to true
set the dashes of the last graphic to 4
## change for markers
set the style of the last graphic to "polygon" ## has to be 'polygon' for markers
## a square
set the markerPoints of the last graphic to "-4,0" & cr & "0,-4" & cr & "4,0" & cr & \
"0,4" & cr & "-4,0"
## large circle
-- set the markerPoints of the last graphic to "-7,0" & cr & "-6,-2" & cr & "-5,-4" & cr & \
-- "-3,-6" & cr & "0,-7" & cr & "3,-6" & cr & \
-- "5,-4" & cr & "6,-2" & cr & "7,0" & cr & \
-- "6,2" & cr & "5,4" & cr & "3,6" & cr & \
-- "0,7" & cr & "-3,6" & cr & "-5,4" & cr & \
-- "-6,2" & cr & "-7,0"
set the markerFilled of the last graphic to true
set the markerDrawn of the last graphic to true
set the hiliteColor of the last graphic to "255,0,0"
set the borderColor of the last graphic to "255,0,0"
## end change for markers
set the points of the last graphic to the loc of graphic pObject & CR & the mouseLoc
if there is a button "Line Script Template" then
set the script of the last graphic to the script of button "Line Script Template"
end if
else
exit createALine
end if
end createALine
Kind regards
Bernd