It is currently April 27th, 2024, 5:01 pm

Changing Button?

Get help with creating, editing & fixing problems with skins
zapps
Posts: 14
Joined: November 18th, 2012, 3:31 am

Changing Button?

Post by zapps »

No idea where I'd post this so I thought why not here

Anyways would someone be able to make me a button where after every 20-30 minutes it'd start flashing red and white? And when you'd click it, it'd go grey waiting another 20-30 minutes to start flashing again.
Last edited by zapps on December 16th, 2012, 12:52 am, edited 2 times in total.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Request] Flashing button

Post by jsmorley »

zapps
Posts: 14
Joined: November 18th, 2012, 3:31 am

Re: [Request] Flashing button

Post by zapps »

Alright well, would anyone know how to make something like this?
I really don't want to take the time to learn how to make it so if you could help me through it I'd appreciate it
Eastwood
Posts: 35
Joined: November 1st, 2012, 10:50 pm

Re: [Request] Flashing button

Post by Eastwood »

I'm thinking about gif's now.
Have a look at how counters work:
http://docs.rainmeter.net/tips/counters-guide
And let the button change "ButtonImage" after the counter reached a certain value.
(!SetOption SomeButtonMeter ButtonImage "New image file")
The button in its first stage should be a static gif
The flashing button uses an animated gif instead.

Not sure if rainmeter allows the usage of animated gif's, but I would try that out myselves, rather than looking for rainmeter reference info.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Request] Flashing button

Post by jsmorley »

Eastwood wrote:I'm thinking about gif's now.
Have a look at how counters work:
http://docs.rainmeter.net/tips/counters-guide
And let the button change "ButtonImage" after the counter reached a certain value.
(!SetOption SomeButtonMeter ButtonImage "New image file")
The button in its first stage should be a static gif
The flashing button uses an animated gif instead.

Not sure if rainmeter allows the usage of animated gif's, but I would try that out myselves, rather than looking for rainmeter reference info.
http://docs.rainmeter.net/tips/animated-gif-files
Eastwood
Posts: 35
Joined: November 1st, 2012, 10:50 pm

Re: [Request] Flashing button

Post by Eastwood »

Right...

I've seen that topic before, and even downloaded GifFrame.exe for future experimenting.
I can not see why I have forgotten this :???:
Seems I'm keen to learn... multiple times.

Thanks for pointing out.
I already noticed that my giftest skin only lets me see the first frame.

Considering Zapps problem: forget about Gif files, and go straight with bitmaps.
As he would have to make a gif file, and tear it apart to frames after all.
http://docs.rainmeter.net/manual/meters/bitmap

When using an existing gif file, I personally would choose Method Two: Converting a .GIF to a Multiple Frame "Bitmap" Image.
As a graphics designer, I would rather work with one "big" file, than several smaller ones.
Plus, using the "BitmapFrames" and "BitmapExtend" options makes a nicer and more compact code.
zapps
Posts: 14
Joined: November 18th, 2012, 3:31 am

Re: [Request] Flashing button

Post by zapps »

Sorry for the very late response but I have no idea how to set any of this up.
zapps
Posts: 14
Joined: November 18th, 2012, 3:31 am

Re: Flashing button

Post by zapps »

Actually, does anyone know what's wrong with this?
At the current moment nothing shows up.

[Rainmeter]
Update=1000
LeftMouseUpAction=!SetVariable Reset 0

[Meter]
Meter=Image
ImageName=#Image#.png




[Variables]
MaxNumber=30
Pause=1
Reset=1


[cCounter]
Measure=Calc
Formula=(cCounter+1)*#Reset#
IfAboveValue=#MaxNumber#
IfBelowValue=1
IfAboveAction=[!Disable cCounter][!SetVariable Image 1]
IfBelowAction=[!SetVariable Reset 1][!SetVariable Image 2]
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Flashing button

Post by eclectic-tech »

zapps wrote:Actually, does anyone know what's wrong with this?
At the current moment nothing shows up.

Code: Select all

[Rainmeter]
Update=1000
LeftMouseUpAction=!SetVariable Reset 0

[Meter]
Meter=Image
ImageName=#Image#.png




[Variables]
MaxNumber=30
Pause=1
Reset=1


[cCounter]
Measure=Calc
Formula=(cCounter+1)*#Reset#
IfAboveValue=#MaxNumber#
IfBelowValue=1
IfAboveAction=[!Disable cCounter][!SetVariable Image 1]
IfBelowAction=[!SetVariable Reset 1][!SetVariable Image 2]
Your code is close, but a couple of things need to be changed...

You need to use DynamicVariables=1 on measures and meters if there are variables in them that might change.

Use !SetOption instead of !SetVariable to change meter options and then [!Redraw]

You need to define the #Image# variable so it shows on load or refresh.

Lastly, you tried to disabled the measure after the maxnumber, so the skin stops doing anything...
the correct code to disable is !DisableMeasure

This code should get you close to what you want.
Left-click the image to reset the counter, after the counter goes above 30, the image will change... left-click to reset and the original image appears... then repeats the process.

Code: Select all

[Rainmeter]
Update=1000
LeftMouseUpAction=[!SetVariable Reset 0]

[Variables]
MaxNumber=30
Pause=1
Reset=1
Image=2

[cCounter]
Measure=Calc
Formula=(cCounter+1)*#Reset#
IfAboveValue=#MaxNumber#
IfAboveAction=[!SetOption Meter ImageName 1][!Redraw]
IfBelowValue=1
IfBelowAction=[!SetVariable Reset 1][!SetOption Meter ImageName 2][!Redraw]
DynamicVariables=1

[Meter]
Meter=Image
ImageName=#Image#
DynamicVariables=1
zapps
Posts: 14
Joined: November 18th, 2012, 3:31 am

Re: Changing Button?

Post by zapps »

thanks a ton