Need clean image
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Need clean image
Craig,
you could move an open polygon with a bit of cheating. It involves an image at 99% transparency that gets the mouse events and passes them to an enclosing group. Script is in the group.
Kind regards
Bernd
PS I immensely enjoyed your flash-talk at the 2022 developer conference. Wow.
			
			
									
									
						you could move an open polygon with a bit of cheating. It involves an image at 99% transparency that gets the mouse events and passes them to an enclosing group. Script is in the group.
Kind regards
Bernd
PS I immensely enjoyed your flash-talk at the 2022 developer conference. Wow.
- 
				richmond62
- Livecode Opensource Backer 
- Posts: 10202
- Joined: Fri Feb 19, 2010 10:17 am
Re: Need clean image
You could, of course, do what I did with 3 graphics in a group, and a script in the group.
			
			
									
									
						Re: Need clean image
No I could not. One of many reasons would be that it is hard to grab (relatively small width)richmond62 wrote: ↑Wed May 18, 2022 10:04 amYou could, of course, do what I did with 3 graphics in a group, and a script in the group.
If I would do that though I would change the code e.g. for image "RV" to
Code: Select all
local sRunning, sXDiff, sYLoc
on mouseDown
   put the clickLoc into tClick
   put the loc of me into tLoc
   put item 1 of tClick - item 1 of tLoc into sXDiff
   put item 2 of tLoc into sYLoc
   put true into sRunning
end mouseDown
on mouseMove x,y
   if not sRunning then exit mouseMove
   lock screen
   put x - sXDiff into tNewX
   set the loc of me to tNewX, sYLoc
   put the right of me into RITE
   put the left of img "LV" into LLL
   put (RITE - LLL) into LENF
   set the width of img "HOR" to LENF
   set the left of img "HOR" to LLL
   unlock screen
end mouseMove
on mouseUp
   lock screen
   put false into sRunning
end mouseUp
Kind regards
Bernd
- 
				richmond62
- Livecode Opensource Backer 
- Posts: 10202
- Joined: Fri Feb 19, 2010 10:17 am
Re: Need clean image
Of course you COULD, but you WILL NOT.No I could not.
A group would NOT have a small width to grab,
Re: Need clean image
Lots of hubbub.
I use this in the card script to dynamically adjust the width/height of these thin "brackets", which are used to annotate the locations and extents of various circuits in a drawing. For the horizontal versions:
Works fine. The actual handlers only work if the target has certain custom properties set. The user can "grab" these objects, place them as required, then adjust their dimensions by eye.
That was never the problem. I rarely use images or graphics, but I am getting by fairly well with the new graphic gadgets tweaked by Mark W. The issue I had with images is that the line widths varied as the dimensions did. Polygons are constant.
Craig
			
			
									
									
						I use this in the card script to dynamically adjust the width/height of these thin "brackets", which are used to annotate the locations and extents of various circuits in a drawing. For the horizontal versions:
Code: Select all
on mouseStillDown
   if the controlKey is down then set the width of the target to the width of the target + 3
   else if the commandKey is down then set the width of the target to the width of the target - 3
end mouseStillDown
on mouseMove
   if the mouse is down then set the loc of me to the mouseLoc
end mouseMove
That was never the problem. I rarely use images or graphics, but I am getting by fairly well with the new graphic gadgets tweaked by Mark W. The issue I had with images is that the line widths varied as the dimensions did. Polygons are constant.
Craig
- 
				richmond62
- Livecode Opensource Backer 
- Posts: 10202
- Joined: Fri Feb 19, 2010 10:17 am
Re: Need clean image
Healthy Hubbub can be an education in itself.Lots of hubbub.
Re: Need clean image
Richard.
Yes, fall apart.
In development at least, the polygons are a bit fragile, in that after playing with them I have inadvertently done things that close that last side. I am putting in defenses against that happening. It is possible that once these things are built and only users, er, use them, and my meddling stops, they will likely be stable.
Craig
			
			
									
									
						Yes, fall apart.
In development at least, the polygons are a bit fragile, in that after playing with them I have inadvertently done things that close that last side. I am putting in defenses against that happening. It is possible that once these things are built and only users, er, use them, and my meddling stops, they will likely be stable.
Craig
Re: Need clean image
Bernd.
Thanks for the compliment.
Craig
			
			
									
									
						Thanks for the compliment.
I have played with such "compound" controls but am going to try my best to make simple polygon graphics do the job. They seem to hold their line widths better when stretched or compressed.you could move an open polygon with a bit of cheating. It involves an image at 99% transparency that gets the mouse events and passes them to an enclosing group. Script is in the group.
Craig
Re: Need clean image
@LCMark.
Changing a polygon to a curve and setting its opaque works just fine. I do not need to revert back to a polygon. The shape stays stable when its dimensions are changed.
Craig
			
			
									
									
						Changing a polygon to a curve and setting its opaque works just fine. I do not need to revert back to a polygon. The shape stays stable when its dimensions are changed.
Craig
