It is currently September 14th, 2024, 10:24 pm

Help to assemble a formula

Get help with creating, editing & fixing problems with skins
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 19th, 2023, 6:39 pm Not sure about your math skills, but the TransformationMatrx option is extremely well described here (I think I already posted the link, however...). Specifically the rotation is described into the Transformations section. According to this description, the first four elements of the TransformationMatrix option have to be the following ones:
  • a = cos(angle)
  • b = -sin(angle)
  • c = sin(angle)
  • d = cos(angle)
Obviously angle is the rotation angle, which in my code is used as #InclinationAngle#. Additionally I added a Rad(#InclinationAngle#) function, to convert the degree-expressed angle into radians.
The last two (fifth and sixth - tx and ty) elements of the above TransformationMatrix option are taken from the What the heck is Rainmeter doing?! section. The formulas used there has been adapted to our needs. The x, x', y and y' parameters are set to the horizontal respectively vertical center of the image. For the horizontal center for instance I used the ([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2) expression. In this expression #CURRENTSECTION# represents the section in which this variable is used (in this case [MeterFrame]). [#CURRENTSECTION#:X] is the horizontal position of the meter (this is a section variable), while [#CURRENTSECTION#:W] is the width of the same meter. Adding together the horizontal position of a meter and half of its width, we get the position of the center of that image (or meter). Same applies for the vertical position as well.
These parameters have been used to calculate the tx and ty parameters of the TransformationMatrix option.
Finally the six above elements have been added to form the TransformationMatrix option.


Instead of Size, I used a Scale variable. It is handled by the following sections of the Mirage\Settings\Settings.ini skin:

Code: Select all

[MenuFieldStringStyle]
FontColor=0,0,0
FontEffectColor=220,220,220
StringEffect=Shadow
FontFace=#FontName#
StringStyle=BOLD
ClipString=1
AntiAlias=1
Hidden=1

[MenuButtonStyle]
MyModifiers1=Fill Color #ButtonColor#
MyModifiers2=StrokeWidth 1
MyModifiers3=Stroke Color #ButtonStrokeColor#

[MeterScaleField]
Meter=Shape
MeterStyle=FieldStyle
X=0
Y=0
Shape=Rectangle 0,0,60,18 | Extend CheckModifiers
CheckModifiers=Fill Color 225,225,225 | StrokeWidth 1 | Stroke Color #CheckStrokeColor#
MouseScrollUpAction=[!SetVariable Size "(Clamp((#Size#+1),1,15))"]...
MouseScrollDownAction=[!SetVariable Size "(Clamp((#Size#-1),1,15))"]...
LeftMouseUpAction=[!CommandMeasure "MeasureInputScale" "ExecuteBatch 1"]
DynamicVariables=1
Group=General

[MeterScaleValue]
Meter=STRING
MeterStyle=MenuFieldStringStyle
X=33r
Y=0r
FontSize=10
StringAlign=RIGHT
Text=#Size#
DynamicVariables=1
Group=General

[MeterScaleUp]
Meter=Shape
MeterStyle=MenuButtonStyle
X=9r
Y=0r
Shape=Rectangle 0,0,18,9 | Extend MyModifiers1 | Extend MyModifiers2 | Extend MyModifiers3
LeftMouseUpAction=[!SetVariable Size "(Clamp((#Size#+1),1,15))"]...

[MeterScaleUpLabel]
Meter=String
X=9r
Y=4r
FontColor=220,220,220
FontEffectColor=0,0,0
SolidColor=0,0,0,1
StringEffect=Shadow
FontFace=Arrows
StringStyle=BOLD
AntiAlias=1
FontSize=8
StringAlign=CENTERCENTER
DynamicVariables=1
Text=S
Group=General

[MeterScaleDown]
Meter=Shape
MeterStyle=MenuButtonStyle
X=-9r
Y=5r
Shape=Rectangle 0,0,18,9 | Extend MyModifiers1 | Extend MyModifiers2 | Extend MyModifiers3
LeftMouseUpAction=[!SetVariable Size "(Clamp((#Size#-1),1,15))"]...
Group=General

[MeterScaleDownLabel]
Meter=String
X=9r
Y=4r
FontColor=220,220,220
FontEffectColor=0,0,0
SolidColor=0,0,0,1
StringEffect=Shadow
FontFace=Arrows
StringStyle=BOLD
AntiAlias=1
FontSize=8
StringAlign=CENTERCENTER
DynamicVariables=1
Text=T
Group=General
This is a quite simplified code, but it doesn't use images. But it requires to have the Arrows.ttf font into the @Resources\Fonts folder. If you place the above file there, Rainmeter will be able to use it.
Not too easy, definitely. Try to implement it if you want and if any question arises, pack the config you have and upload the package here, along with a description of the issue. Will try to take a look.
Read this way it is more understandable, if I like mathematics what happens is that all those calculations are complex, once you start reading and searching them you begin to understand, the angles already work correctly. and taking ideas from your skin I got to work and managed to make the buttons to select the size from 1 to 15, and I did the same with the angles. I already have that working, for a single planet, but since I have several, I wanted to use this same code to write to the variables. Here I leave you the publication that I made to my friend Yincognito so that you can also give your opinion when you can.

Help, using these forms does not write the variable correctly, I know something went wrong, but I can't figure out what, since the value does appear correctly. As before, the SizeVenus variable must be created there to write the value of that variable in the Variables file, then update the skin of that planet, the latter if done correctly. Are you telling me what I'm doing wrong??? :-( :-( :-(

Applying it this way
ButtonCommand=[!WriteKeyValue Variables "[#*Size[#*Planet*]]" "#Size#" "#@#\Config\Variables.inc"][!Refresh "@AL\Planetas\#Planet#" "#Planet#.ini"]
The written variable
[#*Size[#Planet]]=7


Applying it this way
ButtonCommand=[!WriteKeyValue Variables [#Size[#Planet]] "#Size#" "#@#\Config\Variables.inc"][!Refresh "@AL\Planetas\#Planet#" "#Planet#.ini"]
The written variable
5=9

I already managed to create a separate code to vary the size of the planets and the angle of rotation, writing this in the corresponding variable in the Variables file. but with a single planet it works perfectly, now I want to use a variable that will be called PlanetSelect for when. I select planet Venus from a button PlanetSelect=Venus
From there I want the button that I show in the photo, the one that says ok, to write the selected value for the size on the correct planet. I would use this line ButtonCommand=[!WriteKeyValue Variables [#*Size[#*Planet*]] "#Size#" "#@#\Config\Variables.inc"][!Refresh
"@AL\Planets\#Planet#" "#Planet#.ini"]
but I can't get it to write to the variable that I am creating.
Image
I'm doing all this so as not to make the code so extensive, having to make the buttons for each planet in the configuration mask, and use them only once. Is it possible or am I inventing too much??? :confused: :confused:
PD:I am writing to both of you to notify you both of the publication.
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
balala
Rainmeter Sage
Posts: 16539
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: September 20th, 2023, 1:15 am Read this way it is more understandable, if I like mathematics what happens is that all those calculations are complex, once you start reading and searching them you begin to understand, the angles already work correctly. and taking ideas from your skin I got to work and managed to make the buttons to select the size from 1 to 15, and I did the same with the angles. I already have that working, for a single planet,
Great!
arcanosa84 wrote: September 20th, 2023, 1:15 am Help, using these forms does not write the variable correctly, I know something went wrong, but I can't figure out what, since the value does appear correctly. As before, the SizeVenus variable must be created there to write the value of that variable in the Variables file, then update the skin of that planet, the latter if done correctly. Are you telling me what I'm doing wrong??? :-( :-( :-(

Applying it this way
ButtonCommand=[!WriteKeyValue Variables "[#*Size[#*Planet*]]" "#Size#" "#@#\Config\Variables.inc"][!Refresh "@AL\Planetas\#Planet#" "#Planet#.ini"]
The written variable
[#*Size[#Planet]]=7


Applying it this way
ButtonCommand=[!WriteKeyValue Variables [#Size[#Planet]] "#Size#" "#@#\Config\Variables.inc"][!Refresh "@AL\Planetas\#Planet#" "#Planet#.ini"]
The written variable
5=9
Try any of these: ButtonCommand=[!WriteKeyValue Variables "Size[#Planet]" "#Size#"][!Refresh "@AL\Planetas\#Planet#"], or ButtonCommand=[!WriteKeyValue Variables "Size#Planet#" "#Size#"][!Refresh "@AL\Planetas\#Planet#"]. If I'm not mistaken, the variable which has to be written is SizeVenus (for instance). If this is correct, the name of the variable contains the Size word and the name of the planet stored as the Planet variable. To write this variable you don't have to use a [#Size...] variable. Size is the term to be written, not the value of the Size variable.
Also note that I replaced the [!Refresh "@AL\Planetas\#Planet#" "#Planet#.ini"] bang by [!Refresh "@AL\Planetas\#Planet#"]. Most bangs (among others !Refresh is such a bang) doesn't require the name of the skin you want to refresh, just the name of the config which contains the skin. In your case assuming the skin is @AL\Planetas\Venus\Venus.ini, the config of this skin is @AL\Planetas\Venus and this is all a !Refresh bang needs.
There are only two bangs which are requiring the name of the skin: !ActivateConfig and !ToggleConfig. All others are requiring only the name of the config, because since you can't activate two skins from the same config at the same time, Rainmeter identifies the skin by its Config name.
Adding the skin name keeps the bang working, because Rainmeter simply ignores the not-necessary parameters (in this case the name of the skin), but strictly speaking, the name of the skin is not required.
arcanosa84 wrote: September 20th, 2023, 1:15 am I already managed to create a separate code to vary the size of the planets and the angle of rotation, writing this in the corresponding variable in the Variables file. but with a single planet it works perfectly,
O.O Not sure I follow. Just above did you say you couldn't write the Size... variable. So did or didn't succeeded in writing the variable?
arcanosa84 wrote: September 20th, 2023, 1:15 am From there I want the button that I show in the photo, the one that says ok, to write the selected value for the size on the correct planet. I would use this line ButtonCommand=[!WriteKeyValue Variables [#*Size[#*Planet*]] "#Size#" "#@#\Config\Variables.inc"][!Refresh
"@AL\Planets\#Planet#" "#Planet#.ini"]
but I can't get it to write to the variable that I am creating.
Try the option with the parameters as described above (Size[#Planet] or Size#Planet#). Does the skin write the proper value this way?
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 20th, 2023, 8:00 pm Great!

Try any of these: ButtonCommand=[!WriteKeyValue Variables "Size[#Planet]" "#Size#"][!Refresh "@AL\Planetas\#Planet#"], or ButtonCommand=[!WriteKeyValue Variables "Size#Planet#" "#Size#"][!Refresh "@AL\Planetas\#Planet#"]. If I'm not mistaken, the variable which has to be written is SizeVenus (for instance). If this is correct, the name of the variable contains the Size word and the name of the planet stored as the Planet variable. To write this variable you don't have to use a [#Size...] variable. Size is the term to be written, not the value of the Size variable.
Also note that I replaced the [!Refresh "@AL\Planetas\#Planet#" "#Planet#.ini"] bang by [!Refresh "@AL\Planetas\#Planet#"]. Most bangs (among others !Refresh is such a bang) doesn't require the name of the skin you want to refresh, just the name of the config which contains the skin. In your case assuming the skin is @AL\Planetas\Venus\Venus.ini, the config of this skin is @AL\Planetas\Venus and this is all a !Refresh bang needs.
There are only two bangs which are requiring the name of the skin: !ActivateConfig and !ToggleConfig. All others are requiring only the name of the config, because since you can't activate two skins from the same config at the same time, Rainmeter identifies the skin by its Config name.
Adding the skin name keeps the bang working, because Rainmeter simply ignores the not-necessary parameters (in this case the name of the skin), but strictly speaking, the name of the skin is not required.

O.O Not sure I follow. Just above did you say you couldn't write the Size... variable. So did or didn't succeeded in writing the variable?

Try the option with the parameters as described above (Size[#Planet] or Size#Planet#). Does the skin write the proper value this way?
Hello hello, yes, using the variant that you gave me solved the problem, obviously it put in the best case scenario the value of the variable, and the idea is that I would enter the name to be able to write it correctly, that is now solved. I've tried both ways and they both work. :great: :great:
O.O Not sure I follow. Just above did you say you couldn't write the Size... variable. So did or didn't succeeded in writing the variable?
Let's see if I managed it and it worked perfectly with a single planet, that is, I wrote SizeVenus directly and that's it, the planet was updated correctly, where the code failed was when I wrote the variable incorrectly when I wanted to configure it to add a variant and be able to use the same code to write the variables of all the planets.
I am going to add a button in the configuration skin to change the Planet variable to the corresponding planet and thus configure all of them with the same code. I publish it so you can see how the configuration part is going. I wish the speed could be manipulated in another way other than by Update=70, so there are some that turn very fast and others very slow, but when varying a little it gives like small jumps if it is very slow, that is, with Update=300 per example.
Now I'll show you how I go with that code.
Thank you very much for clarifying, I spent all night reading the part about the variables, and the solution was simpler than I thought, thanks again. :great: :great: :great: :great:

Code: Select all

[Rainmeter]
Update=70
MouseActionCursor=0

[Variables]
@Include=#@#\Config\Variables.inc
@Include2=#@#\Config\Styles.inc
@Include3=#@#\Config\Links.inc

Planet=#PlanetSelect#
Size=[#Size[#Planet]]
Speed=[#Speed[#Planet]]
Angle=[#InclinationAngle[#Planet]]

;-----------------------------------------------------------
;     Modificación Tamaño Planetas
;-----------------------------------------------------------

[MeterEditSize]
Meter=Image
ImageName=EditSize.png
X=0
Y=30
DynamicVariables=1

[MeasureInputSize]
Measure=Plugin
Plugin=InputText.dll
SolidColor=250,250,250,250
StringAlign=RIGHT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=0,0,0
FontFace=#Font6#
FontSize=8
X=5
Y=33
W=14
H=16
FocusDismiss=1
DefaultValue=""
Command1=[!SetVariable Size "$UserInput$"]
DynamicVariables=1

[MeterInputSize]
Meter=STRING
StringAlign=RIGHT
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=245,245,245,20
FontColor=0,0,0
FontFace=#Font6#
FontSize=8
AntiAlias=1
ClipString=0
X=18r
Y=32
W=16
H=16
Text=#Size#
LeftMouseUpAction=!RainmeterPluginBang "MeasureInputSize ExecuteBatch 1"
DynamicVariables=1

[SizeUp]
Meter=BUTTON
ButtonImage=Up.png
X=2r
Y=-2r
ButtonCommand=[!SetVariable Size (#Size#>=#SizeMax#?#SizeMin#:(#Size#+1))]
DynamicVariables=1

[SizeDown]
Meter=BUTTON
ButtonImage=Down.png
X=0r
Y=10r
ButtonCommand=[!SetVariable Size (#Size#<=#SizeMin#?#SizeMax#:(#Size#-1))]
DynamicVariables=1

[SizeOk]
Meter=BUTTON
ButtonImage=Ok.png
X=13r
Y=-10r
ButtonCommand=[!WriteKeyValue Variables "Size[#Planet]" "#Size#" "#@#\Config\Variables.inc"][!Refresh "@AL\Planetas\#Planet#"]
DynamicVariables=1

[MeterSize]
Meter=String
X=7
Y=50
FontSize=6
FontFace=#Font6#
FontColor=255,255,255
StringAlign=LEFT
Text=Tamaño
DynamicVariables=1
AntiAlias=1

;-----------------------------------------------------------
;     Modificación Velocidad Giro Planetas
;-----------------------------------------------------------

[MeterEditSpeed]
Meter=Image
ImageName=EditSpeed.png
X=60
Y=30
DynamicVariables=1

[MeasureInputSpeed]
Measure=Plugin
Plugin=InputText.dll
SolidColor=250,250,250,250
StringAlign=RIGHT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=0,0,0
FontFace=#Font6#
FontSize=8
X=65
Y=33
W=14
H=16
FocusDismiss=1
DefaultValue=""
Command1=[!SetVariable Speed "$UserInput$"]
DynamicVariables=1

[MeterInputSpeed]
Meter=STRING
StringAlign=RIGHT
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=245,245,245,20
FontColor=0,0,0
FontFace=#Font6#
FontSize=8
AntiAlias=1
ClipString=0
X=18r
Y=32
W=16
H=16
Text=#Speed#
LeftMouseUpAction=!RainmeterPluginBang "MeasureInputSpeed ExecuteBatch 1"
DynamicVariables=1

[SpeedUp]
Meter=BUTTON
ButtonImage=Up.png
X=2r
Y=-2r
ButtonCommand=[!SetVariable Speed (#Speed#>=#SpeedMax#?#SpeedMin#:(#Speed#+1))]
DynamicVariables=1

[SpeedDown]
Meter=BUTTON
ButtonImage=Down.png
X=0r
Y=10r
ButtonCommand=[!SetVariable Speed (#Speed#<=#SpeedMin#?#SpeedMax#:(#Speed#-1))]
DynamicVariables=1

[SpeedOk]
Meter=BUTTON
ButtonImage=Ok.png
X=13r
Y=-10r
ButtonCommand=[!WriteKeyValue Variables "Speed[#Planet]" "#Speed#" "#@#\Config\Variables.inc"][!Refresh "@AL\Planetas\#Planet#"]
DynamicVariables=1

[MeterSpeed]
Meter=String
X=65
Y=50
FontSize=6
FontFace=#Font6#
FontColor=255,255,255
StringAlign=LEFT
Text=Velocidad
DynamicVariables=1
AntiAlias=1

;-----------------------------------------------------------
;     Modificación Angulo Giro Planetas
;-----------------------------------------------------------

[MeterEditAngle]
Meter=Image
ImageName=EditAngle.png
X=120
Y=30
DynamicVariables=1

[MeasureInputAngle]
Measure=Plugin
Plugin=InputText.dll
SolidColor=250,250,250,250
StringAlign=RIGHT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=0,0,0
FontFace=#Font6#
FontSize=8
X=135
Y=33
W=25
H=16
FocusDismiss=1
DefaultValue=""
Command1=[!SetVariable Angle "$UserInput$"]
DynamicVariables=1

[MeterInputAngle]
Meter=STRING
StringAlign=RIGHT
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=245,245,245,20
FontColor=0,0,0
FontFace=#Font6#
FontSize=8
AntiAlias=1
ClipString=0
X=31r
Y=2r
W=16
H=16
Text=#Angle#
LeftMouseUpAction=!RainmeterPluginBang "MeasureInputAngle ExecuteBatch 1"
DynamicVariables=1

[AngleUp]
Meter=BUTTON
ButtonImage=Up.png
X=1r
Y=-2r
ButtonCommand=[!SetVariable Angle (#Angle#>=#AngleMax#?#AngleMin#:(#Angle#+1))]
DynamicVariables=1

[AngleDown]
Meter=BUTTON
ButtonImage=Down.png
X=0r
Y=10r
ButtonCommand=[!SetVariable Angle (#Angle#<=#AngleMin#?#AngleMax#:(#Angle#-1))]
DynamicVariables=1

[AngleOk]
Meter=BUTTON
ButtonImage=Ok.png
X=13r
Y=-10r
ButtonCommand=[!WriteKeyValue Variables "InclinationAngle[#Planet]" "#Angle#" "#@#\Config\Variables.inc"][!Refresh "@AL\Planetas\#Planet#"]
DynamicVariables=1

[MeterAngle]
Meter=String
X=130
Y=20r
FontSize=6
FontFace=#Font6#
FontColor=255,255,255
StringAlign=LEFT
Text=Angulo
DynamicVariables=1
AntiAlias=1

:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
balala
Rainmeter Sage
Posts: 16539
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: September 20th, 2023, 8:51 pm Now I'll show you how I go with that code.
This is not working. The code involves lot of resources which we don't have (for instance Up.png, Down.png and OK.png images, but there are more such files). So pack please the whole config, containing all of those skins and all resources and upload the package here.
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 21st, 2023, 5:33 pm This is not working. The code involves lot of resources which we don't have (for instance Up.png, Down.png and OK.png images, but there are more such files). So pack please the whole config, containing all of those skins and all resources and upload the package here.
Can I vary the size of the type of bit images? Since with H and W I cannot do it, and according to the manual it is valid for this type of images. So I'm applying something wrong.
I only shared the part of a planet with you so you can see it since everything weighs a lot and doesn't allow me to, but well, the skin I made has been tested to modify the size, speed and angle of each planet, in my configuration skin I go to place a button to select the planet to edit, but everything now works perfectly, thanks to the help you gave me with the variable.
Tell me what you think. :great: :great:

Code: Select all

[MeterGlobe]
Meter=Bitmap
MeasureName=MeasureFrameCalc
X=10
Y=10
ImageTint=#ColorPlanet#
BitmapImage=#@#Images\#Planet#\#Planet#\#Planet#.png
BitmapFrames=120
BitmapExtend=1
BitmapZeroFrame=0
TransformationMatrix=(Cos(Rad(#InclinationAngle#)));(-Sin(Rad(#InclinationAngle#)));(Sin(Rad(#InclinationAngle#)));(Cos(Rad(#InclinationAngle#)));(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad(#InclinationAngle#))));(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad(#InclinationAngle#))))
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 21st, 2023, 5:33 pm This is not working. The code involves lot of resources which we don't have (for instance Up.png, Down.png and OK.png images, but there are more such files). So pack please the whole config, containing all of those skins and all resources and upload the package here.
Here I have a problem, I have to share part of my skin with you because otherwise I can't upload it, but here you can see the error, which is the following.
In the Settings skin, on page 2 when you select the sun below it appears to adjust size, speed and rotation angle. When you change something and save everything fine, but if right there, you open another planet, that is, the moon, the data that appears in the planet's options is no longer updated.
To open the settings just press the center icon on the correct group.
Please help me clarify this problem.
I have this option is these buttons
LeftMouseDownAction = [!DisableMeasureGroup Planet][!WriteKeyValue Variables PlanetSelect Sol "#@#\Config\Variables.inc"][!UpdateMeasureGroup Planet][!EnableMeasureGroup Planet][!ShowMeterGroup Planet]

The idea is to disable the group where this configuration is (At the end of the Code) Then I write the variable PlanetSelect=Sol, update the group, it is enabled and shown in case it is hidden.
but when you touch another planet the values are not updated.
tell me if you don't understand something
Thank you, and I hope you can help me. :confused: :confused: :confused:

This is the part of the code that creates the sun buttons

Code: Select all

.
.
[SelectPlanetSol]
Group=Pag2
Meter = Image
ImageName = #@#\Images\Sol\Sol\Sol0.png
x = 20r
y = -3r
W=21
H=21
LeftMouseDownAction = [!DisableMeasureGroup Planet][!WriteKeyValue Variables PlanetSelect Sol "#@#\Config\Variables.inc"][!UpdateMeasureGroup Planet][!EnableMeasureGroup Planet][!ShowMeterGroup Planet]
ToolTipType=1
ToolTipText=Sol
Hidden=1

[ColorSolPlaB]
Group=Pag2
Meter = Image
ImageName = #@#\Images\Settings\Button.png
ImageTint = #ColorSolPla#
x = 25r
y = 3r
LeftMouseDownAction = [!ShowMeter WarningInput][!HideMeter ResetColor][!SetOption TypeboxColor ImageTint #ColorSolPla#][!SetOption InputColor DefaultValue #ColorSolPla#][!SetOption InputColor Command1 "[!WriteKeyValue Variables ColorSolPla "$UserInput$" "#@#\Config\Styles.inc"]"][!ShowMeter TypeboxColor][!PluginBang "MeasureInputSolPla ExecuteBatch 1"]
ToolTipType=1
ToolTipText=Cuerpo
Hidden=1
.
.
You do not have the required permissions to view the files attached to this post.
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
balala
Rainmeter Sage
Posts: 16539
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: September 21st, 2023, 7:04 pm Can I vary the size of the type of bit images? Since with H and W I cannot do it, and according to the manual it is valid for this type of images. So I'm applying something wrong.
I only shared the part of a planet with you so you can see it since everything weighs a lot and doesn't allow me to, but well, the skin I made has been tested to modify the size, speed and angle of each planet, in my configuration skin I go to place a button to select the planet to edit, but everything now works perfectly, thanks to the help you gave me with the variable.
Tell me what you think. :great: :great:
The posted code doesn't match the content of the attached installer. The skin file contained into the package (Planeta\Venus\Venus.ini) doesn't have a [MeterGlobe] Bitmap meter, but a [MeterFrame] Image meter. This Image meter can easily be resized by its W and H options.
A Bitmap indeed can't be resized by these options. There is another way to resize the skin, through the TransformationMatrix option. But the meter already has such an option, so you can't apply another one. However there is a workaround. You have to create another TransformationMatrix option, which just resizes the meter, then have to multiply together the two TransformationMatrix options. Not sure if this is easy, but definitely can be done.
However if you don't know how to do this (do you know?), before I start working with it, I'd like to know which skin are you using: the one with the Image meter (in which case there is nothing to be done, just apply the new W and H values), or the one with the Bitmap meter (needs the multiplied TransformationMatrix).

Another thing: once again I'm asking you not to take too huge steps at once. Let's first finish this and after we (you?) got the skin working as expected, I'm gonna try replying to your other question as well. But not all in same time. Sorry...
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 22nd, 2023, 6:42 pm The posted code doesn't match the content of the attached installer. The skin file contained into the package (Planeta\Venus\Venus.ini) doesn't have a [MeterGlobe] Bitmap meter, but a [MeterFrame] Image meter. This Image meter can easily be resized by its W and H options.
A Bitmap indeed can't be resized by these options. There is another way to resize the skin, through the TransformationMatrix option. But the meter already has such an option, so you can't apply another one. However there is a workaround. You have to create another TransformationMatrix option, which just resizes the meter, then have to multiply together the two TransformationMatrix options. Not sure if this is easy, but definitely can be done.
However if you don't know how to do this (do you know?), before I start working with it, I'd like to know which skin are you using: the one with the Image meter (in which case there is nothing to be done, just apply the new W and H values), or the one with the Bitmap meter (needs the multiplied TransformationMatrix).

Another thing: once again I'm asking you not to take too huge steps at once. Let's first finish this and after we (you?) got the skin working as expected, I'm gonna try replying to your other question as well. But not all in same time. Sorry...
Sorry, I don't know if it's the translation or the way it was published, but I'm confusing you.
I am working on applying the change in size, speed and rotation angle to all the planets, and I wanted to test how it went with the bitmap, it is a curious question since I saw that it could not be done as I tried with the H and W values .
The code that I showed you was that of the bitmap, and the configuration that I loaded was to show you how the code for modifying the planets had turned out, there were 2 things.
At this minute, what I need is to clarify the problem I have, I implemented the code for modifying the planets in my configuration mask and changed the appearance within it, but it is not working correctly.
When I try to change a planet everything is fine. When trying to change another one without leaving the same page, it doesn't work, no matter how much I put in the planet selection buttons to update the Planet group, which is the one I just finished trying to change the planets.
use this line to run and display the planet settings panel
LeftMouseDownAction = [!DisableMeasureGroup Planet][!WriteKeyValue Variables PlanetSelect Sol "#@#\Config\Variables.inc"][!UpdateMeasureGroup Planet][!EnableMeasureGroup Planet][!ShowMeterGroup Planet]
but when selecting another planet it continues to show the parameters of the previous one.
This is what I'm working on now, and what I need guidance on.
I don't know the TransformationMatrix formula to change the size, no matter how much I read, I couldn't do it, so after we can clarify the previous problem in my configuration mask, it would be necessary to work.
I have not yet finished configuring what we already clarified that since a skin is not in operation its buttons are hidden, until I finish with the planet buttons I cannot continue to have them shown and spend less work.
I'm going to share all my work with you so you can see everything at once, as it is now.
Sorry for the confusion, I'm not trying to go fast, it's just that I'm getting ahead of myself on some things and others are getting complicated.
I'm going to be more organized. :confused: :confused:
You do not have the required permissions to view the files attached to this post.
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow:
User avatar
balala
Rainmeter Sage
Posts: 16539
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help to assemble a formula

Post by balala »

arcanosa84 wrote: September 22nd, 2023, 7:18 pm I am working on applying the change in size, speed and rotation angle to all the planets, and I wanted to test how it went with the bitmap, it is a curious question since I saw that it could not be done as I tried with the H and W values .
If you use a Bitmap meter, as you figured out by yourself, the W and H options can't be used to resize the meter. Those options have other purposes in this case. As said before, what you can do is to apply two TransformationMatrix option: one to resize of the meter and the other to rotate it. But unfortunately there is no way to add two such options onto one meter. This is why you have to write separately both TransformationMatrix options and when you have both, have to multiply them together, according to the rules of multiplying matrices. How can you do this is described into the Applying a Transformation Matrix section of Transformation Matrix Guide. Don't know how familiar are you with working with matrices, but if you don't really know how to do such a multiplication, here is a quick workaround.
I worked with the @AL\Planetas\Globe\Globe.ini skin. In this skin you have applied a TransformationMatrix option to the [MeterGlobe] meter, which rotates the meter. I wrote another to resize it and multiplied these options together. This is what I got:

Code: Select all

[MeterGlobe]
...
TransformationMatrix=(#Size#*Cos(Rad(#InclinationAngle#)));(-1*#Size#*Sin(Rad(#InclinationAngle#)));(#Size#*Sin(Rad(#InclinationAngle#)));(#Size#*Cos(Rad(#InclinationAngle#)));(#Size#*(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad(#InclinationAngle#)))));(#Size#*(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad(#InclinationAngle#)))))
In order to get the skin looking alright, you have to:
  • Resize the [Atm] meter as well. The simplest solution in this case is to use the same TransformationMatrix option on this meter, as the one used for resizing the Bitmap meter. Add this option to the meter:
    TransformationMatrix=#Size#;0;0;#Size#;0;0.
  • However applying the above described options, the skin will not be entirely visible, because when you resize a meter (of any type) by a TransformationMatrix option, the skin sees that meter as with its original / unmodified size. So you have to tell the skin you have a larger (or smaller in some cases - why not?) meter: You can do this, by adding a SkinWidth and a SkinHeight option to the [Rainmeter] section of your skin. Add these options:

    Code: Select all

    [Rainmeter]
    ...
    SkinWidth=(185*#Size#)
    SkinHeight=(185*#Size#)
    Make sure not to alter or remove the existing options, just add these two.
Try replacing the old TransformationMatrix, by this one (however recommend to do a backup of your skin, before applying this option - just in case). This TransformationMatrix does two things (as described above): rotates the meter with an angle specified by the #InclinationAngle# variable and resizes it as specified by the #Size# variable.
Please check and let me know if you got this working as expected.
User avatar
arcanosa84
Posts: 173
Joined: May 21st, 2023, 1:47 am

Re: Help to assemble a formula

Post by arcanosa84 »

balala wrote: September 22nd, 2023, 8:11 pm If you use a Bitmap meter, as you figured out by yourself, the W and H options can't be used to resize the meter. Those options have other purposes in this case. As said before, what you can do is to apply two TransformationMatrix option: one to resize of the meter and the other to rotate it. But unfortunately there is no way to add two such options onto one meter. This is why you have to write separately both TransformationMatrix options and when you have both, have to multiply them together, according to the rules of multiplying matrices. How can you do this is described into the Applying a Transformation Matrix section of Transformation Matrix Guide. Don't know how familiar are you with working with matrices, but if you don't really know how to do such a multiplication, here is a quick workaround.
I worked with the @AL\Planetas\Globe\Globe.ini skin. In this skin you have applied a TransformationMatrix option to the [MeterGlobe] meter, which rotates the meter. I wrote another to resize it and multiplied these options together. This is what I got:

Code: Select all

[MeterGlobe]
...
TransformationMatrix=(#Size#*Cos(Rad(#InclinationAngle#)));(-1*#Size#*Sin(Rad(#InclinationAngle#)));(#Size#*Sin(Rad(#InclinationAngle#)));(#Size#*Cos(Rad(#InclinationAngle#)));(#Size#*(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)-(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Cos(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Sin(Rad(#InclinationAngle#)))));(#Size#*(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)+(([#CURRENTSECTION#:X]+[#CURRENTSECTION#:W]/2)*Sin(Rad(#InclinationAngle#)))-(([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:H]/2)*Cos(Rad(#InclinationAngle#)))))
In order to get the skin looking alright, you have to:
  • Resize the [Atm] meter as well. The simplest solution in this case is to use the same TransformationMatrix option on this meter, as the one used for resizing the Bitmap meter. Add this option to the meter:
    TransformationMatrix=#Size#;0;0;#Size#;0;0.
  • However applying the above described options, the skin will not be entirely visible, because when you resize a meter (of any type) by a TransformationMatrix option, the skin sees that meter as with its original / unmodified size. So you have to tell the skin you have a larger (or smaller in some cases - why not?) meter: You can do this, by adding a SkinWidth and a SkinHeight option to the [Rainmeter] section of your skin. Add these options:

    Code: Select all

    [Rainmeter]
    ...
    SkinWidth=(185*#Size#)
    SkinHeight=(185*#Size#)
    Make sure not to alter or remove the existing options, just add these two.
Try replacing the old TransformationMatrix, by this one (however recommend to do a backup of your skin, before applying this option - just in case). This TransformationMatrix does two things (as described above): rotates the meter with an angle specified by the #InclinationAngle# variable and resizes it as specified by the #Size# variable.
Please check and let me know if you got this working as expected.
I was reading a post where you explained this term, which is not for my case, just to increase the size, in this case you combined it, I was trying to understand the steps. Thank you very much for explaining it again. :great: :great:

PD:Although in this case it is only to increase its size, it cannot be made smaller than it is. From what I have tried, if I am wrong, tell me, and I set everything as you indicated and it only increases correctly. :thumbup:
:Whistle :Whistle Learning is the most complete art of life. Just enjoy it. :bow: :bow: