It is currently October 4th, 2024, 12:43 am
Creating Buttons
-
- Posts: 128
- Joined: May 2nd, 2015, 9:13 am
Re: Creating Buttons
Ahahah thanks! And if that's the case, i think it's good right now, hey, i even added the "Chrome" name under it! i'm a hotshot, lol. Thanks again! I will try to create now more icons like that, and when it is finished, i will definitely share it on my DArt account and here also. Thank you all!!
-
- Developer
- Posts: 22802
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Creating Buttons
Glad to help. Have fun.
-
- Posts: 128
- Joined: May 2nd, 2015, 9:13 am
Re: Creating Buttons
Thank you all again! Really! And sorry for posting so many things together! Thank you, you are awesome!! Be well and happy!!
-
- Posts: 50
- Joined: May 19th, 2017, 4:03 pm
Re: Creating Buttons
I have a question for using images for buttons, say I want to use 3 totally separate image files (1.bmp, 2.bmp, 3.bmp) for one button, how would I go about writing the code for that?
Thanks.
Thanks.
Cellinarac
-
- Rainmeter Sage
- Posts: 16623
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Creating Buttons
Supposing you don't want to create the image of the button (as it is described in jsmorley's first post of this thread), you should create the following image meter:Cellinarac wrote:I have a question for using images for buttons, say I want to use 3 totally separate image files (1.bmp, 2.bmp, 3.bmp) for one button, how would I go about writing the code for that?
Thanks.
Code: Select all
[MeterButton]
Meter=Image
ImageName=#@#1.bmp
...
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "#@#2.bmp"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageName "#@#1.bmp"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
LeftMouseDownAction=[!SetOption #CURRENTSECTION# ImageName "#@#3.bmp"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
LeftMouseUpAction=[!SetOption #CURRENTSECTION# ImageName "#@#1.bmp"]...ADD HERE THE NEEDED BANGS...[!UpdateMeter "#CURRENTSECTION#"][!Redraw]
Just as a side note, it's not the best idea to use bmp images. It's possible, however it's not desirable.
Also note that normally the same requirements apply to the three images, as those describes by jsmorley, in the above mentioned post.
-
- Posts: 50
- Joined: May 19th, 2017, 4:03 pm
Re: Creating Buttons
ok thanks, that works for me because, honestly its faster for me to make different images and then adjust color, contrast and other effects for each than to make them and try to perfectly align them into one image. I hate when the button moves, even the slightest and to me it's to tedious to try splitting it into perfect 1/3s using paint. I'm just picky like that I guess lol
Cellinarac
-
- Developer
- Posts: 22802
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Creating Buttons
You might look at alternative 2 here: https://docs.rainmeter.net/tips/button-images/Cellinarac wrote:ok thanks, that works for me because, honestly its faster for me to make different images and then adjust color, contrast and other effects for each than to make them and try to perfectly align them into one image. I hate when the button moves, even the slightest and to me it's to tedious to try splitting it into perfect 1/3s using paint. I'm just picky like that I guess lol
Mind you, I'm not opposed to 3 images and an Image meter rather than a Button meter, but do be aware that using LeftMouseDownAction means you can't drag the skin if the cursor is on that image, since Rainmeter is intercepting the down state that Windows would use for dragging. Just be sure you have other places in the skin you can use for dragging, or you will need to hold down CTRL to do so.
-
- Posts: 50
- Joined: May 19th, 2017, 4:03 pm
-
- Posts: 50
- Joined: May 19th, 2017, 4:03 pm
Re: Creating Buttons
ok, back with another problem with buttons... I have created about 10 for my desktop I have been working on, however I have come across yet another issue. Dragging them around seems to not be an option for these. I have checked settings under rainmeter and also the skin settings to make sure it wasn't turned off. it isn't disabled anywhere. however I can't move these buttons around which is making things a little difficult for me. now, if I move the text on the button, off to the side of the button, say making the text a X=250 so that it's not sitting on the button at all, then I can click on the text and move the button. otherwise it wont allow me to move it and its a little annoying. here is the code to one of these buttons, the rest are pretty much the same other than text and image used
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
[MeterLaunch1]
Meter=Button
Y=1
ButtonImage=#@#Images\Blue.png
LeftMouseUpAction=["D:\Shows"]
LeftMouseDownAction=PLAY #@#Sounds\beep2.wav
AntiAlias=1
[Metertext]
Meter=String
Y=5
X=35
StringAlign=Middle
Fontface=Arial bold
FontSize=16
FontColor=10,10,10,255
Antialias=1
Text=Shows
StringEffect=BORDER
FontEffectColor=255,255,255,255
Cellinarac
-
- Developer
- Posts: 22802
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Creating Buttons
The point of using Button instead of 3 images and an Image meter is that you DON'T use LeftMouseDownAction. That mouse action will disable dragging of the skin when the cursor is on the button image, as I explained before.
Use ButtonCommand instead of LeftMouseDownAction and LeftMouseUpAction.
https://docs.rainmeter.net/manual/meters/button/#ButtonCommand
[MeterLaunch1]
Meter=Button
Y=1
ButtonImage=#@#Images\Blue.png
ButtonCommand=["D:\Shows"][PLAY "#@#Sounds\beep2.wav"]
Use ButtonCommand instead of LeftMouseDownAction and LeftMouseUpAction.
https://docs.rainmeter.net/manual/meters/button/#ButtonCommand
[MeterLaunch1]
Meter=Button
Y=1
ButtonImage=#@#Images\Blue.png
ButtonCommand=["D:\Shows"][PLAY "#@#Sounds\beep2.wav"]