It is currently March 28th, 2024, 10:21 pm

Help debugging beginner code

Get help with installing and using Rainmeter.
Shadowcalen1
Posts: 6
Joined: May 18th, 2017, 10:53 am

Help debugging beginner code

Post by Shadowcalen1 »

I am new to rainmeter, so I apologize if this is the wrong forum. I recently discovered the program, and I have decided to learn how to use it. My first project is a clock, which should be a simple affair, but I have spent the last hours trying to debug why I am getting no visuals from my "script". If someone could point out what I am doing wrong it would be greatly appreciated. (note, I am aware that there is no positioning data, I cant really gauge where to put stuff until I have visuals. Also FontName is replaced with a actual font)

Code: Select all

[Rainmeter]
Update=1000

[Metadata]
Name=Clock
Author= Shadowcalen
Information=
Version= 0.1
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

;--Measures--

[MeasureTime]
Measure=Time
Format=%H:%M

[MeasureSeconds]
Measure=Time
Format=%S

[MeasureDate]
Measure=Time
Format=%#x

;--Text Style--

[TextStyle]
FontFace=FontName
SolidColor=0,0,0,1
FontColor=233,233,233
StringAlign=Right
AntiAlias=1

;--Meters--

[MeterTime]
Meter=String
MeterStyle=TextStyle
MeasureName=MeasureTime
FontSize=40

[MeterSeconds]
Meter=String
MeterStyle=TextStyle
MeasureName=MeasureSeconds
FontSize=40

[MeterDate]
Meter=String
MeterStyle=TextStyle
MeasureName=MeasureDate
FontSize=40
Also, the font that I am using has some odd quarks. In a previous iteration of the script (just display the time %H:%M.%S), the text was getting cut off at the end (it would often display half a number in the seconds column) If someone could explain this to me I would also appreciate it.
Last edited by fonpaolo on May 18th, 2017, 11:52 am, edited 1 time in total.
Reason: Please use the [code] tags
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help debugging beginner code

Post by balala »

Shadowcalen1 wrote:I am new to rainmeter, so I apologize if this is the wrong forum. I recently discovered the program, and I have decided to learn how to use it. My first project is a clock, which should be a simple affair, but I have spent the last hours trying to debug why I am getting no visuals from my "script". If someone could point out what I am doing wrong it would be greatly appreciated. (note, I am aware that there is no positioning data, I cant really gauge where to put stuff until I have visuals. Also FontName is replaced with a actual font)
The biggest problem is that because you didn't add positioning options (X and Y to the meters), the default values are used (X=0, respectively Y=0). But the strings are aligned to right (due to the StringAlign=Right option within the [TextStyle] section), which means they go outside, to left, from the skin. You must know that skins can't show meters which are positioned to left or up of the X=0, respectively Y=0 points. Your strings, having the default X=0 and Y=0 positions, are not visible.
To fix, just replace the StringAlign option to StringAlign=Left in the [TextStyle] section.

Tip: When you post code, please use the tags (using the Code button).
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Help debugging beginner code

Post by jsmorley »

You are going to want / need DynamicWindowSize=1 in the [Rainmeter] section as well.
Shadowcalen1
Posts: 6
Joined: May 18th, 2017, 10:53 am

Re: Help debugging beginner code

Post by Shadowcalen1 »

Thanks, that is exactly what I was looking for. Now that I have it visible, you wouldn't happen to know how to make it invisible? I jest, but my new clock is overlaying itself over all my applications, not just the desktop. Any suggestions on how to get it so it only displays on the desktop? (Keep on screen is not enabled)
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help debugging beginner code

Post by balala »

Shadowcalen1 wrote:I jest, but my new clock is overlaying itself over all my applications, not just the desktop. Any suggestions on how to get it so it only displays on the desktop? (Keep on screen is not enabled)
Right click the skin, go to Settings -> Position and choose one of the possibilities described here: https://docs.rainmeter.net/manual-beta/user-interface/context-menus/#Position
I suppose now you have it set either Stay topmost or Topmost and probably you'll want to choose either Bottom or On desktop.
Shadowcalen1
Posts: 6
Joined: May 18th, 2017, 10:53 am

Re: Help debugging beginner code

Post by Shadowcalen1 »

Again, exactly what I was looking for, Thank you
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help debugging beginner code

Post by balala »

Glad to help.