If your curve is perfectly circular, you can convert your existing x + y screen coordinates into polar coordinates that originate from the center of your control, then you can clamp the radius to the controls edge and convert them back into screen coordinates. An ellipse could also be managed in a similar manner by weighting the X+Y values.
If you'd like your hat to follow some kind of arbitrary 2D spline curve curve and find mapping from mouse delta's to your 1D parameterization that makes sense.
Announcement
Collapse
No announcement yet.
How would I: Curved Input.
Collapse
X

bwhit started a topic How would I: Curved Input.How would I: Curved Input.
I would like to make a curved input, but I'm struggling a little. I've got something in place where I set the joystick to be halfway off the screen and clamp the top and bottom of the delta y and this works; but I'd like the "hat" to follow the outline of the joystick base (the half circle that's left). Then I thought maybe there's a way to take the default slider and set its properties to be curved somehow, because the hat already follows the slider track, but I really have no idea how I'd begin something like that.
Anyone have any ideas on how I could get the hat to follow the curve, create a curved slider, or any other approach? I'd be grateful for any push in the right direction, thanks for lookin'.Tags: None
Leave a comment: