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

MoveMeter not showing my meter

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16166
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MoveMeter not showing my meter

Post by balala »

Deofol wrote: February 25th, 2020, 7:45 pm I'd want EpicIconBackground to move smoothly (50,0) away from SteamIconBackground, as if it was getting pulled from behind of it. I was reading about ActionTimer but to achieve this with it I'd have to set many actions to achieve so where they all move EpicIconBackground's X by 1-2 pixels until reaching 50
With the ActionTimer plugin you can move the meter quicker with smaller but more steps or slower, larger but less steps. Will post a sample code immediately.
User avatar
Yincognito
Rainmeter Sage
Posts: 7155
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MoveMeter not showing my meter

Post by Yincognito »

Deofol wrote: February 25th, 2020, 7:28 pmActually, exactly the opposite. I like this idea a lot. Might even make it so I have to click to pop up all of the launchers. Thanks!
That's excellent then. :thumbup:
balala wrote: February 25th, 2020, 7:30 pm
Doesn't even have to. There is nothing in the code of the [EpicIconBackground] meter which is controlled by any of the [Fade], [EpicFade] or [InvertedFade] measures. I suppose its transparency should be controlled by the [EpicFade] measure, but for this, the Shape option should be Shape=Rectangle 0,0,#IconSize#,#IconSize# | Fill Color 0,0,0,[EpicFade]. But it's not, the transparency is set staticly to 255. So, I'm not sure at all what the [EpicFade] measure should do. Apart from the fact that it is activated into the MouseOverAction / MouseLeaveAction options of the [EpicIconBackground] meter itself, this measure is nowhere used into the code. So, what is its purpose?
The code is not exactly clear to me. Am I missing something?
Yeah, you're probably right. As I said, Lua scripts are not exactly my favorite Rainmeter topic... :D
balala wrote: February 25th, 2020, 7:38 pm
You mean you'd like to move it when you're scrolling? Have I understood it well?
This should be relatively easy to do with ActionTimer (no pressure on you though). If the meter is moving from 0,0 to 50,50 just increment both X and Y of the meter in the Move1 action in the list. But I'll let you post the solution, as you prefer ActionTimer more than I do... ;-) For this kind of jobs, it's perfect, as the animation is short and it stops eventually.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Deofol
Posts: 19
Joined: February 19th, 2020, 6:29 am

Re: MoveMeter not showing my meter

Post by Deofol »

Yincognito wrote: February 25th, 2020, 8:17 pm Yeah, you're probably right. As I said, Lua scripts are not exactly my favorite Rainmeter topic... :D
Hey, don't let them intimidate you, they're just as simple as using libraries on programming languages :D
User avatar
balala
Rainmeter Sage
Posts: 16166
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MoveMeter not showing my meter

Post by balala »

Yincognito wrote: February 25th, 2020, 8:17 pm This should be relatively easy to do with ActionTimer (no pressure on you though).
Right. This was my idea as well. Working on it...
User avatar
Yincognito
Rainmeter Sage
Posts: 7155
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MoveMeter not showing my meter

Post by Yincognito »

Deofol wrote: February 25th, 2020, 8:19 pm Hey, don't let them intimidate you, they're just as simple as using libraries on programming languages :D
I'm not intimidated by them, I'm a programmer myself (started with Pascal and made a math graph app and a game in highschool, then in Delphi some other stuff, some C#, some Javascript and a Google extension built a couple of years ago, some VBA for my Civ 4 game, etc.). I just don't particularly like to use Lua when Rainmeter itself could do the job ... if asked nicely. 8-)

The funny thing is that I could have started a long time ago with Lua, as I was designing some behavior for my TV Tuner remove in this beautiful application called Promixis Girder (now sadly dead), and they had the option to add scripts in Lua. Never used them then, as the app did its job on its own, never used them in Rainmeter now, for pretty much the same reason. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16166
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MoveMeter not showing my meter

Post by balala »

balala wrote: February 25th, 2020, 8:24 pm Right. This was my idea as well. Working on it...
And here is the sample code, as promised.
Note the newly added U and X variables, the [MeasureSlide] measure and the X=#X# and Y=#X# options of the [SteamIconBackground] meter (no, the Y=#X# is ok, there is no mistake into it).
Obviously this is just a sample, it has to be rewritten if you want to get it working differently. I had to add the bangs to start / stop the animation to the MouseOverAction / MouseLeaveAction options of the [EpicIconBackground], not to [SteamIconBackground] meter, where the !MoveMeter bangs were. Yincognito has described why.
The sample code:

Code: Select all

[Variables]
IconSize=48
IconText="P"
IconColor=2e2e2e
SteamPath=D:\Steam\Steam.exe
RockstarPath=D:\Rockstar Games\Launcher\LauncherPatcher.exe
EpicPath=D:\Epic Games\Launcher\Portal\Binaries\Win32\EpicGamesLauncher.exe
NexonPath=D:\Nexon\Nexon Launcher\nexon_launcher.exe
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeter "SteamIconBackground"][!Redraw]
X=0

; https://forum.rainmeter.net/viewtopic.php?t=12802

[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Right,20,25
Right=[!SetVariable X "(Clamp((#X#+2),0,50))"]#U#
ActionList2=Repeat Left,20,25
Left=[!SetVariable X "(Clamp((#X#-2),0,50))"]#U#
DynamicVariables=1

[Fade]
Measure=Script
ScriptFile="#@#Scripts\Fade.lua"
Min=0
Max=255
Step=20
Start=0

[EpicFade]
Measure=Script
ScriptFile="#@#Scripts\Fade.lua"
Min=0
Max=255
Step=20
Start=0

[InvertedFade]
Measure=Script
ScriptFile="#@#Scripts\Fade.lua"
Min=0
Max=255
Step=20
Start=255

;[Move]
;Measure=Script
;ScriptFile="#@#Scripts\Fade.lua"
;Min=0
;Max=50
;Step=4
;Start=0

[TextSize]
Measure=Calc
Formula=#IconSize#/2

[TextPosition]
Measure=Calc
Formula=#IconSize#/2

[TextShadowPosition]
Measure=Calc
Formula=#IconSize#/4+3

[ControllerIconBackground]
Meter=Shape
Shape=Rectangle 0,0,#IconSize#,#IconSize# | Fill Color #IconColor#
DynamicVariables=1
MouseActionCursor=1
AntiAlias=1

[EpicIconBackground]
Meter=Shape
Shape=Rectangle 0,0,#IconSize#,#IconSize# | Fill Color 0,0,0,255
MouseOverAction=[!CommandMeasure "EpicFade" "Activate('In')"][!CommandMeasure "MeasureSlide" "Execute 1"][!CommandMeasure "MeasureSlide" "Stop 2"]
MouseLeaveAction=[!CommandMeasure "EpicFade" "Activate('Out')"][!CommandMeasure "MeasureSlide" "Stop 1"][!CommandMeasure "MeasureSlide" "Execute 2"]
LeftMouseUpAction=["#EpicPath#"]
DynamicVariables=1
MouseActionCursor=1
AntiAlias=1

[SteamIconBackground]
Meter=Shape
X=#X#
Y=#X#
Shape=Rectangle 0,0,#IconSize#,#IconSize# | Extend MyColor
MyColor=FillColor 42,71,94,[Fade]
MouseOverAction=[!CommandMeasure "Fade" "Activate('In')"][!CommandMeasure "InvertedFade" "Activate('Out')"][!SetOption "ControllerIconBackground" "MyColor" "FillColor 42,71,94,255"]
MouseLeaveAction=[!CommandMeasure "Fade" "Activate('Out')"][!CommandMeasure "InvertedFade" "Activate('In')"][!SetOption "ControllerIconBackground" "MyColor" "FillColor #IconColor#"]
LeftMouseUpAction=["#SteamPath#"]
DynamicVariables=1
MouseActionCursor=1
AntiAlias=1

[SteamIconShadow]
Meter=Image
ImageName=steam.png
W=[TextSize]
H=[TextSize]
PreserveAspectRatio=1
X=[TextShadowPosition]
Y=[TextShadowPosition]
ImageTint=0,0,0,[Fade]
DynamicVariables=1
AntiAlias=1

[SteamIconImage]
Meter=Image
ImageName=steam.png
W=[TextSize]
H=[TextSize]
PreserveAspectRatio=1
X=([TextPosition]/2)
Y=([TextPosition]/2)
ImageTint=255,255,255,[Fade]
DynamicVariables=1
AntiAlias=1

[ControllerIconImage]
Meter=Image
ImageName=controller.png
W=[TextSize]
H=[TextSize]
PreserveAspectRatio=1
X=([TextPosition]/2)
Y=([TextPosition]/2)
ImageTint=255,255,255,[InvertedFade]
DynamicVariables=1
AntiAlias=1
Does it work?
User avatar
Yincognito
Rainmeter Sage
Posts: 7155
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: MoveMeter not showing my meter

Post by Yincognito »

balala wrote: February 25th, 2020, 8:45 pm And here is the sample code, as promised.
Note the newly added U and X variables, the [MeasureSlide] measure and the X=#X# and Y=#X# options of the [SteamIconBackground] meter (no, the Y=#X# is ok, there is no mistake into it).
Obviously this is just a sample, it has to be rewritten if you want to get it working differently. I had to add the bangs to start / stop the animation to the MouseOverAction / MouseLeaveAction options of the [EpicIconBackground], not to [SteamIconBackground] meter, where the !MoveMeter bangs were. Yincognito has described why.
The sample code:

Code: Select all

[Variables]
IconSize=48
IconText="P"
IconColor=2e2e2e
SteamPath=D:\Steam\Steam.exe
RockstarPath=D:\Rockstar Games\Launcher\LauncherPatcher.exe
EpicPath=D:\Epic Games\Launcher\Portal\Binaries\Win32\EpicGamesLauncher.exe
NexonPath=D:\Nexon\Nexon Launcher\nexon_launcher.exe
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeter "SteamIconBackground"][!Redraw]
X=0

; https://forum.rainmeter.net/viewtopic.php?t=12802

[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Right,20,25
Right=[!SetVariable X "(Clamp((#X#+2),0,50))"]#U#
ActionList2=Repeat Left,20,25
Left=[!SetVariable X "(Clamp((#X#-2),0,50))"]#U#
DynamicVariables=1

[Fade]
Measure=Script
ScriptFile="#@#Scripts\Fade.lua"
Min=0
Max=255
Step=20
Start=0

[EpicFade]
Measure=Script
ScriptFile="#@#Scripts\Fade.lua"
Min=0
Max=255
Step=20
Start=0

[InvertedFade]
Measure=Script
ScriptFile="#@#Scripts\Fade.lua"
Min=0
Max=255
Step=20
Start=255

;[Move]
;Measure=Script
;ScriptFile="#@#Scripts\Fade.lua"
;Min=0
;Max=50
;Step=4
;Start=0

[TextSize]
Measure=Calc
Formula=#IconSize#/2

[TextPosition]
Measure=Calc
Formula=#IconSize#/2

[TextShadowPosition]
Measure=Calc
Formula=#IconSize#/4+3

[ControllerIconBackground]
Meter=Shape
Shape=Rectangle 0,0,#IconSize#,#IconSize# | Fill Color #IconColor#
DynamicVariables=1
MouseActionCursor=1
AntiAlias=1

[EpicIconBackground]
Meter=Shape
Shape=Rectangle 0,0,#IconSize#,#IconSize# | Fill Color 0,0,0,255
MouseOverAction=[!CommandMeasure "EpicFade" "Activate('In')"][!CommandMeasure "MeasureSlide" "Execute 1"][!CommandMeasure "MeasureSlide" "Stop 2"]
MouseLeaveAction=[!CommandMeasure "EpicFade" "Activate('Out')"][!CommandMeasure "MeasureSlide" "Stop 1"][!CommandMeasure "MeasureSlide" "Execute 2"]
LeftMouseUpAction=["#EpicPath#"]
DynamicVariables=1
MouseActionCursor=1
AntiAlias=1

[SteamIconBackground]
Meter=Shape
X=#X#
Y=#X#
Shape=Rectangle 0,0,#IconSize#,#IconSize# | Extend MyColor
MyColor=FillColor 42,71,94,[Fade]
MouseOverAction=[!CommandMeasure "Fade" "Activate('In')"][!CommandMeasure "InvertedFade" "Activate('Out')"][!SetOption "ControllerIconBackground" "MyColor" "FillColor 42,71,94,255"]
MouseLeaveAction=[!CommandMeasure "Fade" "Activate('Out')"][!CommandMeasure "InvertedFade" "Activate('In')"][!SetOption "ControllerIconBackground" "MyColor" "FillColor #IconColor#"]
LeftMouseUpAction=["#SteamPath#"]
DynamicVariables=1
MouseActionCursor=1
AntiAlias=1

[SteamIconShadow]
Meter=Image
ImageName=steam.png
W=[TextSize]
H=[TextSize]
PreserveAspectRatio=1
X=[TextShadowPosition]
Y=[TextShadowPosition]
ImageTint=0,0,0,[Fade]
DynamicVariables=1
AntiAlias=1

[SteamIconImage]
Meter=Image
ImageName=steam.png
W=[TextSize]
H=[TextSize]
PreserveAspectRatio=1
X=([TextPosition]/2)
Y=([TextPosition]/2)
ImageTint=255,255,255,[Fade]
DynamicVariables=1
AntiAlias=1

[ControllerIconImage]
Meter=Image
ImageName=controller.png
W=[TextSize]
H=[TextSize]
PreserveAspectRatio=1
X=([TextPosition]/2)
Y=([TextPosition]/2)
ImageTint=255,255,255,[InvertedFade]
DynamicVariables=1
AntiAlias=1
Does it work?
Only now one can say "Good Job"! :thumbup: I didn't test your code, but I have confidence in your abilities, so ... :great:
Of course, the OP has the final verdict on this, as usual. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Deofol
Posts: 19
Joined: February 19th, 2020, 6:29 am

Re: MoveMeter not showing my meter

Post by Deofol »

Yincognito wrote: February 25th, 2020, 8:57 pm Only now one can say "Good Job"! :thumbup: I didn't test your code, but I have confidence in your abilities, so ... :great:
Of course, the OP has the final verdict on this, as usual. ;-)
So do I and I'll be testing as soon as I'm done with a job I'm doing. I'll hit you guys up with the finished result once I got it :) thanks a lot @bal
User avatar
balala
Rainmeter Sage
Posts: 16166
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MoveMeter not showing my meter

Post by balala »

Deofol wrote: February 25th, 2020, 9:31 pm So do I and I'll be testing as soon as I'm done with a job I'm doing. I'll hit you guys up with the finished result once I got it :) thanks a lot @bal
Ok, just let us know please how does it work.
Deofol
Posts: 19
Joined: February 19th, 2020, 6:29 am

Re: MoveMeter not showing my meter

Post by Deofol »

balala wrote: February 25th, 2020, 9:52 pm Ok, just let us know please how does it work.
Well, I just tried it. Not working the right way but I'll sort out what's going on. SteamIconBackground, ControllerIconBackground and their respective icons won't show at all. It seems like EpicIconBackground is on top of them but also there is *something* that moves like it should. Working on it to see if I can fix