Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Diagonal slider
Started by John_M Jan 16 2018 08:29 PM

6 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

John_M

[GLOBAL: userInfoPane.html]
John_M
  • Enthusiast

  • 89 posts
  • Corona SDK

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

[TOPIC: post.html]
#2

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 2,985 posts
  • Corona SDK

Set the .rotation property?



[TOPIC: post.html]
#3

John_M

[GLOBAL: userInfoPane.html]
John_M
  • Enthusiast

  • 89 posts
  • Corona SDK

Brilliant idea. I'll try it tonight. Thanks!

[TOPIC: post.html]
#4

SGS

[GLOBAL: userInfoPane.html]
SGS
  • Corona Geek

  • 1,895 posts
  • Corona SDK

you can download the source from github



[TOPIC: post.html]
#5

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 766 posts
  • Corona SDK

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.)



[TOPIC: post.html]
#6

John_M

[GLOBAL: userInfoPane.html]
John_M
  • Enthusiast

  • 89 posts
  • Corona SDK

Thanks so much everyone for the ideas. I'll try all this weekend. I appreciate the help. Corona has such a great community!

[TOPIC: post.html]
#7

John_M

[GLOBAL: userInfoPane.html]
John_M
  • Enthusiast

  • 89 posts
  • Corona SDK

Starcrunch, yes exactly, it's the dragging of an image along a straight line that I'm after. Thanks for all the cool math!


[topic_controls]
[/topic_controls]