It is currently April 28th, 2024, 4:05 pm

Changing Button?

Get help with creating, editing & fixing problems with skins
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Changing Button?

Post by eclectic-tech »

zapps wrote:thanks a ton
Glad to help
zapps
Posts: 14
Joined: November 18th, 2012, 3:31 am

Re: Changing Button?

Post by zapps »

Actually, it stops changing back directly after.
Nothing sets the counter back to 0.

EDIT: Nevermind, for some reason it just never changes back though.
zapps
Posts: 14
Joined: November 18th, 2012, 3:31 am

Re: Changing Button?

Post by zapps »

Bump just incase you didn't see.

EDIT: I take it back, didn't work for a second.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Changing Button?

Post by eclectic-tech »

zapps wrote:Actually, it stops changing back directly after.
Nothing sets the counter back to 0.

EDIT: Nevermind, for some reason it just never changes back though.
I not sure what you are trying to do, but the code I returned to you never disables the counter, it will continue to count until you click on the image. If it is below a count of 30 the image will stay, if you click after the image changes, then it resets the counter and image and starts over again.

To make it loop (blink once every 30 seconds), you would need to change the counter measure to reset itself after a certain number...

Formula=((cCounter+1)%(#MaxNumber#+1))*#Reset#

And change your IfAboveValue=(#MaxNumber#-1)
zapps
Posts: 14
Joined: November 18th, 2012, 3:31 am

Re: Changing Button?

Post by zapps »

Whoops, meant "nevermind it's working now".

So now I'm trying to make it so that image 1 is animated. I set it up so that it's a png with 2 frames but where and how would I put this into the skin?
zapps
Posts: 14
Joined: November 18th, 2012, 3:31 am

Re: Changing Button?

Post by zapps »

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

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

[MeasureRc]
Measure=CALC
Formula=Counter % 1


[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#
MeasureName=MeasureRc
DynamicVariables=1
BitmapImage=1.png
BitmapFrames=2
BitmapExtend=1

This is the best shot I could give it, image 1 is now a png with 2 frames.
It just sticks to that and keeps flashing.

EDIT: I'll list my questions as so

1. How do I go about making the AboveValue image an animated one?

2. How do I make it so one can only click it once the value is over red? If you do it beforehand the counter breaks. (Would I be able to do this with a var? Like let's say you can only click it once var1=1. So I'd add [!SetVariable var1 1] to AboveValueAction and when I clicked the image I'd add [!SetVariable var1 0] to the left mouse action. I just don't know how I'd make it so like the LeftMouseUpAction is like an IfThen Statement.

3. How do I set it to the pointer icon for when the mouse is hovering over it?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Changing Button?

Post by eclectic-tech »

zapps wrote:This is the best shot I could give it, image 1 is now a png with 2 frames.
It just sticks to that and keeps flashing.

EDIT: I'll list my questions as so

1. How do I go about making the AboveValue image an animated one?

2. How do I make it so one can only click it once the value is over red? If you do it beforehand the counter breaks. (Would I be able to do this with a var? Like let's say you can only click it once var1=1. So I'd add [!SetVariable var1 1] to AboveValueAction and when I clicked the image I'd add [!SetVariable var1 0] to the left mouse action. I just don't know how I'd make it so like the LeftMouseUpAction is like an IfThen Statement.

3. How do I set it to the pointer icon for when the mouse is hovering over it?
(Sorry for the delayed response... TZ differences... ZZzzzzzz)
If you put your "code" inside CODE tags it is easier to read ;-)

(Question 1):
Create 1.png is red/white 2-frame image (the above value image)
Create 2.png is gray/white 2 frame image (the below value image); you could make it solid gray...
Changed Rc measure to Formula=Counter % 2; now counts 0,1,0,1,...
Corrected bitmap meter to use #image# variable

(Question 2):
Added a measure to return "1" until cCounter is above MaxNumber, then returns "0" to reset
Changed mouse action to return this measure

(Question 3):
Moved mouse action to the meter (now will show mouse over pointer)

Code: Select all

[Rainmeter]
Update=1000

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

[MeasureAboveValue]
Measure=Calc
Formula=(cCounter<#MaxNumber#)? 1:0

[MeasureRc]
Measure=CALC
Formula=Counter % 2

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

[Meter]
Meter=Bitmap
MeasureName=MeasureRc
BitmapImage=#Image#.png
BitmapFrames=2
BitmapExtend=1
LeftMouseUpAction=[!SetVariable Reset [MeasureAboveValue]]
DynamicVariables=1
zapps
Posts: 14
Joined: November 18th, 2012, 3:31 am

Re: Changing Button?

Post by zapps »

almost perfect, just a few small things

1. edit: -fixed-

2. am I able to change the rate at which the frames change?

3. does rainmeter support playing audio files?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Changing Button?

Post by eclectic-tech »

zapps wrote:almost perfect, just a few small things

1. edit: -fixed-

2. am I able to change the rate at which the frames change?

3. does rainmeter support playing audio files?
#1: See... it's not difficult :D

#2: In the [Rainmeter] section, Update=1000 sets the skin update rate to 1 second (1,000 milliseconds)...
For most simple animations, you could lower this to increase the update speed on all measures and meters (try 50~100). This will increase the load Rainmeter places on your system, but with only a few animations this is should not be a problem.
Note: You can also control the Bitmap using transition frames, but that is a much more involved process... :uhuh:

#3: Yes, only .wav files internally; see Play... notice this 'Bang' does not use "!" in front of the command.
zapps
Posts: 14
Joined: November 18th, 2012, 3:31 am

Re: Changing Button?

Post by zapps »

Do I have to define the file somewhere?

Code: Select all

IfAboveAction=[!SetOption Meter BitmapImage 1][!Redraw][PlayLoop "entropy.wav"]

IfBelowAction=[!SetVariable Reset 1][!SetOption Meter BitmapImage 2][!Redraw][PlayStop]
Doesn't seem to be working.