Would like to show a photo through a polygon shape

Alejandro Tejada capellan2000 at gmail.com
Wed Oct 23 05:09:28 CEST 2013


Hi Roger,

Test these scripts too, before using a group:

1) Create a new stack
2) Create a polygon graphic
and set the points of it to:

0,0

34,268
224,268
127,365
34,268

3) import an image into this stack,
put the image in a corner, where it does not
hide the graphic and:

set the backpattern of grc 1 to the id of img 1

(now, the imported image is cropped within
the graphic)

4) set the script of the graphic to this variation
of Scott Rossi script to move the first point of
the graphic and (at the same time) move the
image within the graphic:

local lpoints,tClick

on mouseDown
   put the points of me into lpoints
   put mouseH(),mouseV() into tClick
end mouseDown

on mouseMove X,Y
   if tClick = "" then exit mouseMove
   put  (X - item 1 of tClick,Y - item 2 of tClick) into line 1 of lpoints
   set the points of me to lpoints
end mouseMove

on mouseUp
   put "" into tClick
end mouseUp

on mouseRelease
   put "" into tClick
end mouseRelease

When you click inside the graphic and move the mouse
the image will move within the graphic, just as you
requested. 

But... there is a small glitch. The background image
"reset" it's position when you try to move it again. 

Why does this happen? 
Why the image "resets" it's position?
Does exists a workaround for this?

Thanks in advance!

Al






--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Would-like-to-show-a-photo-through-a-polygon-shape-tp4671281p4671373.html
Sent from the Revolution - User mailing list archive at Nabble.com.



More information about the use-livecode mailing list