It is currently July 15th, 2020, 12:00 pm

RainRGB4.exe help and questions

Help with creating, editing & fixing problems with skins
User avatar
Hackit
Posts: 80
Joined: May 19th, 2010, 9:05 pm
Location: North of the Border

Re: RainRGB4.exe help and questions

Post by Hackit »

i was having problems and was using snippets from other skins. that's why i figured it be better if i start from scratch with only code written by me. this has caused another issue, i dont know very much.
i'll post whats giving me issue's as of now.

Code: Select all

;----------------------------------begin-day4
[@ForecastDay4Icon]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=18
IfAboveValue=1
IfAboveAction=[!HideMeter MeterDay4IconNA][!ShowMeter MeterDay4Icon]

[MeterDay4Icon]
Path=#@#Weathericons
MeasureName=@ForecastDay4Icon
Group=AllMeters
Meter=Image
PreserveAspectRatio=1
AntiAlias=1
X=360
Y=130
H=75
W=75
Hidden=1

[MeterTempDay4]
MeasureName=@ForecastDay4Name
Group=AllMeters
Meter=String
X=338
Y=141
FontFace=bahnschrift
FontColor=#ExtendedWeather#
FontSize=9
FontWeight=300
StringAlign=Left
StringStyle=NORMAL
AntiAlias=1
UpdateDivider=#Rdiv#
Hidden=1

[MeterTempDay4low]
MeasureName2=@ForecastDay4Low
Group=AllMeters
Meter=String
X=338
Y=153
FontFace=bahnschrift
FontColor=#ExtendedWeather#
FontSize=9
FontWeight=300
StringAlign=Left
StringStyle=NORMAL
AntiAlias=1
text=2
UpdateDivider=#Rdiv#
Postfix="°"
Hidden=1

[MeterTempDay4lowfont3]
Group=AllMeters
Meter=String
X=13r
Y=2r
FontSize=7
StringEffect=SHADOW
FontWeight=500
FontColor=#ExtendedWeather#
StringAlign=Left
Text= L
Hidden=1

[MeterTempDay4High]
MeasureName2=@ForecastDay4High
Group=AllMeters
Meter=String
X=338
Y=168
FontFace=bahnschrift
FontColor=#ExtendedWeather#
FontSize=9
FontWeight=300
StringAlign=Left
StringStyle=NORMAL
AntiAlias=1
text=3
UpdateDivider=#Rdiv#
Postfix="°"
Hidden=1

[MeterTempDay4Highfont3]
Group=AllMeters
Meter=String
X=13r
Y=2r
FontSize=7
StringEffect=SHADOW
FontWeight=500
FontColor=#ExtendedWeather#
StringAlign=Left
Text= H
Hidden=1
so i have added the hi and low temps for the 3 day forecast i then added H and L to the right of the temps.
if the temp is a single digit the alignment is fine, as soon as the temp is in double digits they over lap.
“Whether you think you can, or you think you can't – you're right”

DeviantArt Profile
User avatar
Hackit
Posts: 80
Joined: May 19th, 2010, 9:05 pm
Location: North of the Border

Re: RainRGB4.exe help and questions

Post by Hackit »

sorted it out, changed the position of the 3 day hi/low meters, seems to work now.
“Whether you think you can, or you think you can't – you're right”

DeviantArt Profile
User avatar
Yincognito
Posts: 1936
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: RainRGB4.exe help and questions

Post by Yincognito »

Hackit wrote:
March 26th, 2020, 2:34 am
sorted it out, changed the position of the 3 day hi/low meters, seems to work now.
Yep, sorry about not replying to you. I've been unable to log in on the forum in the past few days (see here), and focused on improving some of the skins in my suite instead. Glad you sorted things out though - if other issues come up in your code in the future, feel free to ask, and if I can answer, I will. If not, maybe there will be other replies to help you - if you don't sort things out yourself, that is. ;-)
User avatar
Hackit
Posts: 80
Joined: May 19th, 2010, 9:05 pm
Location: North of the Border

Re: RainRGB4.exe help and questions

Post by Hackit »

no worries, your help has been much appreciated.
“Whether you think you can, or you think you can't – you're right”

DeviantArt Profile
User avatar
Hackit
Posts: 80
Joined: May 19th, 2010, 9:05 pm
Location: North of the Border

Re: RainRGB4.exe help and questions

Post by Hackit »

Yincognito wrote:
March 17th, 2020, 11:51 am
Dynamically change the width of your skin according to the length of the current condition text
I have been searching would this be done using clipstring?
“Whether you think you can, or you think you can't – you're right”

DeviantArt Profile
User avatar
Yincognito
Posts: 1936
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: RainRGB4.exe help and questions

Post by Yincognito »

Hackit wrote:
April 5th, 2020, 12:11 am
I have been searching would this be done using clipstring?
Regarding ClipString, wrapping the text on multiple lines results in a dynamic height (using ClipString=2 on the string meter). As for actually clipping the text (ClipString=1), clipstring has the opposite effect on the width, making it static, since the text will be constrained to the desired width, by adding ... when its width is greater than the width you set to be the limit (aka the maximum).

What I meant in that quote is to set DynamicWindowSize to 1 and then set the X/Y/W/H of the needed meters according to [MeterText:W] (where MeterText is assumed to be the meter where you have the current condition text). Basically expressing the X/Y/W/H of the needed meters as functions / proportions / formulas of the width of MeterText.

That being said, this is a tricky subject, since that text can be 100 px long or 400 pixels long, so a big variation. Making the width of the skin dynamic in this case is going to produce really "dispersed" layouts visually, for bigger text widths, so the skin might not look as compact in those cases. Too bad you were late with that reply early on, as I could have posted the wrapped text version of the skin, where even if it was a bit "dispersed", it was only in certain small areas (but there you could add another weather element to improve the layout anyway). Personally, I had this problem in my weather skin as well, and the issue of space in my skins is much more serious (they're sized at just 169 x 13 px). I solved some of the imbalance between the quantity of data and the space available by using tooltips, but I wanted the current condition text to appear unclipped in that 169 x 13 px (smaller, actually) frame, so I made the skin a "marquee" type, where text is sliding/rolling ticker style. The easiest options though are using one of the clipstring variations and tooltips, of course.
User avatar
Hackit
Posts: 80
Joined: May 19th, 2010, 9:05 pm
Location: North of the Border

Re: RainRGB4.exe help and questions

Post by Hackit »

so i need to add DynamicWindowSize=1 to every part of my skin that has StringAlign=right, then set all using X/Y/W/H?
do i need to have the skin W/H set?
“Whether you think you can, or you think you can't – you're right”

DeviantArt Profile
User avatar
Yincognito
Posts: 1936
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: RainRGB4.exe help and questions

Post by Yincognito »

Hackit wrote:
April 5th, 2020, 1:18 pm
so i need to add DynamicWindowSize=1 to every part of my skin that has StringAlign=right include DynamicWindowSize=1, then set all using X/Y/W/H?
do i need to have the skin W/H set?
Nope. DynamicWindowSize=1 belongs to the [Rainmeter] section of a skin, and that is unique - you don't need to add it everywhere.

I think it's best if I show how you should approach this by example:

Code: Select all

[Variables]
MinSkinWidth=300

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

---Measures---

[MeasureLongString]
Measure=Calc
Formula=(MeasureLongString+1)%2
UpdateDivider=3
RegExpSubstitute=1
Substitute="^0$":"A not so long string","^1$":"A very very very very very very very very very very very very very very very very very long string"
DynamicVariables=1

---Meters---

[MeterLAlignedString0]
Meter=STRING
X=0
Y=0R
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=10
AntiAlias=1
StringAlign=Left
Text="L. Aligned string at 0%"
DynamicVariables=1

[MeterCAlignedString50]
Meter=STRING
X=((([MeterLongString:W]<#MinSkinWidth#)?(#MinSkinWidth#):[MeterLongString:W])/2)
Y=0R
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=10
AntiAlias=1
StringAlign=Center
Text="C. Aligned string at 50%"
DynamicVariables=1

[MeterRAlignedString100]
Meter=STRING
X=(([MeterLongString:W]<#MinSkinWidth#)?(#MinSkinWidth#):[MeterLongString:W])
Y=0R
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=10
AntiAlias=1
StringAlign=Right
Text="R. Aligned string at 100%"
DynamicVariables=1

[MeterRAlignedString33]
Meter=STRING
X=((([MeterLongString:W]<#MinSkinWidth#)?(#MinSkinWidth#):[MeterLongString:W])*0.33)
Y=0R
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=10
AntiAlias=1
StringAlign=Right
Text="R. Aligned string at 33%"
DynamicVariables=1

[MeterLAlignedString33]
Meter=STRING
X=((([MeterLongString:W]<#MinSkinWidth#)?(#MinSkinWidth#):[MeterLongString:W])*0.33)
Y=0R
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=10
AntiAlias=1
StringAlign=Left
Text="L. Aligned string at 33%"
DynamicVariables=1

[MeterLongString]
Meter=STRING
X=0
Y=0R
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=10
AntiAlias=1
MeasureName=MeasureLongString
Text="%1"
DynamicVariables=1
As you can see, it's only one DynamicWindowSize=1, in the [Rainmeter] section. All string meters except [MeterLongString] (which is a simulation of a long current condition text) are aligned in various ways, but always in relation to the width of [MeterLongString] (see their X values), in effect making the skin's layout to widen up or shrink up in order to adapt to the width of our current condition text simulation. The measure in this skin is there just to "toggle" between a shorter and a longer string, it isn't needed in your case (as they say, for demonstration purposes only).

Now, a bit on the formulas. Normally, there shouldn't be any need for increased complexity in the formulas, as a ([MeterLongString:W]*0.33) should be enough if we want to set the X of a certain meter to one third of the long text's width, for example. However, since this is a simulation of the current condition text (a WebParser measure), we know that those measures have an empty ("") initial value, at least until they are populated from the parsed page source, that is. This means that using the simple formula above would produce a skin 0 px wide in the brief moments until the measures get populated from the site. A 0 px wide (virtually invisible) skin is not what we want, even if it's for a very short period of time in theory, so we set the MinSkinWidth variable to a value of 300 px (can be any value you like) in order to have a "standard" / "minimum" skin size (or rather, condition text width) that we can base our calculation of the other meters' X-es on.

This means that ([MeterLongString]*0.33) will become ((([MeterLongString:W]<#MinSkinWidth#)?(#MinSkinWidth#):[MeterLongString:W])*0.33), which basically tells Rainmeter to use #MinSkinWidth# (300, in this case) when multiplying with 0.33, if the width of the long string meter is below the value of #MinSkinWidth#, and the width of the long string meter itself if not. This type of formula is a conditional (pardon my excessive use of brackets).

One other thing you should be aware of is that normally there is a delay of one update cycle between the moment when the long string toggles to a different value and the moment when the other meters' X-es are updated to reflect that. This is because [MeterLongString] is placed after the other meters in the skin (so those meters won't know its width until the next update). Placing the meter before the other meters depending on it solves the issue (but you'd need to avoid using relative r and R coordinates if you want to place it lower in the actual skin, visually). Another option (that is actually used in this case) is to update and redraw the meters immediately after [MeterLongString] gets its new value - I've used OnUpdateAction=[!UpdateMeter *][!Redraw] here, but since we're talking about WebParser measures, it will probably be more along the lines of FinishAction=[!UpdateMeter *][!Redraw].

Hopefully I've been reasonably clear in showing and explaining how the whole thing should be approached...
User avatar
Hackit
Posts: 80
Joined: May 19th, 2010, 9:05 pm
Location: North of the Border

Re: RainRGB4.exe help and questions

Post by Hackit »

if your explanation is not clear surely it's me not you.
thanks you for taking the time to explain.
i think i'm going to start from scratch and add each meter one at a time. i think i'll have an easier time understanding each meters behavior this way.
“Whether you think you can, or you think you can't – you're right”

DeviantArt Profile
User avatar
Yincognito
Posts: 1936
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: RainRGB4.exe help and questions

Post by Yincognito »

Hackit wrote:
April 5th, 2020, 3:45 pm
i think i'm going to start from scratch and add each meter one at a time. i think i'll have an easier time understanding each meters behavior this way.
It's a good idea. But first you should include the (possibly long) current condition meter - so that you have the reference on which to base the rest of the positions and dimensions, then, as you said, add each of the other meters one at a time.