Bars are quite good at indicating the percentual value of a measure. What if you want to move an image in the same fashion? It's quite easy with an Image Meter and some math.
I'm going to refer to the result as a Slider for the purpose of this article.
First some variables that we're going to use.
Code: Select all
[Variables]
StartingX=
StartingY=
OffsetX=
OffsetY=
Height=
Width=
Let's start out with a basic horizontal slider that starts on the left.
Code: Select all
X=(#StartingX#+([Measure:%]/100)*#Width#)
Y=#StartingY#
Lets add some offsets so that we can define which part of the image indicates the measure value.
Code: Select all
X=(#StartingX#+([Measure:%]/100)*#Width#-#OffsetX#)
Y=(#StartingY#-#OffsetY#)
Now we want to center the measure value in the height of the slider.
Code: Select all
X=(#StartingX#+([Measure:%]/100)*#Width#-#OffsetX#)
Y=(#StartingY#-#OffsetY#+#Height#/2)
Changing the direction of the slider is very easy.
Code: Select all
X=(#StartingX#+(1-[Measure:%]/100)*#Width#-#OffsetX#)
Y=(#StartingY#-#OffsetY#+#Height#/2)
We can very easily make the slider vertical instead by switching a few things around.
Code: Select all
Y=(#StartingY#+(1-[Measure:%]/100)*#Height#-#OffsetY#)
X=(#StartingX#-#OffsetX#+#Width#/2)
Important Note: The image used should have a height/width that is an odd number if the center is to be used as the indicator. This will increase the accuracy of the indicator. The specified height/width should also be a factor of 10.