I need a "slider" in a circle

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

I need a "slider" in a circle

Richmond Mathewson via use-livecode
Hello Livecode group,

I have a situation where we need a slider, not a straight line, but as a
circle. I thing Scott Rossi did a demo of this at San Diego LC conference,
but I can't find the code samples to check. I just need to restrict the
movement to a circle when the user moves their finger. Maybe there is some
kind of dial example somewhere???

All I am looking to do is move the slider in the semi-circle to move the
value forward or backwards.

Thanks,

Todd
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I need a "slider" in a circle

Richmond Mathewson via use-livecode
Hi Todd,

I found my slides to the 2013 liveCode conference, where I did circle sliders using animation engine. If that is of interest, let me know.

Cheers,

Malte


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I need a "slider" in a circle

Richmond Mathewson via use-livecode
In reply to this post by Richmond Mathewson via use-livecode

> Il giorno 04/lug/2017, alle ore 16:20, Todd Fabacher via use-livecode <[hidden email]> ha scritto:
>
> Hello Livecode group,
>
> I have a situation where we need a slider, not a straight line, but as a
> circle. I thing Scott Rossi did a demo of this at San Diego LC conference,
> but I can't find the code samples to check. I just need to restrict the
> movement to a circle when the user moves their finger. Maybe there is some
> kind of dial example somewhere???
>
> All I am looking to do is move the slider in the semi-circle to move the
> value forward or backwards.
>
> Thanks,
>
> Todd




using math:

constant kDelay=10 //0,1,100…
local sMove
on mouseDown
   put true into sMove
   moveMe
end mouseDown

on mouseUp
   put false into sMove
end mouseUp

on mouseRelease
   put false into sMove
end mouseRelease

on moveMe
   if not(sMove) then exit moveMe
   put (the width of grc "circle")/2 into R
   put (item 1 of the loc of grc "circle") into x0
   put (item 2 of the loc of grc "circle") into y0
   put min(MAX(the mouseH, the left of grc "circle"), the right of grc "circle") into x
   put min(MAX(the mouseV, item 2 of the loc of grc "circle"), the bottom of grc "circle") into y
   put sqrt(R^2 - (x-x0)^2)+y0 into y
   set the loc of me to x,y
   put trunc(x),trunc(y) into fld "values"
   send "moveMe" to me in kDelay millisec
end moveMe

/*******
recipe:
- have an oval named "circle". and be it a circle…
- have a grc/img with the above script
- have a field named "values", just to collect the values
- adjust kDelay for your needs
- feel free to hide the oval
- do what you need with values
********/


regards.
re.mu.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I need a "slider" in a circle

Richmond Mathewson via use-livecode
In reply to this post by Richmond Mathewson via use-livecode
Why not use a circular widget in the form of a dial?

Richmond.

On 7/4/17 5:20 pm, Todd Fabacher via use-livecode wrote:

> Hello Livecode group,
>
> I have a situation where we need a slider, not a straight line, but as a
> circle. I thing Scott Rossi did a demo of this at San Diego LC conference,
> but I can't find the code samples to check. I just need to restrict the
> movement to a circle when the user moves their finger. Maybe there is some
> kind of dial example somewhere???
>
> All I am looking to do is move the slider in the semi-circle to move the
> value forward or backwards.
>
> Thanks,
>
> Todd
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I need a "slider" in a circle

Richmond Mathewson via use-livecode
In reply to this post by Richmond Mathewson via use-livecode
Hmm . . .

I've made myself a jaggy circle by setting the points of an irregular
polygon to a
sequence generated with a merry sine/cosine function . . .

Now it's "dead easy (whatever that's supposed to mean) to animate a
"knob" round a "dial" as in:

move grc "KNOB" to the points of grc "DIAL"

BUT what would be a lot more fun would be a "knob" that could be moved
by the end-user with a mouse (or a finger on a tablet)
by a sort of grab command, but in such a way that its movement was
constrained to the points of the pathway graphic.

Thoughts . . .

Richmond.

On 7/4/17 5:20 pm, Todd Fabacher via use-livecode wrote:

> Hello Livecode group,
>
> I have a situation where we need a slider, not a straight line, but as a
> circle. I thing Scott Rossi did a demo of this at San Diego LC conference,
> but I can't find the code samples to check. I just need to restrict the
> movement to a circle when the user moves their finger. Maybe there is some
> kind of dial example somewhere???
>
> All I am looking to do is move the slider in the semi-circle to move the
> value forward or backwards.
>
> Thanks,
>
> Todd
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I need a "slider" in a circle

Richmond Mathewson via use-livecode
In reply to this post by Richmond Mathewson via use-livecode
Here is a version that would work for a complete circle:

global cw,ch,cx,cy,offx,offy

on mousedown
   put the width of graphic "circle" / 2 into cw
   put the height of graphic "circle" / 2 into ch
   put the left of graphic "circle" + cw into cx
   put the top of graphic "circle" + ch into cy
   put the width of me / 2 into offx
   put the height of me / 2 into offy
   moveme
end mousedown

on moveme
   local dx,dy,ang
   put the mouseh - cx into dx
   put the mousev - cy  into dy
   put atan2(dy,dx) into ang
   set the left of me to cos(ang) * cw - offx + cx
   set the top of me to sin(ang) * ch - offy + cy
   if the mouse is down then send moveme to me in 3 ticks
end moveme


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I need a "slider" in a circle

Richmond Mathewson via use-livecode
In reply to this post by Richmond Mathewson via use-livecode
And, NO: this does NOT help at all:
http://forums.livecode.com/viewtopic.php?f=7&t=27672

Richmond.

On 7/4/17 7:25 pm, Richmond Mathewson wrote:

> Hmm . . .
>
> I've made myself a jaggy circle by setting the points of an irregular
> polygon to a
> sequence generated with a merry sine/cosine function . . .
>
> Now it's "dead easy (whatever that's supposed to mean) to animate a
> "knob" round a "dial" as in:
>
> move grc "KNOB" to the points of grc "DIAL"
>
> BUT what would be a lot more fun would be a "knob" that could be moved
> by the end-user with a mouse (or a finger on a tablet)
> by a sort of grab command, but in such a way that its movement was
> constrained to the points of the pathway graphic.
>
> Thoughts . . .
>
> Richmond.
>
> On 7/4/17 5:20 pm, Todd Fabacher via use-livecode wrote:
>> Hello Livecode group,
>>
>> I have a situation where we need a slider, not a straight line, but as a
>> circle. I thing Scott Rossi did a demo of this at San Diego LC conference,
>> but I can't find the code samples to check. I just need to restrict the
>> movement to a circle when the user moves their finger. Maybe there is some
>> kind of dial example somewhere???
>>
>> All I am looking to do is move the slider in the semi-circle to move the
>> value forward or backwards.
>>
>> Thanks,
>>
>> Todd
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I need a "slider" in a circle

Richmond Mathewson via use-livecode
In reply to this post by Richmond Mathewson via use-livecode
In the version I did you can also squash the oval in either direction, and the button still hugs the edge.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I need a "slider" in a circle

Richmond Mathewson via use-livecode
In reply to this post by Richmond Mathewson via use-livecode
On 07/04/2017 07:20 AM, Todd Fabacher via use-livecode wrote:

> Hello Livecode group,
>
> I have a situation where we need a slider, not a straight line, but as a
> circle. I thing Scott Rossi did a demo of this at San Diego LC conference,
> but I can't find the code samples to check. I just need to restrict the
> movement to a circle when the user moves their finger. Maybe there is some
> kind of dial example somewhere???
>
> All I am looking to do is move the slider in the semi-circle to move the
> value forward or backwards.

Maybe start with Bernd's gauge control? It's rather nicely done.

http://forums.livecode.com/viewtopic.php?f=93&t=29348

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I need a "slider" in a circle

Richmond Mathewson via use-livecode
In reply to this post by Richmond Mathewson via use-livecode
Yet another solution: RotationControl.

This is a control I recently made for use at LC Global in November:

An "ovalslider"-group that is under the control of a behavior button.
Attach the behavior to any LC-Object that has an angle property.

Runs with LC 6/7/8/9 on Mac/Win/linux or with LC 6/7 on Raspi.
For mobile (or at any rate ...) you may have to adjust the layout of
the slider-group(basics are already in the behavior script).

Download the stack (590 KByte because of two demo images, the script
is short) from "sample stacks" of the LC toolbar or from

http://livecodeshare.runrev.com/stack/837/RotationControl

[p.s. There is also a new cool TinyIDE from Andy at livecodeshare!]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I need a "slider" in a circle

Richmond Mathewson via use-livecode
In reply to this post by Richmond Mathewson via use-livecode
Just to 'complete' this thread.

Detected today a good solution by Roger Guay from 2012, still up-to-date
(this solution is in between a full gauge and a circular slider)

http://livecodeshare.runrev.com/stack/645/RadialDialOmatic

> Yet another solution: RotationControl.
>
> This is a control I recently made for use at LC Global in November:
> An "ovalslider"-group that is under the control of a behavior button.
> Attach the behavior to any LC-Object that has an angle property.
> Runs with LC 6/7/8/9 on Mac/Win/linux or with LC 6/7 on Raspi.
> For mobile (or at any rate ...) you may have to adjust the layout of
> the slider-group(basics are already in the behavior script).
> Download the stack (590 KByte because of two demo images, the script
> is short) from "sample stacks" of the LC toolbar or from
>
> http://livecodeshare.runrev.com/stack/837/RotationControl
>
> [p.s. There is also a new cool TinyIDE from Andy at livecodeshare!]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I need a "slider" in a circle

Richmond Mathewson via use-livecode
Thanks very much for the compliment, but give mea day to upload the latest. I’ve made significant improvements to RadialDialOmatic since the original upload. Right now I have to leave for a concert at  Ste. Michelle Winery!!.

Cheers,

Roger



> On Jul 9, 2017, at 1:13 PM, hh via use-livecode <[hidden email]> wrote:
>
> Just to 'complete' this thread.
>
> Detected today a good solution by Roger Guay from 2012, still up-to-date
> (this solution is in between a full gauge and a circular slider)
>
> http://livecodeshare.runrev.com/stack/645/RadialDialOmatic
>
>> Yet another solution: RotationControl.
>>
>> This is a control I recently made for use at LC Global in November:
>> An "ovalslider"-group that is under the control of a behavior button.
>> Attach the behavior to any LC-Object that has an angle property.
>> Runs with LC 6/7/8/9 on Mac/Win/linux or with LC 6/7 on Raspi.
>> For mobile (or at any rate ...) you may have to adjust the layout of
>> the slider-group(basics are already in the behavior script).
>> Download the stack (590 KByte because of two demo images, the script
>> is short) from "sample stacks" of the LC toolbar or from
>>
>> http://livecodeshare.runrev.com/stack/837/RotationControl
>>
>> [p.s. There is also a new cool TinyIDE from Andy at livecodeshare!]
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: I need a "slider" in a circle

Richmond Mathewson via use-livecode
I just uploaded the latest version of RadialDialOmatic to Rev Sample Stacks.

> http://livecodeshare.runrev.com/stack/838/RadialDialOmatic <http://livecodeshare.runrev.com/stack/838/RadialDialOmatic>
All The best,

Roger


> On Jul 9, 2017, at 3:56 PM, Roger Guay via use-livecode <[hidden email]> wrote:
>
> Thanks very much for the compliment, but give mea day to upload the latest. I’ve made significant improvements to RadialDialOmatic since the original upload. Right now I have to leave for a concert at  Ste. Michelle Winery!!.
>
> Cheers,
>
> Roger
>
>
>
>> On Jul 9, 2017, at 1:13 PM, hh via use-livecode <[hidden email]> wrote:
>>
>> Just to 'complete' this thread.
>>
>> Detected today a good solution by Roger Guay from 2012, still up-to-date
>> (this solution is in between a full gauge and a circular slider)

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...