How to use a simple fader cap image?
-
I'm using a vertical slider as a volume fader.
I want to use a custom image for the fader cap but making a filmstrip seems a bit wasteful of both time and plugin resources.
How do I implement a simple static fader cap image at the 'movement' point of the slider?
I feel like this is going to be either [1] using LAF to draw the fader cap image at the value point, or [2] using CSS to draw the fader cap as a background image in one of the slider's pseudo elements - but I genuinely have no idea how to look this up in the docs or the API reference.
-
@dannytaurus LAF is the way I'd go
-
@dannytaurus I used LAF for the fader background, slider holes etc, then just g.drawImage in the same Laf function the fader cap PNG. It works.
You have to declare you image like this:
myLAF.loadImage("{PROJECT_FOLDER}3D Slider Black.png", "slider3d");
then you can call it from your graphics api.
The shadows behind the knob are also LAF.
-
C Chazrox referenced this topic
-
@Chazrox Have you set the slider
style
to"Vertical"
? this way you can click on the slider to move it to the actual position (from looking at your screen grab it looks like you're still using the Knob mode). -
@Christoph-Hart I just went back and double checked. It is in fact in vertical mode.
get value part
var y = a[3] - a[3] * obj.valueNormalized - (h + 4) + (h + 6) * obj.valueNormalized;