It is currently March 29th, 2024, 7:13 am

Position relative to screen

Get help with creating, editing & fixing problems with skins
Cassed98
Posts: 2
Joined: January 19th, 2021, 4:45 pm

Position relative to screen

Post by Cassed98 »

I would like to center the lumiero date by Connect-R relative to the screen as the display where it will be shown will change.
Same thing with a Visualizer but I would like to have the size and the x coordinate relative to the center and y at the bottom.
I tried to change it myself but it seems that I am not capable of that yet.
Date:

Code: Select all

[Rainmeter]
Update=1000
Author=Connect-R
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
AccurateText=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh] 
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!Refresh]

[Variables]
@include=#@#Variables.inc
@include2=#@#Language\Language.inc
Scale=1.4
;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureDate]
Measure=Time
Format=%d

[MeasureDay]
Measure=Time
Format="%A"
Substitute=#Date#

[MeasureMonth]
Measure=Time
Format="%B"
Substitute=#Date#

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterDate]
Meter=String
MeasureName=MeasureDate
StringAlign=Center
FontFace=Comfortaa
FontColor=#Color1#
FontSize=(68*#Scale#)
X=(80*#Scale#)
Y=(0*#Scale#)
Text=%1
AntiAlias=1

[MeterMonth]
Meter=String
MeasureName=MeasureMonth
StringAlign=Center
FontFace=Comfortaa
FontColor=#Color1#
FontSize=(14*#Scale#)
X=(80*#Scale#)
Y=(-8*#Scale#)R
Text=%1
AntiAlias=1

[MeterDay]
Meter=String
MeasureName=MeasureDay
StringAlign=Center
FontFace=Comfortaa
FontColor=#Color1#,100
FontSize=(8*#Scale#)
X=(80*#Scale#)
Y=(5*#Scale#)R
Text=#Today's# %1
AntiAlias=1


-------------------------------------------------------------------------------------

Visualizer:

Code: Select all

[Rainmeter]
Update=1000
Author=Connect-R
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
AccurateText=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh] 
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!Refresh]

[Variables]
@include=#@#Variables.inc
@include2=#@#Language\Language.inc
Scale=1.4
;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureDate]
Measure=Time
Format=%d

[MeasureDay]
Measure=Time
Format="%A"
Substitute=#Date#

[MeasureMonth]
Measure=Time
Format="%B"
Substitute=#Date#

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterDate]
Meter=String
MeasureName=MeasureDate
StringAlign=Center
FontFace=Comfortaa
FontColor=#Color1#
FontSize=(68*#Scale#)
X=(80*#Scale#)
Y=(0*#Scale#)
Text=%1
AntiAlias=1

[MeterMonth]
Meter=String
MeasureName=MeasureMonth
StringAlign=Center
FontFace=Comfortaa
FontColor=#Color1#
FontSize=(14*#Scale#)
X=(80*#Scale#)
Y=(-8*#Scale#)R
Text=%1
AntiAlias=1

[MeterDay]
Meter=String
MeasureName=MeasureDay
StringAlign=Center
FontFace=Comfortaa
FontColor=#Color1#,100
FontSize=(8*#Scale#)
X=(80*#Scale#)
Y=(5*#Scale#)R
Text=#Today's# %1
AntiAlias=1
Thanks in advance
Cassed98
Posts: 2
Joined: January 19th, 2021, 4:45 pm

Re: Position relative to screen

Post by Cassed98 »

Update:
I managed to put the date in the center using #SCREENAREAWIDTH#
But I still need to make it universal as when I disconnect my Surface from my Dock it keeps the Screenwidth of my monitor and doesnt convert it to my surfaces measures
Morsmodre
Posts: 22
Joined: December 14th, 2020, 3:04 am

Re: Position relative to screen

Post by Morsmodre »

Cassed98 wrote: January 19th, 2021, 5:33 pm Update:
I managed to put the date in the center using #SCREENAREAWIDTH#
But I still need to make it universal as when I disconnect my Surface from my Dock it keeps the Screenwidth of my monitor and doesnt convert it to my surfaces measures
Try adding this to the ini, and see if it works:

Code: Select all

[MeasureCenter]
Measure=Calc
Formula=1
DynamicVariables=1
OnUpdateAction=[!Move (#SCREENAREAWIDTH#/2-(#CURRENTCONFIGWIDTH#/2)) (#SCREENAREAHEIGHT#/2-(#CURRENTCONFIGHEIGHT#/2))]
User avatar
lysy1993lbn
Posts: 291
Joined: July 25th, 2011, 9:53 am
Location: Lublin, Poland

Re: Position relative to screen

Post by lysy1993lbn »

All You need is Skin sections - WindowX, WindowY], and Skin sections - AnchorX, AnchorY]

So given that your skin is 200px in height, and you want it at the very bottom of the screen then your skin's section (in Rainmeter.ini) would need to be:

Code: Select all

[Skin1]
Active=1
WindowX=50%
AnchorX=50%
WindowY=200B
"Never argue with an idiot, he will drag you down to his level and beat you with experience."
my deviantART | Alternative Rainmeter tray icons
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Position relative to screen

Post by balala »

Cassed98 wrote: January 19th, 2021, 4:52 pm I would like to center the lumiero date by Connect-R relative to the screen as the display where it will be shown will change.
Same thing with a Visualizer but I would like to have the size and the x coordinate relative to the center and y at the bottom.
Beside Harshsrcc and lysy1993lbn's ideas, I'd use the newly added !SetWindowPosition bang. If interested add the following option to the [Rainmeter] section of your skin: OnRefreshAction=[!SetWindowPosition "50%" "0B" "50%" "0"]. The first and second parameter control the horizontal and vertical position of skin. See that horizontally it is placed to 50%, which is the middle of the screen, while vertically to 0B, which means 0 pixels from the bottom of the screenarea. The last two parameters are the horizontal and vertical anchor points. These are set to 50% (the center of the skin will be placed to the center of the screen) and 0, so vertically the skin will be placed to bottom (its bottom is 0 pixel distant from the bottom of the screen).