It is currently March 28th, 2024, 10:37 am

Is there a way to center things better?

Get help with creating, editing & fixing problems with skins
ExileEd iting
Posts: 7
Joined: March 17th, 2018, 4:53 am

Is there a way to center things better?

Post by ExileEd iting »

Currently using 50% to center and it does work better than manually doing it, but for clocks and dates the characters change which makes them move into an off-center spot. My OCD triggers me from that. Not a big deal just wondering if there's a way to center things based on the length of the text.

*also ignore that awkward space in my name. mistakes were made*
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is there a way to center things better?

Post by balala »

ExileEd iting wrote:Currently using 50% to center and it does work better than manually doing it, but for clocks and dates the characters change which makes them move into an off-center spot. My OCD triggers me from that. Not a big deal just wondering if there's a way to center things based on the length of the text.
Not sure I understand nor what that 50% is, nor what are you meaning by "center things based on the length of the text". But anyway a code would be helpful. Please post it.
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Is there a way to center things better?

Post by CyberTheWorm »

ExileEd iting wrote:Currently using 50% to center and it does work better than manually doing it, but for clocks and dates the characters change which makes them move into an off-center spot. My OCD triggers me from that. Not a big deal just wondering if there's a way to center things based on the length of the text.

*also ignore that awkward space in my name. mistakes were made*
StringAlign=Center or StringAlign=CenterCenter
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany
Contact:

Re: Is there a way to center things better?

Post by Active Colors »

ExileEd iting wrote:Currently using 50% to center and it does work better than manually doing it, but for clocks and dates the characters change which makes them move into an off-center spot. My OCD triggers me from that. Not a big deal just wondering if there's a way to center things based on the length of the text.

*also ignore that awkward space in my name. mistakes were made*
Maybe this tutorial can help you? https://forum.rainmeter.net/viewtopic.php?f=119&t=20795
It has section about placing objects centered. If you still face problems post example skin or code.
ExileEd iting
Posts: 7
Joined: March 17th, 2018, 4:53 am

Re: Is there a way to center things better?

Post by ExileEd iting »

balala wrote:Not sure I understand nor what that 50% is, nor what are you meaning by "center things based on the length of the text". But anyway a code would be helpful. Please post it.
"
WindowX=50%
WindowY=50%
AnchorX=50%
AnchorY=50%
"

Image

also ignore the placement and size of things. Just got a bigger monitor so it messed everything up.

The text in the middle (clock and date) go off center once the characters change because of the difference in sizes. Was wondering if I could do something instead of (50% winX winY etc...)
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is there a way to center things better?

Post by balala »

balala wrote:a code would be helpful. Please post it.
Active Colors wrote:If you still face problems post example skin or code.
Please give us the code. Otherwise is hard enough to help you.
ExileEd iting
Posts: 7
Joined: March 17th, 2018, 4:53 am

Re: Is there a way to center things better?

Post by ExileEd iting »

balala wrote:Please give us the code. Otherwise is hard enough to help you.
Don't know what to give. I just use skins but I mean I'll send random stuff for the Elegance 2 clock.

Clock_hori1:

Code: Select all

[Rainmeter]
Author=lilshizzy@gmail.com
MouseOverAction=!execute [!RainmeterShowMeter colors][!RainmeterRedraw]
MouseLeaveAction=!execute [!RainmeterHideMeter colors][!RainmeterRedraw]
MiddleMouseDownAction=!RainmeterActivateConfig #CURRENTCONFIG# Clock_vert1.ini
@include=#SKINSPATH#Elegance2\Config\Fonts.inc

[Metadata]
Name=Elegance 2 - Clock (horizontal)
Config=
Description=
Instructions=This clock can be set to either 12-hours or 24-hours, | use the Confinguration tool for this and more options.
Version=
Tags=
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Variant=
Preview=

[MeasureTime]
Measure=Time
Format="#Hours#"

[MeasureTime2]
Measure=Time
Format="%M"

[Variables]
@include=#SKINSPATH#Elegance2\Config\Default.inc

[Styles]
@include=#SKINSPATH#Elegance2\Config\Styles.inc

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

[Background]
Meter=IMAGE
SolidColor=0,0,0,1
X=0
Y=0
W=450
H=180

[colors]
Meter=IMAGE
ImageName=#SKINSPATH#Elegance2\Config\Images\colors.png
X=1
Y=1
W=92
H=11
LeftMouseUpAction=!Execute [!RainmeterToggleConfig Elegance2 SetColors.ini]
Hidden=1

[Times1hadow]
Meter=STRING
MeasureName=MeasureTime
MeterStyle=timeshadow
X=114
Y=-22

[Time2shadow]
Meter=STRING
MeasureName=MeasureTime2
MeterStyle=timeshadow
X=225r
Y=r

[Time]
Meter=STRING
MeasureName=MeasureTime
MeterStyle=time1
X=112
Y=-3r

[Time2]
Meter=STRING
MeasureName=MeasureTime2
MeterStyle=time2
X=225r
Y=r
Elegance2 Clock in rainmeter file

Code: Select all

[Elegance2\Clock]
Active=1
WindowX=50%
WindowY=50%
AnchorX=50%
AnchorY=50%
ClickThrough=0
Draggable=1
SnapEdges=1
KeepOnScreen=1
AlwaysOnTop=0
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is there a way to center things better?

Post by balala »

ExileEd iting wrote:Don't know what to give. I just use skins but I mean I'll send random stuff for the Elegance 2 clock.
This probably is good enough, but the Clock_hori1 skin also uses two files (Elegance2\Config\Default.inc and Elegance2\Config\Styles.inc) which also would be needed. Please post them, too.
Or maybe even better, pack the whole root config (the first folder under the Skins folder, which contains the skin) and post it. This way we'll have all needed files, including the images (also used in the skin).
ExileEd iting
Posts: 7
Joined: March 17th, 2018, 4:53 am

Re: Is there a way to center things better?

Post by ExileEd iting »

balala wrote:This probably is good enough, but the Clock_hori1 skin also uses two files (Elegance2\Config\Default.inc and Elegance2\Config\Styles.inc) which also would be needed. Please post them, too.
Or maybe even better, pack the whole root config (the first folder under the Skins folder, which contains the skin) and post it. This way we'll have all needed files, including the images (also used in the skin).
Okay so this folder contains Elegance 1 and 2. The folder "Elegance" is used for my date while the "Elegance 2" is used for the clock.

I'm using Elegance 2 clock_hori and Elegance date_white1.

I'm just trying to get both text for those centered in the middle of my screen in a better way than setting winx and y to 50% if there is a better way.

https://mega.nz/#!L9MiXYSb!oYo1X84h69u3jnQ1iBHZqadZITnhzgNasI4lJH-EWe8
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Is there a way to center things better?

Post by balala »

Using the settings you've gave us above, the clock aligns perfectly for me in the center of the screen. Just take it into account that the real surface of the skin is a bit different from the effectively visible surface of the clock. Add the following two options to the [Rainmeter] section of the Clock_hori1.ini (this is it, right, not clock_hori, as you said?):

Code: Select all

[Rainmeter]
...
BackgroundMode=2
SolidColor=240,240,240,80
These options will make visible (with grey) the surface of the skin. Check it again if it you see it aligned now.
Adding the above options to the [Rainmeter] section of the Date_white1.ini file, too, will make same way visible the surface of this skin, too. You didn't post the settings from the Rainmeter.ini of this last skin, too, but I think they both are aligned accordingly to the settings.
Also have to take into account that the widths of different digits aren't the same (the narrowest digit is 1). As I see it, the skin doesn't move when the minutes are changing. Also, if you add the above options to the [Rainmeter] section of the skin, you'll see that the width of it really doesn't change.
Post Reply