It is currently April 27th, 2024, 1:04 pm

Making Images into Buttons

Get help with creating, editing & fixing problems with skins
warlord_7
Posts: 15
Joined: March 27th, 2011, 1:19 pm

Making Images into Buttons

Post by warlord_7 »

Hello,
I've currently 76 images (40x40) and i want make them to play a sound on click (like the button execute command).
But that would require to change all 76 images into Buttons which 1. is a lot of wasted time and 2. I have to change every image.png into a 3layered one (which is rubbish imo, why can't a button just be stationary [or just have one image instead of using this 3 image-system]).
So is there any way to implement a Play Execution command into an Image Meter? (or any other suggestions)
Thanks in advance.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Making Images into Buttons

Post by jsmorley »

Take a deep breath... Meter=Button is just one of several ways to implement an image with attached "actions". Buttons have the advantage of making it falling off a log easy to "animate" the image as it is hovered and clicked, but it is only one alternative for driving actions with images.


[MeterImage01]
Meter=Image
ImageName=MyImage01.png
LeftMouseUpAction=Execute! [PLAY #CURRENTPATH#Image01Sound.wav]["shell:MyComputerFolder"]
warlord_7
Posts: 15
Joined: March 27th, 2011, 1:19 pm

Re: Making Images into Buttons

Post by warlord_7 »

Hm, yeah... would be nice if it worked...
I've now for example:
[Meter1]
Meter=Image
W=40
H=40
ImageName=Image.png
[...]
LeftMouseUpAction=Execute! [PLAY #SKINSPATH#\Sound.wav]

The Sound.wav is located in C:\Users\Admin\Documents\Rainmeter\Skins
(I tried #CURRENTPATH# before, doesn't work either as the Sound.wav was in the same folder where the image is)
And yes the main config has:
[Rainmeter]
SkinPath=C:\Users\Admin\Documents\Rainmeter\Skins\

So shouldn't be the problem.

Although i don't know why you mean by ["shell:MyComputerFolder"]
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Making Images into Buttons

Post by jsmorley »

warlord_7 wrote:Hm, yeah... would be nice if it worked...
I've now for example:
[Meter1]
Meter=Image
W=40
H=40
ImageName=Image.png
[...]
LeftMouseUpAction=Execute! [PLAY #SKINSPATH#\Sound.wav]

The Sound.wav is located in C:\Users\Admin\Documents\Rainmeter\Skins
(I tried #CURRENTPATH# before, doesn't work either as the Sound.wav was in the same folder where the image is)
And yes the main config has:
[Rainmeter]
SkinPath=C:\Users\Admin\Documents\Rainmeter\Skins\

So shouldn't be the problem.

Although i don't know why you mean by ["shell:MyComputerFolder"]
My example had an extra "\" on it. Sorry.

All #PATHVARIABLE# variables already have a trailing "\" on them.

LeftMouseUpAction=Execute! [PLAY #SKINSPATH#Sound.wav]

The shell command was just an example of a second action on a image meter along with the PLAY statement.
warlord_7
Posts: 15
Joined: March 27th, 2011, 1:19 pm

Re: Making Images into Buttons

Post by warlord_7 »

No problem.
Well, i still got the problem that it won't work...
I've made an example Button with sound:

Code: Select all

[SoundButton]
Meter=Button
ButtonImage=button.png
ButtonCommand=PLAY #SKINSPATH#Sounds\Sounds\sound.wav
It works, no problem there (well..expect for this image being split in 3 parts..and only one is shown if you're note mouseover it)
Now the image one:

Code: Select all

[MeterImage01]
Meter=Image
ImageName=Image01Sound.jpg
LeftMouseUpAction=Execute! [PLAY #SKINSPATH#Sounds\Sounds\sound.wav] //Same path that worked on the Button
Doesn't work though :S
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Making Images into Buttons

Post by jsmorley »

You sure about that path? This works just fine for me:

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Meter01]
Meter=Image
W=50
PreserveAspectRatio=1
ImageName=#CURRENTPATH#arrow.png
LeftMouseUpAction=!Execute [PLAY #SKINSPATH#Sounds\NOTIFY.WAV]

So your sound is really in

..My Documents\Rainmeter\Skins\Sounds\Sounds\sound.wav

?
warlord_7
Posts: 15
Joined: March 27th, 2011, 1:19 pm

Re: Making Images into Buttons

Post by warlord_7 »

Yes i'm pretty sure but i found the bug actually...
Look at your first reply:
[MeterImage01]
Meter=Image
ImageName=MyImage01.png
LeftMouseUpAction=Execute! [PLAY #CURRENTPATH#Image01Sound.wav]["shell:MyComputerFolder"]
That "!" was the problem.. in the previous post you set the ! BEFORE the Execute..
Now i thought "wut?Oo am i brainlagged?" ... and wrote !Execute instead of Execute!
You wrote in the first two posts in this format Execute!; now you pasted yours with "!Execute".... well
and... it worked :)
Thanks anyway. (I'm pretty sure that it was the solution since it's the only change I've made)
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Making Images into Buttons

Post by jsmorley »

I think I need to go back to bed...
warlord_7
Posts: 15
Joined: March 27th, 2011, 1:19 pm

Re: Making Images into Buttons

Post by warlord_7 »

No problem :) You should.
Thanks for the fast(!) help. We can't always rely on the poor devs that have to deal with 100 noobyquestion threads at the same time :) Have to think on your own a little instead of repeating 1:1 what a dev said. So ,it's okay. Thanks again for help in an entertaining manner