ikarus1969 corrected the coding issues, so you can see a bar display set at a static 40%.
When I scale a skin, I prefer to use a multiplier of 1x's the original size; so setting #Scale# to 2 would make the skin twice as large.
Here is code that generates random values of a SCALE variable between 0.1x and 5.0x, every 3 seconds, to scale meters.
Code: Select all
[rainmeter]
Update=1000
DynamicWindowSize=1
[Variables]
WIDGETSIZE=500
; Skins are designed at a scale of 1x
; I prefer to use that as the starting "Scale"
; For most skins a scale between 0.1x and 5.0x provide enough scalability
Scale=1
;used to display resulting scale
[MeterString]
Meter=String
X=250
Y=40
fontSize=(10*#Scale#)
Text=AAAA @ #Scale#x
StringAlign=CenterCenter
DynamicVariables=1
; Will return a value between 0.1 and 5.0
[measureSize]
Measure = Calc
; RANDOM numbers are integers, so to get fractional values (less than 1.0) we must divide
Formula = (Random / 10)
; These set the range of RANDOM
LowBound=1
HighBound=50
; These are for percentage values in bar and other percentual meters
MinValue=0.1
MaxValue=5.0
; When the value changes, change the SCALE variable and update
OnUpdateAction=[!SetVariable Scale [MeasureSize]][!UpdateMeter *][!Redraw]
DynamicVariables=1
UpdateDivider=3
;bar
[MeterSizeBar]
Meter=Bar
; MeasureName= is the proper syntax
MeasureName=measureSize
X=0
Y=80
W=500
H=55
BarColor=255,0,0,255
SolidColor=255,255,255,255
BarOrientation=Horizontal
DynamicVariables=1
scalerandom.gif
Here is a variation of your code that allows you to left-click on the bar meter to set the same scale.
Code: Select all
[rainmeter]
Update=1000
DynamicWindowSize=1
[Variables]
WIDGETSIZE=500
; Skins are designed at a scale of 1x
; I prefer to use that as the starting "Scale"
; For most skins a scale between 0.1x and 5.0x provide enough scalability
Scale=1
;used to display resulting scale
[MeterString]
Meter=String
X=250
Y=40
fontSize=(10*#Scale#)
Text=AAAA @ #Scale#x
StringAlign=CenterCenter
DynamicVariables=1
; Will provide a percentage value for the bar meter
[measureSize]
Measure = Calc
Formula = #Scale#
; These are for percent values in bar and other percentage meters
MinValue=0.1
MaxValue=5.0
DynamicVariables=1
;bar
[MeterSizeBar]
Meter=Bar
; MeasureName= is the proper syntax
MeasureName=measureSize
X=0
Y=80
W=500
H=55
BarColor=255,0,0,255
SolidColor=255,255,255,255
BarOrientation=Horizontal
; Using 'Up' action allows skins to be dragged by the mouse
; Click the bar to set the text to a new scale
LeftMouseUpAction=[!SetVariable Scale "($MouseX$/100)"][!UpdateMeter *][!Redraw]
DynamicVariables=1
scaleclick.gif
I modified your bar meter width to 500 so the mouse position when divided by 100 returns 0.0 to 5.0 as the SCALE value.
I find a SCALE variable based on deviation from 1x is more versatile than 1 percentage value, used directly in formulas and in TransformationMatrix.
Feel free to use or not, we each have methods that feel "right" for us...
You do not have the required permissions to view the files attached to this post.