How to rotate a graphic line freely?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
How to rotate a graphic line freely?
Hello,
I draw a grapic line on a graph. The line need to be able to move and rotate freely on the graph for data analysis.
Move
=======
I can use the following to achieve the result:
on mousedown
grab me
end mousedown
However I have no any idea how to rotate the graphic line. Can RR do that?
Thanks and best regards
I draw a grapic line on a graph. The line need to be able to move and rotate freely on the graph for data analysis.
Move
=======
I can use the following to achieve the result:
on mousedown
grab me
end mousedown
However I have no any idea how to rotate the graphic line. Can RR do that?
Thanks and best regards
Alex
Nice to meet all of you.
Nice to meet all of you.
Hi Alex,
You can use the revRotatePoly command to rotate line graphics:
revrotatepoly the long id of grc id 1003,45
The easiest way to create an interface for rotating objects probably is to use a slider.
I have noticed that rotating line graphics may make the graphic object smaller in size. Also, resetting the rect of the graphic to the original values distorts the rotation. Rotating a graphic is therefore probably not what you want. Try creating a transparent image with equal height and width and a line drawn over it instead. Import the image and use the rotate command to well... rotate it.
Best,
Mark
You can use the revRotatePoly command to rotate line graphics:
revrotatepoly the long id of grc id 1003,45
The easiest way to create an interface for rotating objects probably is to use a slider.
I have noticed that rotating line graphics may make the graphic object smaller in size. Also, resetting the rect of the graphic to the original values distorts the rotation. Rotating a graphic is therefore probably not what you want. Try creating a transparent image with equal height and width and a line drawn over it instead. Import the image and use the rotate command to well... rotate it.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi Mark,
Thanks for your information. I need more time to study your suggested method.
However I found the "choose graphic line tool" quite suitable for my project. The users can draw, move and adjust the line angle freely and easily. The only problem is that I don't know how to reset the cursor to normal after drawing and adjust a line?
Thanks and best regards
Thanks for your information. I need more time to study your suggested method.
However I found the "choose graphic line tool" quite suitable for my project. The users can draw, move and adjust the line angle freely and easily. The only problem is that I don't know how to reset the cursor to normal after drawing and adjust a line?
Thanks and best regards
Alex
Nice to meet all of you.
Nice to meet all of you.
Code: Select all
choose browse tool
Code: Select all
--before the end of your handler:
send "changeback" to me in 0.1 seconds
--additional handler:
on changeback
choose browse tool
end changeback
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Hi BvG,
Thanks for your help. But I don't know where to add the codes.
There is a button "Line Tool" and a graphic "Graph" on the card. When I click on the button "Line Tool", the mouse cursor change to a crosshair. Then I draw a new line on the graphic "Graph". I need to change the cursor to browse cursor when I satisfy with location and position of the new line.
Thanks and best regards
Thanks for your help. But I don't know where to add the codes.
There is a button "Line Tool" and a graphic "Graph" on the card. When I click on the button "Line Tool", the mouse cursor change to a crosshair. Then I draw a new line on the graphic "Graph". I need to change the cursor to browse cursor when I satisfy with location and position of the new line.
Thanks and best regards
Alex
Nice to meet all of you.
Nice to meet all of you.
Hi Alex,
Why don't you make a tools palette, just like Revolution? A palette will allow you to click buttons to choose a different tool, regardless of what the currently chosen tool is.
Best,
Mark
Why don't you make a tools palette, just like Revolution? A palette will allow you to click buttons to choose a different tool, regardless of what the currently chosen tool is.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode