It is currently April 19th, 2024, 6:38 pm

Measure as value in String Angle

Get help with creating, editing & fixing problems with skins
hermit
Posts: 2
Joined: February 12th, 2020, 9:01 am

Measure as value in String Angle

Post by hermit »

I have been trying unsuccessfully to use the @CurrentWindDirectionDegrees (from WeatherCom) to angle some text or an image in a Weather skin.

The simplified code below shows what I am trying to achieve - have tried quite a lot of approaches but no success.

Code: Select all

[Rainmeter]
   Update=1000
[WindDirection]
   Measure=Calc
   Formula=222
[WindImage]
   MeasureName=WindDirection	
   Meter=String
   Text=-->
  Angle=%1	
  Font=Century Gothic
  FontColor=255,255,255
  FontSize=16	
  W=50
  H=40
  X=40
  Y=40
Any help would be much appreciated

Cheers ... Peter
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Measure as value in String Angle

Post by balala »

hermit wrote: December 1st, 2021, 11:59 am I have been trying unsuccessfully to use the @CurrentWindDirectionDegrees (from WeatherCom) to angle some text or an image in a Weather skin.
You can't apply it this way. You have to explicitly use the name on the measure which returns the angle, into brackets. Additionally this requires to add a DynamicVariables=1 option to the meter as well. And one ore: if the [WindDirection] measure is returning the angle in degrees, you have to convert this to radians, because the Angle option requires to express the angle in radians, not in degrees. This can be easily done using the Rad function.
Taking all this into account try the following modification:

Code: Select all

[WindImage]
...
Angle=(Rad([WindDirection]))
...
DynamicVariables=1
hermit
Posts: 2
Joined: February 12th, 2020, 9:01 am

Re: Measure as value in String Angle

Post by hermit »

Many thanks balala, it all seems so simple now.

Really just the DynamicVariables that had me messed up - for some reason it never enters this old head.

Anyway thanks again ... peter
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Measure as value in String Angle

Post by balala »

hermit wrote: December 1st, 2021, 12:45 pm Really just the DynamicVariables that had me messed up - for some reason it never enters this old head.
Yep, dynamic variables requires attention. You have to set them up whenever are you using a variable which is changed with a !SetVariable bang somewhere in the code or when using section variables.
However as said, there were other problems in your code, beside the dynamic variables.
Glad if you got it working as expected.