It is currently March 28th, 2024, 6:37 pm

Weather temperature Dynamic arrow

Get help with creating, editing & fixing problems with skins
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Weather temperature Dynamic arrow

Post by xenium »

Hi, i want to make an arrow, moving up and down along a color scale and show the weather temperature value ?
It's possible?

like this:

Image

Thanks
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Weather temperature Dynamic arrow

Post by xenium »

Sorry,
I do not know why the image is not displayed
url:https://ibb.co/cONS6m
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather temperature Dynamic arrow

Post by balala »

xenium wrote:Hi, i want to make an arrow, moving up and down along a color scale and show the weather temperature value ?
It's possible?
Definitely. I suppose you have the measure which returns the temperature. Let's name this as [MeasureTemp]. Also suppose you have the image of the arrow (Arrow.png).
Then the Image meter showing the arrow should have the following form:

Code: Select all

[MeterInd]
Meter=Image
ImageName=#@#Arrow.png
X=0
Y=([MeterLine:H]*([MeasureTemp]-#Min#)/(#Max#-#Min#))
DynamicVariables=1
You have to be careful to the following details:
  • In the above code, [MeterLine] is the meter with the color scale. Probably you have named it otherwise, replace its name.
  • Define the Max and Min variables, in the [Variables] section of your skin. These variable must be equal with the largest and lowest value respectively, which can be properly shown by your skin (if the temperature is equal with Min the arrow will be at the top of the color scale and if it is equal to Max, at the bottom).
  • A very important option, which must be added to the above Image meter is the DynamicVariables=1, because the meter uses section variables, which don't work without this option. Don't forget it.
If you don't succeed making this to work, please post the code you have so far (or even better, pack the config - which contains the images, too) and post it.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Weather temperature Dynamic arrow

Post by xenium »

It works !!!! :17good Thanks so much !!!
with a small change to the above code (the minimum values were at the top of the color scale)

A small question: how do I display the temperature value on the same line as the arrow, as in the link to the above image?
Now the temperature value is displayed with a line above, as it is in the image

Code: Select all

[Variables]
UpdateRateSeconds=100
URL=https://www.foreca.com/Botswana/Gaborone?tenday
URL1=https://www.foreca.com/Botswana/Gaborone

MinValue=-50
MaxValue=50

ColorTheme=255,255,255,255


######################
#  Measures Section  #
######################

[MeasureTemp]
Measure=Plugin
Plugin=Plugins/WebParser.dll
Url=#URL1#
RegExp="(?siU)<span class=".* txt-xxlarge"><strong>(.*)</strong>.*"
UpdateRate=#UpdateRateSeconds#
StringIndex=1




############################
#  Meters Display Section  #
############################

[MeterScale]
Meter=Image
X=0
Y=0
ImageName=scale.png

[MeterInd]
Meter=Image
ImageName=arrow.png
X=113
Y=([MeterScale:H]*([MeasureTemp]-#MaxValue#)/(#MinValue#-#MaxValue#))
DynamicVariables=1



[MeterTemp]
MeasureName=MeasureTemp
Meter=String
X=150
Y=([MeterScale:H]*([MeasureTemp]-#MaxValue#)/(#MinValue#-#MaxValue#))
StringAlign=Left
FontFace=Tahoma
FontSize=14
FontColor=#ColorTheme#
AntiAlias=1
Text=%1°C
DynamicVariables=1
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Weather temperature Dynamic arrow

Post by eclectic-tech »

Trey changing [MeterTemp] to:

Code: Select all

[MeterTemp]
MeasureName=MeasureTemp
Meter=String
X=R
Y=r
StringAlign=Left
FontFace=Tahoma
FontSize=14
FontColor=#ColorTheme#
AntiAlias=1
Text=%1°C
DynamicVariables=1
'R' means relative to the lower right corner of the previous meter; this meter X location will be directly to the right of the previous one.
'r' means relative to the upper left corner of the previous meter; this meter Y location will be the same as the previous one.

See: https://docs.rainmeter.net/manual/meters/general-options/#XY
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Weather temperature Dynamic arrow

Post by xenium »

it does not work, it still remains with a line above
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Weather temperature Dynamic arrow

Post by eclectic-tech »

xenium wrote:it does not work, it still remains with a line above
Please post a rmskin package, with the skin and your images. There is no line in a string meter, so it probably is related to your images (which we can't see).
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather temperature Dynamic arrow

Post by balala »

xenium wrote:A small question: how do I display the temperature value on the same line as the arrow, as in the link to the above image?
As eclectic-tech said, the best would be indeed to upload your config. But I also would make first a change to your code, let's see if this helps you.
Replace the Y and StringAlign options of the [MeterTemp] meter with the following values:

Code: Select all

[MeterTemp]
...
Y=([MeterInd:H]/2)r
StringAlign=LeftCenter
This solution (but eclectic-tech's solution also) works for me. It also should for you, too.
If it still doesn't, then indeed should upload the packed skin, as eclectic-tech suggested.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Weather temperature Dynamic arrow

Post by xenium »

It works !!!! :17good
Thanks so much !!! :17denial :17denial
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather temperature Dynamic arrow

Post by balala »

xenium wrote:It works !!!! :17good
Which solution works?
Post Reply