cmhjon wrote: ↑Tue May 23, 2023 9:15 pm
The question I have is that since the line thickness is only one pixel thick which makes it a tad more difficult to move requiring the user to correctly position the cursor over the line in order to move it, is there a way to somehow add "padding" around the line to make it easier to click on and move?
Thank you,
Jon
Hi Jon,
some good suggestions here but may be less feasible in a wider project.
How about this: instead of providing padding, just highlight the object with an outerGlow effect when the mouse is at the right spot -- this still requires accurate placement, but the user will be guided to where that placement is.
For example, in the card or stack script put this:
Code: Select all
command assignGlow pControlID
set the outerglow of pControlID to setGlowParams()
end assignGlow
function setGlowParams
local tGlow
put "normal" into tGlow["blendmode"]
put 221,46,62 into tGlow["color"]
put "box3pass" into tGlow["filter"]
put 186 into tGlow["opacity"]
put 255 into tGlow["range"]
put 7 into tGlow["size"]
put 73 into tGlow["spread"]
return tGlow
end setGlowParams
This code will assign the outerGlow as defined in setGlowParams(), I just put some random stuff in there to make it red-ish.
In the line's script put this:
Code: Select all
on mouseEnter
assignGlow the long id of me
end mouseEnter
on mouseDown
grab me
end mouseDown
on mouseLeave
set the outerglow of me to empty
end mouseLeave
This has the effect of highlighting the line when the mouse is in the correct position; if the user then clicks they can drag it freely around. When the mouse leaves the rect of the line, the outerGlow goes away.
By using the script in card or stack, you can generalise this to any object that needs highlighing in this fashion...
HTH
S.