another easy tutorial.
Create a stack with 2 regular polygon graphics. Name the graphics "triangle1" and "triangle2" Set the number of sides for each polygon to 3. In the messagebox:
set the constrainRectangular of grc "triangle1" to the rect of this card
set the constrainRectangular of grc "triangle1" to the rect of this card
Apply the following script to both graphics (mind linewraps):
Code: Select all
on mouseMove
put findAngleX(the loc of grc "triangle1",the loc of grc "triangle2") into triangle1Rotation
put findAngleX(the loc of grc "triangle2",the loc of grc "triangle1") into triangle2Rotation
set the angle of grc "triangle1" to triangle1Rotation
set the angle of grc "triangle2" to triangle2Rotation
pass mouseMove
end mouseMove
Hope you like it.
All the best,
Malte