It is currently December 6th, 2022, 2:54 pm

need help optimizing menu skin

Get help with creating, editing & fixing problems with skins
aredhone
Posts: 38
Joined: November 12th, 2017, 6:03 pm

need help optimizing menu skin

Post by aredhone »

hey all I need help optimizing my skin I think I got it pretty clean
but would like someone more advanced to look it over
this is what I got
put all files in a download

Bonus question I also want to center this skin to any screen but cant get it to wok sooooo if somone knows pls help
[Rainmeter]
Update=5000

[Metadata]
Authurs=Aredhone,
Name=GTGogeta Menu
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0


[Variables]
@include=Variables.inc
@include1=Settings.inc

[Style_Center]
fontface=#Font#
FontColor=#FontColor#
fontsize =#FontSize#
StringAlign=CENTER

[Style_Left]
fontface=#Font#
FontColor=#FontColor#
fontsize =#FontSize#
StringAlign=LEFT

[Style_Right]
fontface=#Font#
FontColor=#FontColor#
fontsize =#FontSize#
StringAlign=Right

[MeasureCenter]
Measure=Calc
DynamicVariables=1
UpdateDivider=-1
Formula=MeasureCenter + 1
IfCondition=MeasureCenter > 0
IfTrueAction=[!Move "(#SCREENAREAWIDTH#/2-(#CURRENTCONFIGWIDTH#/2))" "(#SCREENAREAHEIGHT#/2-(#CURRENTCONFIGHEIGHT#/2))"]

;===Buttons===
[Button_Settings]
Meter=Button
X=15
Y=15
ButtonImage=Assets\Button\Settings2.png
AntiAlias=1
LeftMouseUpAction=["C:\Users\%USERNAME%\Documents\Rainmeter\Skins\GTGogeta Menu\Settings.inc"]

[Button_1]
Meter=Button
X=150r
Y=130r
ButtonImage=Assets\Button\Sample.png
AntiAlias=1
MouseOverAction=[!SetOption Button_1_Text StringStyle Bold][!UpdateMeter Button_1_Text][!Redraw]
MouseLeaveAction=[!SetOption Button_1_Text StringStyle ""][!UpdateMeter Button_1_Text][!Redraw]
LeftMouseUpAction=["#Button_1_Prog#"]

[Button_1_Logo]
Meter=Image
ImageName=Assets\logos\#Button_1_Text#.png
X=35r
Y=28r

[Button_1_Text]
Meter=String
X=90r
Y=20r
MeterStyle=Style_Left
FontSize=#FontSize#
AntiAlias=1
Text="#Button_1_Text#"

[Button_2]
Meter=Button
X=130
Y=100r
ButtonImage=Assets\Button\Sample.png
AntiAlias=1
MouseOverAction=[!SetOption Button_2_Text StringStyle Bold][!UpdateMeter Button_2_Text][!Redraw]
MouseLeaveAction=[!SetOption Button_2_Text StringStyle ""][!UpdateMeter Button_2_Text][!Redraw]
LeftMouseUpAction=["#Button_2_Prog#"]

[Button_2_Logo]
Meter=Image
ImageName=Assets\logos\#Button_2_Text#.png
X=35r
Y=28r

[Button_2_Text]
Meter=String
X=90r
Y=20r
MeterStyle=Style_Left
FontSize=#FontSize#
AntiAlias=1
Text="#Button_2_Text#"

[Button_3]
Meter=Button
X=110
Y=100r
ButtonImage=Assets\Button\Sample.png
AntiAlias=1
MouseOverAction=[!SetOption Button_3_Text StringStyle Bold][!UpdateMeter Button_3_Text][!Redraw]
MouseLeaveAction=[!SetOption Button_3_Text StringStyle ""][!UpdateMeter Button_3_Text][!Redraw]
LeftMouseUpAction=["#Button_3_Prog#"]

[Button_3_Logo]
Meter=Image
ImageName=Assets\logos\#Button_3_Text#.png
X=35r
Y=28r

[Button_3_Text]
Meter=String
X=90r
Y=20r
MeterStyle=Style_Left
FontSize=#FontSize#
AntiAlias=1
Text="#Button_3_Text#"

[Button_4]
Meter=Button
X=90
Y=100r
ButtonImage=Assets\Button\Sample.png
AntiAlias=1
MouseOverAction=[!SetOption Button_4_Text StringStyle Bold][!UpdateMeter Button_4_Text][!Redraw]
MouseLeaveAction=[!SetOption Button_4_Text StringStyle ""][!UpdateMeter Button_4_Text][!Redraw]
LeftMouseUpAction=["#Button_4_Prog#"]

[Button_4_Logo]
Meter=Image
ImageName=Assets\logos\#Button_4_Text#.png
X=35r
Y=28r

[Button_4_Text]
Meter=String
X=90r
Y=20r
MeterStyle=Style_Left
FontSize=#FontSize#
AntiAlias=1
Text="#Button_4_Text#"

[Button_5]
Meter=Button
X=110
Y=100r
ButtonImage=Assets\Button\Sample.png
AntiAlias=1
MouseOverAction=[!SetOption Button_5_Text StringStyle Bold][!UpdateMeter Button_5_Text][!Redraw]
MouseLeaveAction=[!SetOption Button_5_Text StringStyle ""][!UpdateMeter Button_5_Text][!Redraw]
LeftMouseUpAction=["#Button_5_Prog#"]

[Button_5_Logo]
Meter=Image
ImageName=Assets\logos\#Button_5_Text#.png
X=35r
Y=28r

[Button_5_Text]
Meter=String
X=90r
Y=20r
MeterStyle=Style_Left
FontSize=#FontSize#
AntiAlias=1
Text="#Button_5_Text#"

[Button_6]
Meter=Button
X=130
Y=100r
ButtonImage=Assets\Button\Sample.png
AntiAlias=1
MouseOverAction=[!SetOption Button_6_Text StringStyle Bold][!UpdateMeter Button_6_Text][!Redraw]
MouseLeaveAction=[!SetOption Button_6_Text StringStyle ""][!UpdateMeter Button_6_Text][!Redraw]
LeftMouseUpAction=["#Button_6_Prog#"]

[Button_6_Logo]
Meter=Image
ImageName=Assets\logos\#Button_6_Text#.png
X=35r
Y=28r

[Button_6_Text]
Meter=String
X=90r
Y=20r
MeterStyle=Style_Left
FontSize=#FontSize#
AntiAlias=1
Text="#Button_6_Text#"

;===Time===

[HoureMeasure]
Measure=Time
Format=%I

[(Houre)]
Meter=BITMAP
MeasureName=HoureMeasure
X=1200r
Y=-800r
BitmapImage=Assets\Clock\ImageL.png
BitmapFrames=10
BitmapExtend=1
BitmapDigits=2
BitmapAlign=CENTER

[MinuteMeasure]
Measure=Time
Format=%M

[(Minutes)]
Meter=BITMAP
MeasureName=MinuteMeasure
X=55r
Y=100r
BitmapImage=Assets\Clock\ImageL.png
BitmapFrames=10
BitmapExtend=1
BitmapDigits=2
BitmapAlign=CENTER

[DayMeasure]
Measure=Time
Format=%w

[(Days)]
Meter=BITMAP
MeasureName=DayMeasure
X=120r
Y=-95r
BitmapImage=Assets\Days\Days.png
BitmapFrames=7
BitmapExtend=1
BitmapDigits=1
BitmapAlign=CENTER

[MeasureAMPM]
Measure=Time
Format=%H
IfCondition= MeasureAMPM > 11
IfTrueAction=[!SetOption AMPM ImageName Assets\Clock\PM.png] [!Update] [!redraw]
IfFalseAction=[!SetOption AMPM ImageName Assets\Clock\AM.png] [!Update][!redraw]

[AMPM]
Meter=Image
ImageName=Assets\Clock\AM.png
X=-30r
Y=105r

[Version]
Meter=String
FontColor=255,255,255,255
Text=#Version#
FontSize=18
X=170r
Y=810r
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4885
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: need help optimizing menu skin

Post by eclectic-tech »

Sorry for such a late reply :Whistle

If you are still interested in centering your skin, the code below may help.
It calculates the center of the screen height and creates a variable CenterV, then places the first button meter 380 pixels above that value.
All the other buttons are relative to that position; tested rez from 1024x768 to 1920x1080... and the links remain centered on the screen, top to bottom after refreshing.

I placed all of your supporting files in a new '@Resources' folder ('Assets' folder, Variables.inc, settings.inc) and modified the links in the skin to access those new locations.
I changed the hard-coded path to your settings.inc file in the activating bang.
I also modified the X & Y values for your buttons, clock, and version meters for alignment on all screen resolutions.
Feel free to play with those values to tweak placement.

Modified 'Menu.ini' code

Code: Select all

[Rainmeter]
Update=1000

[Metadata]
Authur=Aredhone
Name=GTGogeta Menu
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0


[Variables]
@include=#@#Variables.inc
@include1=#@#Settings.inc
CenterV=(#ScreenAreaHeight#*0.5)

[Style_Center]
fontface=#Font#
FontColor=#FontColor#
fontsize =#FontSize#
StringAlign=CENTER

[Style_Left]
fontface=#Font#
FontColor=#FontColor#
fontsize =#FontSize#
StringAlign=LEFT

[Style_Right]
fontface=#Font#
FontColor=#FontColor#
fontsize =#FontSize#
StringAlign=Right

; [MeasureCenter]
; Measure=Calc
; DynamicVariables=1
; UpdateDivider=-1
; Formula=MeasureCenter + 1
; IfCondition=MeasureCenter > 0
; IfTrueAction=[!Move "(#SCREENAREAWIDTH#/2-(#CURRENTCONFIGWIDTH#/2))" "(#SCREENAREAHEIGHT#/2-(#CURRENTCONFIGHEIGHT#/2))"]

;===Buttons===
[Button_Settings]
Meter=Button
X=15	
Y=15
ButtonImage=#@#Assets\Button\Settings2.png
AntiAlias=1
LeftMouseUpAction=["#@#Settings.inc"]

[Button_1]
Meter=Button
X=100
ButtonImage=#@#Assets\Button\Sample.png
AntiAlias=1
Y=(#CenterV#-380)
LeftMouseUpAction=["#Button_1_Prog#"]
MouseOverAction=[!SetOption Button_1_Text StringStyle Bold][!UpdateMeter Button_1_Text][!Redraw]
MouseLeaveAction=[!SetOption Button_1_Text StringStyle ""][!UpdateMeter Button_1_Text][!Redraw]

[Button_1_Logo]
Meter=Image
ImageName=#@#Assets\logos\#Button_1_Text#.png
X=35r
Y=28r

[Button_1_Text]
Meter=String
X=90r
Y=20r
MeterStyle=Style_Left
AntiAlias=1
Text="#Button_1_Text#"

[Button_2]
Meter=Button
X=100
Y=80r
ButtonImage=#@#Assets\Button\Sample.png
AntiAlias=1
MouseOverAction=[!SetOption Button_2_Text StringStyle Bold][!UpdateMeter Button_2_Text][!Redraw]
MouseLeaveAction=[!SetOption Button_2_Text StringStyle ""][!UpdateMeter Button_2_Text][!Redraw]
LeftMouseUpAction=["#Button_2_Prog#"]

[Button_2_Logo]
Meter=Image
ImageName=#@#Assets\logos\#Button_2_Text#.png
X=35r
Y=28r

[Button_2_Text]
Meter=String
X=90r
Y=20r
MeterStyle=Style_Left
FontSize=#FontSize#
AntiAlias=1
Text="#Button_2_Text#"

[Button_3]
Meter=Button
X=100
Y=80r
ButtonImage=#@#Assets\Button\Sample.png
AntiAlias=1
MouseOverAction=[!SetOption Button_3_Text StringStyle Bold][!UpdateMeter Button_3_Text][!Redraw]
MouseLeaveAction=[!SetOption Button_3_Text StringStyle ""][!UpdateMeter Button_3_Text][!Redraw]
LeftMouseUpAction=["#Button_3_Prog#"]

[Button_3_Logo]
Meter=Image
ImageName=#@#Assets\logos\#Button_3_Text#.png
X=35r
Y=28r

[Button_3_Text]
Meter=String
X=90r
Y=20r
MeterStyle=Style_Left
FontSize=#FontSize#
AntiAlias=1
Text="#Button_3_Text#"

[Button_4]
Meter=Button
X=100
Y=80r
ButtonImage=#@#Assets\Button\Sample.png
AntiAlias=1
MouseOverAction=[!SetOption Button_4_Text StringStyle Bold][!UpdateMeter Button_4_Text][!Redraw]
MouseLeaveAction=[!SetOption Button_4_Text StringStyle ""][!UpdateMeter Button_4_Text][!Redraw]
LeftMouseUpAction=["#Button_4_Prog#"]

[Button_4_Logo]
Meter=Image
ImageName=#@#Assets\logos\#Button_4_Text#.png
X=35r
Y=28r

[Button_4_Text]
Meter=String
X=90r
Y=20r
MeterStyle=Style_Left
FontSize=#FontSize#
AntiAlias=1
Text="#Button_4_Text#"

[Button_5]
Meter=Button
X=100
Y=80r
ButtonImage=#@#Assets\Button\Sample.png
AntiAlias=1
MouseOverAction=[!SetOption Button_5_Text StringStyle Bold][!UpdateMeter Button_5_Text][!Redraw]
MouseLeaveAction=[!SetOption Button_5_Text StringStyle ""][!UpdateMeter Button_5_Text][!Redraw]
LeftMouseUpAction=["#Button_5_Prog#"]

[Button_5_Logo]
Meter=Image
ImageName=#@#Assets\logos\#Button_5_Text#.png
X=35r
Y=28r

[Button_5_Text]
Meter=String
X=90r
Y=20r
MeterStyle=Style_Left
FontSize=#FontSize#
AntiAlias=1
Text="#Button_5_Text#"

[Button_6]
Meter=Button
X=100
Y=80r
ButtonImage=#@#Assets\Button\Sample.png
AntiAlias=1
MouseOverAction=[!SetOption Button_6_Text StringStyle Bold][!UpdateMeter Button_6_Text][!Redraw]
MouseLeaveAction=[!SetOption Button_6_Text StringStyle ""][!UpdateMeter Button_6_Text][!Redraw]
LeftMouseUpAction=["#Button_6_Prog#"]

[Button_6_Logo]
Meter=Image
ImageName=#@#Assets\logos\#Button_6_Text#.png
X=35r
Y=28r

[Button_6_Text]
Meter=String
X=90r
Y=20r
MeterStyle=Style_Left
FontSize=#FontSize#
AntiAlias=1
Text="#Button_6_Text#"

;===Time===

[HoureMeasure]
Measure=Time
Format=%I

[Houre]
Meter=BITMAP
MeasureName=HoureMeasure
X=(#ScreenAreaWidth#-300)
Y=100
; X=1200r
; Y=-800r
BitmapImage=#@#Assets\Clock\ImageL.png
BitmapFrames=10
BitmapExtend=1
BitmapDigits=2
BitmapAlign=CENTER

[MinuteMeasure]
Measure=Time
Format=%M

[Minutes]
Meter=BITMAP
MeasureName=MinuteMeasure
X=55r
Y=100r
BitmapImage=#@#Assets\Clock\ImageL.png
BitmapFrames=10
BitmapExtend=1
BitmapDigits=2
BitmapAlign=CENTER

[DayMeasure]
Measure=Time
Format=%w

[Days]
Meter=BITMAP
MeasureName=DayMeasure
X=120r
Y=-95r
BitmapImage=#@#Assets\Days\Days.png
BitmapFrames=7
BitmapExtend=1
BitmapDigits=1
BitmapAlign=CENTER

[MeasureAMPM]
Measure=Time
Format=%H
IfCondition= MeasureAMPM > 11
IfTrueAction=[!SetOption AMPM ImageName  #*@*#Assets\Clock\PM.png] [!Update] [!redraw]
IfFalseAction=[!SetOption AMPM ImageName  #*@*#Assets\Clock\AM.png] [!Update][!redraw]

[AMPM]
Meter=Image
ImageName=#@#Assets\Clock\AM.png
X=-30r
Y=105r

[Version]
Meter=String
MeterStyle=Style_Right
FontColor=255,255,255,255
Text=#Version#
FontSize=18
X=(#ScreenAreaWidth#)
Y=(#ScreenAreaHeight#-100)
User avatar
balala
Rainmeter Sage
Posts: 14766
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: need help optimizing menu skin

Post by balala »

aredhone wrote: October 2nd, 2022, 8:49 am hey all I need help optimizing my skin I think I got it pretty clean
but would like someone more advanced to look it over
this is what I got
put all files in a download
The code seems quite good. No errors in log when refreshing / loading the skin.
One single thing I recommend is the same what eclectic-tech also recommended: to move all files involved into the @Resources folder. This is the basic procedure lately. If you want to do this, move all files, excepting the skins Menu.ini but including the Assests folder, into a new folder you create into the root config (the Skins\GTGogeta Menu\ folder) and name it @Resources. Along with this, add the #@# variable before all resources in the code. For instance, you have this option on the [Button_Settings] meter: ButtonImage=Assets\Button\Settings2.png. If you moved the Assets\Button\Settings2.png image to the newly created @Resources folder, add the variable to the beginning of the option, this way: ButtonImage=#@#Assets\Button\Settings2.png.
If you want to do this and are not sure, please come back with a post, to let us know you didn't succeed.
aredhone wrote: October 2nd, 2022, 8:49 am Bonus question I also want to center this skin to any screen but cant get it to wok sooooo if somone knows pls help
The original skin is already centered by the [MeasureCenter] measure. However theree seems to exist a much easier solution. For this you need only a !SetWindowPosition bang, executed when the skin is refreshed / activated. To get this, add the following OnRefreshAction option to the [Rainmeter] section of your skin: OnRefreshAction=[!SetWindowPosition "50%" "50%" "50%" "50%"]. As you can see, all parameters of the !SetWindowPosition bang are set to 50%. This means that the center of the skin (50% means half of the width and height of skin - these are controlled by the last two - third and fourth - parameters) is positioned to the center (so to 50%, i.e. half - first two parameters) of the screen.
Adding and using the above OnRefreshAction option makes the [MeasureCenter] measure useless. If you added the OnRefreshAction, you may freely remove the [MeasureCenter] measure.