It is currently April 26th, 2024, 9:17 pm

request for personal skin

Get help with creating, editing & fixing problems with skins
User avatar
gsrd90
Posts: 2
Joined: December 28th, 2021, 8:37 am

request for personal skin

Post by gsrd90 »

Hello,
I would need a little help concerning a personal skin that I would like to put in place on my desk.
I am new to code, and I would like to add a click effect (with another image)

no click > Image
click > Image

What is the line of code to add to do this?

my current code :

Code: Select all

[Rainmeter]
Update=
Author=gsrd90

[Button]
Meter=Image
ImageName=reddit.png
LeftMouseUpAction=!Execute ["https://www.reddit.com/"]
Thank you in advance for your answers :)
Last edited by gsrd90 on December 28th, 2021, 8:07 pm, edited 1 time in total.
User avatar
David8192
Posts: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: request for personal skin

Post by David8192 »

gsrd90 wrote: December 28th, 2021, 8:56 am Hello,
I would need a little help concerning a personal skin that I would like to put in place on my desk.
I am new to code, and I would like to add a click effect (with another image)

no click > Image
click > Image

What is the line of code to add to do this?

my current code :

Code: Select all

[Rainmeter]
Update=
Author=gsrd90

[Button]
Meter=Image
ImageName=reddit.png
LeftMouseUpAction=!Execute ["https://www.reddit.com/"]
Thank you in advance for your answers :)
Try this: https://docs.rainmeter.net/manual/meters/button/
the DA GALLERY 8-) For some Reason, the square root of X2 does not involve X
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: request for personal skin

Post by balala »

David8192 wrote: December 28th, 2021, 11:11 am Try this: https://docs.rainmeter.net/manual/meters/button/
Yep, Button meter is a good option, however it has the disadvantage of having to create the proper image, used by the meter. Definitely can be done, but not sure it worth. And additionally OP has already started to work with an Image meter, so...
However if there is needed, here is a description on how to create the image.
gsrd90 wrote: December 28th, 2021, 8:56 am Hello,
I would need a little help concerning a personal skin that I would like to put in place on my desk.
I am new to code, and I would like to add a click effect (with another image)

no click > Image
click > Image

What is the line of code to add to do this?
Try to add the following LeftMouseDownAction option and modify the already posted LeftMouseUpAction to the following ones:

Code: Select all

[Button]
...
LeftMouseDownAction=[!SetOption Button ImageName "reddit2.png"][!UpdateMeter "Button"][!Redraw]
LeftMouseUpAction=[!SetOption Button ImageName "reddit.png"]["https://www.reddit.com/"][!UpdateMeter "Button"][!Redraw]
Note here that reddit.png is the "not clicked" image, while reddit2.png is the clicked one. Modify the names accordingly if you're using other names.
Two additional recommendations here:
  • Even if a while ago (in fact many years ago), the !Execute bang had to be used, in meantime it has been deprecated, so there is no need to use it anymore. I removed it from the above option.
  • The best place for all resources used by a skin is the @Resources folder. It is a good idea to put all such resources (like images) there. Accordingly if you move the images (reddit.png and reddit2.png or whatever) to this folder, add the #@# variable identifier in front of every image name. For instance the ImageName option of the [Button] meter has to be modified a little bit as well as the LeftMouseDownAction and LeftMouseUpAction options. For instance this way:

    Code: Select all

    [Variables]
    [Button]
    Meter=Image
    ImageName=#@#reddit.png
    LeftMouseDownAction=[!SetOption Button ImageName "#@#reddit2.png"][!UpdateMeter "Button"][!Redraw]
    LeftMouseUpAction=[!SetOption Button ImageName "#@#reddit.png"]["https://www.reddit.com/"][!UpdateMeter "Button"][!Redraw]
    Note the #@# identifiers in every place where images are named. Just take care to move the images accordingly, if you're using this approach (which I definitely recommend).
User avatar
death.crafter
Rainmeter Sage
Posts: 1399
Joined: April 24th, 2021, 8:13 pm

Re: request for personal skin

Post by death.crafter »

gsrd90 wrote: December 28th, 2021, 8:56 am Hello,
I would need a little help concerning a personal skin that I would like to put in place on my desk.
I am new to code, and I would like to add a click effect (with another image)

no click > Image
click > Image

What is the line of code to add to do this?

my current code :

Code: Select all

[Rainmeter]
Update=
Author=gsrd90

[Button]
Meter=Image
ImageName=reddit.png
LeftMouseUpAction=!Execute ["https://www.reddit.com/"]
Thank you in advance for your answers :)
Umm, you want to rotate or flip the image? Or change the way it shines... For the later you gotta need two images you yourself edited, cause Rainmeter can't achieve that. For the first, it's easy.
  1. Rotate:

    Code: Select all

    [MeterRedditButton]
    Meter=Image
    ImageName=reddit.png
    ImageRotate=0 
    ; For flip you can use ImageFlip and change between None and Vertical
    LeftMouseDownAction=[!SetOption MeterRedditButton ImageRotate 180][!UpdateMeter MeterRedditButton][!Redraw]
    LeftMouseUpAction=[!SetOption MeterRedditButton ImageRotate 0][!UpdateMeter MeterRedditButton][!Redraw]["https://reddit.com/"]
    
  2. Change shine direction:
    Requirements:Two images with opposite shine directions

    Code: Select all

    [MeterRedditButton]
    Meter=Image
    ImageName=reddit0.png 
    ; reddit1.png has opposite shine
    LeftMouseDownAction=[!SetOption MeterRedditButton ImageName "reddit1.png"][!UpdateMeter MeterRedditButton][!Redraw]
    LeftMouseUpAction=[!SetOption MeterRedditButton ImageName "reddit0.png"][!UpdateMeter MeterRedditButton][!Redraw]["https://reddit.com/"]
    
*beaten by Balala
from the Realm of Death
User avatar
David8192
Posts: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: request for personal skin

Post by David8192 »

balala wrote: December 28th, 2021, 12:52 pm Yep, Button meter is a good option, however it has the disadvantage of having to create the proper image, used by the meter. Definitely can be done, but not sure it worth. And additionally OP has already started to work with an Image meter, so...
Yeah, you are probably right. OP does not need to change direction, that is just a good back pocket idea.
the DA GALLERY 8-) For some Reason, the square root of X2 does not involve X
User avatar
David8192
Posts: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: request for personal skin

Post by David8192 »

death.crafter wrote: December 28th, 2021, 12:54 pm Rotate:

Code: Select all

[MeterRedditButton]
Meter=Image
ImageName=reddit.png
ImageRotate=0 
; For flip you can use ImageFlip and change between None and Vertical
LeftMouseDownAction=[!SetOption MeterRedditButton ImageRotate 180][!UpdateMeter MeterRedditButton][!Redraw]
LeftMouseUpAction=[!SetOption MeterRedditButton ImageRotate 0][!UpdateMeter MeterRedditButton][!Redraw]["https://reddit.com/"]
I think this is a good solution.
the DA GALLERY 8-) For some Reason, the square root of X2 does not involve X
User avatar
gsrd90
Posts: 2
Joined: December 28th, 2021, 8:37 am

Re: request for personal skin

Post by gsrd90 »

Amazing ! thanks ! :)
It works now ! :D :thumbup:
User avatar
David8192
Posts: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: request for personal skin

Post by David8192 »

gsrd90 wrote: December 28th, 2021, 1:17 pm Amazing ! thanks ! :)
It works now ! :D :thumbup:
Glad to help.
the DA GALLERY 8-) For some Reason, the square root of X2 does not involve X
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: request for personal skin

Post by balala »

David8192 wrote: December 28th, 2021, 1:10 pm I think this is a good solution.
There always are more solutions. :great:
User avatar
David8192
Posts: 246
Joined: July 8th, 2021, 11:30 pm
Location: The King's Avenue, Golden Kingdom

Re: request for personal skin

Post by David8192 »

balala wrote: December 28th, 2021, 1:38 pm There always are more solutions. :great:
:lol: Yes.
the DA GALLERY 8-) For some Reason, the square root of X2 does not involve X