It is currently April 27th, 2024, 7:18 pm

Image rotation using mouse actions

Get help with creating, editing & fixing problems with skins
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: Image rotation using mouse actions

Post by moshi »

did not notice that first:
with your code when you scroll up once for the first time after a refresh you go from 0 to 360.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Image rotation using mouse actions

Post by jsmorley »

moshi wrote:did not notice that first:
with your code when you scroll up once for the first time after a refresh you go from 0 to 360.

Code: Select all

[Rainmeter]
Update=1000

[Variables]
ImageW=195
ImageH=195

[MeasureInc]
Measure=Calc
Formula=360
MinValue=0
MaxValue=360

[MeterKnob]
Meter=Rotator
MeasureName=MeasureInc
ImageName=#@#Images\Knob.png
OffsetX=(#ImageW# / 2)
OffsetY=(#ImageH# / 2)
W=#ImageW#
H=#ImageH#
MouseScrollDownAction=[!SetOption MeasureInc Formula "([MeasureInc] + 10 > 360 ? 10 : ([MeasureInc] + 10))"][!UpdateMeasure MeasureInc][!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetOption MeasureInc Formula "([MeasureInc] - 10 < 10 ? 360 : ([MeasureInc] - 10))"][!UpdateMeasure MeasureInc][!UpdateMeter *][!Redraw]
DynamicVariables=1

[MeterValue]
Meter=String
MeasureName=MeasureInc
X=(#ImageW# / 2)
Y=(#ImageH# / 2)
FontFace=Segoe UI
FontSize=22
FontColor=53,105,51,255
StringStyle=Bold
StringAlign=CenterCenter
AntiAlias=1
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: Image rotation using mouse actions

Post by moshi »

:thumbup:
o2r
Posts: 7
Joined: May 6th, 2012, 12:06 am

Re: Image rotation using mouse actions

Post by o2r »

Now I need to figure out how to set up some conditional code linking the testknob to the hand of an analog clock.

Kind of like:

If the testknob angle measure = roundline angle measure, then play alarm.wav !bang.

It would be a nifty way of setting up an analog alarm clock.