Hi, Does anyone perhaps have any thoughts on how to make a diagonal slider? Do we have access to the widget newSlider code? I think that might be written in Lua? I’m thinking it might be a good starting point and I’d have to figure out changing X values along with the Y values. Or maybe there’s sample code out there somewhere? Any other thoughts please let me know! Thank you so much
Set the .rotation property?
Brilliant idea. I’ll try it tonight. Thanks!
you can download the source from github
I’m assuming that you’re after the dragging feature of a slider (or clicking on and snapping to a part within it).
The slider bar is a segment between two points A and B. Your touch is “above” or “below” said segment when you care about it. You can draw another segment from this point to the bar, which will be at a 90-degree angle to the bar itself.
Finally, you can draw another segment between either A or B and your touch point.
This is a right triangle. Say we chose A. From A to the point along the bar you have one side, going “up” from there to your touch is another. From A to the touch you have the hypotenuse.
At this point you’re basically dealing with projection and / or rejection. (A little tired at the moment but could elaborate more later, or maybe somebody else will chime in.)
Thanks so much everyone for the ideas. I’ll try all this weekend. I appreciate the help. Corona has such a great community!
Starcrunch, yes exactly, it’s the dragging of an image along a straight line that I’m after. Thanks for all the cool math!
Set the .rotation property?
Brilliant idea. I’ll try it tonight. Thanks!
you can download the source from github
I’m assuming that you’re after the dragging feature of a slider (or clicking on and snapping to a part within it).
The slider bar is a segment between two points A and B. Your touch is “above” or “below” said segment when you care about it. You can draw another segment from this point to the bar, which will be at a 90-degree angle to the bar itself.
Finally, you can draw another segment between either A or B and your touch point.
This is a right triangle. Say we chose A. From A to the point along the bar you have one side, going “up” from there to your touch is another. From A to the touch you have the hypotenuse.
At this point you’re basically dealing with projection and / or rejection. (A little tired at the moment but could elaborate more later, or maybe somebody else will chime in.)
Thanks so much everyone for the ideas. I’ll try all this weekend. I appreciate the help. Corona has such a great community!
Starcrunch, yes exactly, it’s the dragging of an image along a straight line that I’m after. Thanks for all the cool math!