Right know I use this:
Code: Select all
[Rainmeter]
Update=1000
[Variables]
Imgname=#@#img.png
[MeterImg]
Meter=Image
ImageName=Imgname
w=50
h=50
Leftmouseupaction=!SetVariable "Imgname" #@#blur.png
Leftmouseupaction=!SetWallpaper Imgname
Code: Select all
[Rainmeter]
Update=1000
[Variables]
Imgname=#@#img.png
[MeterImg]
Meter=Image
ImageName=Imgname
w=50
h=50
Leftmouseupaction=!SetVariable "Imgname" #@#blur.png
Leftmouseupaction=!SetWallpaper Imgname
Try Dynamic variablesjanoot wrote:Thank you for the quick reply, but I'm more interested in making my own skin, so it fits with the style of the other skins I've made.
I need to know how I can let the ImageName respond to a change in variables.
There are only two places where we're using the names of the variables, without including them between two # characters: when we initialize them, within the [Variables] section (as you did) and into the !SetVariable bangs (as you also did into the LeftMouseUpAction). Otherwise every time we want to use the value, we have to include its name between # characters.janoot wrote:Hello, I'm trying to change my Image with variables, but I don't think I get how the variables work yet.
It seems to going wrong already by using "ImageName=Imgname", since the image is not being displayed. The wallpaper doesn't change as well.
When you set a new value to a variable, using the !SetVariable bang, you have to add a DynamicVariables=1 option to the meter or measure where you want to use the variable. Without this option, the meter or measure can't use the new value. Because eg the [Rainmeter] section doesn't accept dynamic variables, you can't use there a dynamically set variable.janoot wrote:I hadn't heard of the dynamic variables thing, but now it works.