The more recipes for achieving one goal the better; even if only to prove how versatileI suggest an other way without cloning
Livecode is.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
The more recipes for achieving one goal the better; even if only to prove how versatileI suggest an other way without cloning
I solved that by putting empty into the script of the letter tile once it has been placedit can't be removed once placed
Code: Select all
on mouseDown
lock screen
-- all images except the letter tiles seem to start with a special char. exit mousedown if not a tile
if (char 1 of the short name of the target is among the items of "%,^,$,&,*,!,+,#") then exit "mousedown"
set the itemdel to "."
switch
-- if its an original tile do this
case item 2 of the short name of the target contains "png"
-- clone the target
clone the target
--set the name and position the original
set the name of the target to item 1 of the short name of the target
-- position the clone to take over for the target
set the loc of the last img to the loc of the target
-- offset the target to make the chane visible
set top of the target to the top of the last img -5
set the left of the target to the left of the last img + 5
-- move the clone behind the target
set the layer of the last img to the layer of the target
-- take advantage of fall through...
case char 1 of the short name of the target is not among the items of "%,^,$,&,*,!,+,#"
-- grab the now renamed target
-- if the first if doesn't exit the hander, and the first case doesn't match, still grab the target
-- also, when a tile is placed it is renamed, check for this and don't pick up the tile again.
grab the target
end switch
unlock screen
end mouseDown
on mouseUp
-- if not a valid tile, exit the handler
--if (char 1 of the short name of the target is among the items of "%,^,$,&,*,!,+,#") then exit to top
if (char 1 of the short name of the target is among the items of "%,^,$,&,*,!,+,#") then exit to top
--if not (the short name of the target contains "placed_") then exit to top
local targes
put the short name of the target into IMENA
put the long id of the target into tId
put empty into fld "targes"
-- create the list of mutable characters
put "%,^,$,&,*,!,+,#" into tMute
-- build the list to check the tile against
repeat for each item tItem in tMute
if exists(img (tItem & IMENA)) then
put the short name of img (tItem & IMENA) & cr after targes
end if
end repeat
delete the last char of targes
----->>>--X--<<<-----
-- determine if the drop location matches for the specific tile
put 0 into WHATNEXT
repeat for each line tLine in targes
if the mouseloc is within the rect of img tLine then
--if intersect(tId, img tLine) then
put 1 into WHATNEXT
set the loc of the target to the loc of img tLine
-- tag tile with % to mark tile as uncloneable/ungrabable
-- tag with .placed to identify for cleanup using "clearTiles" command
set the name of the target to ("%" & the short name of the target & ".placed")
end if
end repeat
if WHATNEXT = 0 then
-- if there was no match, delete the tile
-- no send required because the script is not running in the tile to be deleted
delete tId -- could "delete the target" instead of storing the long id previously
--send ("delete tId") to this card in 0
end if
end mouseUp
command clearTiles
set the itemdel to "."
put the number of images of this card into tNum
repeat with i = tnum down to 1
if the last item of the short name of image i is "placed" then delete img i
end repeat
end clearTiles
Yes, of course, except for the thing that I am a very conservative chap who ettles after "seeing his laundry hingin on the line".One more thing you might consider, get rid of field fscrip entirely.
Yes it is necessary and fixed in CRAZY LETTERS001 ?1. Prevent the possibility of piling multiple piles in one location [is this strictly necessary?].
The user have to maintain mousedown to grab a letter. That is often not easy for children2. Further suggestions Please!
I don't know about that: I am dealing with children of 5 years and up, and they have sufficient motor controlThe user has to maintain mousedown to grab a letter. That is often not easy for children
Dont worry. That is the same for me (new year, new students, new teachers)NO: I'm very sorry, I'm dancing around like a cat on a hotplate right now geting things up-and-running for my
new school year.
Yes, but I think accessibility is an important point...I am dealing with children of 5 years and up, and they have sufficient motor control
that they can keep the mouse button pressed.
NO ! Just do itI promise (!) to take a look at your variant within 3 days.
I did, and the first thing that happened was that my right index fingerNO ! Just do it
I just tested and it works herefirst thing that happened was that my right index finger
twitched so I did 2 mouseDowns on the "E.png" template and got in trouble:
Code: Select all
put the itemdel into tOID
set the itemdel to "."
--do something
set the itemdel to tOID
Code: Select all
--•• btn "bMoveLetter" mouseup
on debMoveLetterMU
set the top of grc "indic" to 2000
set the uMyJob of this cd to empty
put getBtnLetterID(the uMyLetter of btn "bMoveLetter") into tUnderID
if tUnderID <> empty then --•• add after v.001
if the short name of btn id tUnderID = the uMyLetter of btn "bMoveLetter" then
set the icon of btn id tUnderID to the icon of btn "bMoveletter"
end if
end if
hide btn "bMoveletter"
end debMoveLetterMU