Circular Slider

Hey guys, I want to make a circular slider similar to the mock-up I attached. It’ll be used to determine the direction an object will face. How would I go about creating an asset like this?

My initial thoughts are that it would be a subclass of the DirectSlider with some added functionality. Is this doable? Asking for a Panda3D novice.

Thanks for any help.


Hmm… Even if DirectSlider isn’t a good choice of sub-class, it’s likely at the least a good reference-point, and source of useful code.

Rendering the ring might be the trickiest bit, offhand; I might suggest using MeshDrawer2d for that.

Positioning of the thumb should just be a matter of sine and cosine, using the slider’s current value, if I’m not much mistaken.

[edit] Oh, and more generally, it should be quite doable, I think! DirectGUI can be tricky to sub-class–it has some quirks that call for observing, as I recall–but I think that we have information on that on the forum, at least.