It is currently April 27th, 2024, 4:29 am

Rotating a string meter automatically with formulas

Get help with creating, editing & fixing problems with skins
User avatar
kami
Posts: 39
Joined: July 3rd, 2010, 10:47 am
Location: Canosa di Puglia, Italy

Rotating a string meter automatically with formulas

Post by kami »

I have a string meter and i want to rotate the text by changing the Angle parameter.
Unfortunately this parameter measures values in radians but i need to define it in degrees.
To perform this i thought i could create a particular formula to convert degrees to radians.
The measure is called MeasureAngle and uses a variable #ANGLE# to acquire the value in degrees. The formula is mathematically correct but when i put

Angle=MeasureAngle

between String meter parameters it doesn't work. The text doesn't rotate.
Why?

I attached my ini file's code.

Code: Select all

;VARIABLES
[Variables]
BLACK=Colors\Black.png
ANGLE=20
TEXT=Notepad

;MEASURES

[MeasureAngle]
Measure=Calc
Formula=( ( #ANGLE# / 180 ) * PI )


;METERS

[Icon Meter]
Meter=IMAGE
ImageName=#BLACK#
W=157
AntiAlias=1
PreserveAspectRatio=1
ImageFlip=None
ImageRotate=0
LeftMouseDoubleClickAction=!Execute ["%WINDIR%\notepad.exe"]

[Title Meter]
Meter=STRING
Text=#TEXT#
X=60
Y=22
Angle=MeasureAngle
FontColor=255,255,255,255
FontFace="Trebuchet MS"
StringStyle=Normal
FontSize=12
AntiAlias=1
User avatar
maminscris
Posts: 509
Joined: April 24th, 2009, 3:17 pm
Location: Bucharest, Romania Lat 44,43° Lon 26,1°

Re: Rotating a string meter automatically with formulas

Post by maminscris »

cause you can not use a measure to define an angle
rainmeter reads measure and the value is displayed by a meter
Zero at programing, zero at writing codes, so far 2 at making images
But I'm good at copy/paste, and I not always like this
Image
User avatar
kami
Posts: 39
Joined: July 3rd, 2010, 10:47 am
Location: Canosa di Puglia, Italy

Re: Rotating a string meter automatically with formulas

Post by kami »

Thank you! But how can i solve this?
User avatar
~Faradey~
Posts: 366
Joined: November 12th, 2009, 4:47 pm
Location: Ukraine

Re: Rotating a string meter automatically with formulas

Post by ~Faradey~ »

kami wrote:Thank you! But how can i solve this?
Actually Yes! Here what you need to change
add DynamicVariables=1 and Angle=[MeasureAngle]
Look at the code

Code: Select all

[Title Meter]
Meter=STRING
Text=#TEXT#
X=60
Y=22
Angle=[MeasureAngle]
FontColor=255,255,255,255
FontFace="Trebuchet MS"
StringStyle=Normal
FontSize=12
AntiAlias=1
DynamicVariables=1