Say I want to get a few shape meters to act together, using the same rules, but with different variables for each meter.
With other languages I would make a class with all the functions I need, and then create the meters as members of that class.
How does this work with Lua/Rainmeter? In what direction should I google?
It is currently April 18th, 2024, 4:39 am
How do classes work with skins?
-
- Posts: 10
- Joined: January 3rd, 2020, 5:43 pm
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: How do classes work with skins?
Kinda apples and oranges here really. There are no classes or other object oriented stuff in Rainmeter.RichKat666 wrote: ↑January 3rd, 2020, 5:53 pm Say I want to get a few shape meters to act together, using the same rules, but with different variables for each meter.
With other languages I would make a class with all the functions I need, and then create the meters as members of that class.
How does this work with Lua/Rainmeter? In what direction should I google?
Can you give an example of what you are trying to accomplish?
-
- Posts: 10
- Joined: January 3rd, 2020, 5:43 pm
Re: How do classes work with skins?
Say I have a few shape meters.
I want them to, for example:
1) Float around in similar ways when idle
2) Wiggle in the same manner when music is played
3) Shrink when they come near the cursor.
This seems like the sort of thing that would be accomplished with classes elsewhere, which is why I brought them up
I want them to, for example:
1) Float around in similar ways when idle
2) Wiggle in the same manner when music is played
3) Shrink when they come near the cursor.
This seems like the sort of thing that would be accomplished with classes elsewhere, which is why I brought them up
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: How do classes work with skins?
Might not be really productive to start with a coding approach that doesn't exist in Rainmeter, when I would probably first ask how one moves shapes in a general sense.
There is no really easy answer to that, but you might look at these skins from ecectic-tech that moves shapes in response to music.
https://www.deviantart.com/search/deviations/visual-art/resource/digital-art?order=most-recent&q=rainmeter%20eclectic-tech
https://www.deviantart.com/eclectic-tech/art/Stereo-Optic-Visualizers-805768508
There is no really easy answer to that, but you might look at these skins from ecectic-tech that moves shapes in response to music.
https://www.deviantart.com/search/deviations/visual-art/resource/digital-art?order=most-recent&q=rainmeter%20eclectic-tech
https://www.deviantart.com/eclectic-tech/art/Stereo-Optic-Visualizers-805768508
-
- Posts: 10
- Joined: January 3rd, 2020, 5:43 pm
Re: How do classes work with skins?
Wait, really? With all the stuff you can do to shape meters, as you yourself described here[/https://forum.rainmeter.net/viewtopic.php?t=24292], I would have thought you could just change the position of the transform? Or, failing that, just re-draw the shape at another location? Is it really that implausible?
And does all that mean that if I want a few meters to do the same thing I should just copy-and-paste the code?
Thank you for all your responses.
And does all that mean that if I want a few meters to do the same thing I should just copy-and-paste the code?
Thank you for all your responses.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: How do classes work with skins?
It is pretty unlimited what you can do with Rainmeter. Sure you can dynamically change any part of a shape meter based on whatever action or reaction you want.RichKat666 wrote: ↑January 5th, 2020, 12:15 pm Wait, really? With all the stuff you can do to shape meters, as you yourself described here[/https://forum.rainmeter.net/viewtopic.php?t=24292], I would have thought you could just change the position of the transform? Or, failing that, just re-draw the shape at another location? Is it really that implausible?
And does all that mean that if I want a few meters to do the same thing I should just copy-and-paste the code?
Thank you for all your responses.
But yes, you would need a different meter for each shape, which can in fact just be a copy-paste of the same stuff. Then you take actions to change the various sizes, positions, colors etc. of each shape meter as you like.
-
- Posts: 10
- Joined: January 3rd, 2020, 5:43 pm
Re: How do classes work with skins?
Ok, got it. It's kind of sad that if I want to change one thing I have to change each document individually.
Thank you very much for your help.
Thank you very much for your help.
-
- Rainmeter Sage
- Posts: 5391
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: How do classes work with skins?
You don't have to change every document necessarily, you could change an @include file which each skin uses, then refresh the skins to see the change.RichKat666 wrote: ↑January 5th, 2020, 12:36 pm Ok, got it. It's kind of sad that if I want to change one thing I have to change each document individually.
Thank you very much for your help.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Rainmeter Sage
- Posts: 2602
- Joined: March 23rd, 2015, 5:26 pm
Re: How do classes work with skins?
Don't forget about using styles. You can create a style for meter then re-use it as many times as you want with only needing to add in whatever specific unique attributes you need. It's not quite like objects, and inheritance is only 1-level deep (I think), but the effect is similar.