tips:batterymeters
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tips:batterymeters [2015/01/21 19:13] – [Via Circle Shaders:] jt3 | tips:batterymeters [2015/01/21 19:57] – [Circle Shaders (Segments)] jt3 | ||
---|---|---|---|
Line 8: | Line 8: | ||
| | ||
| | ||
+ | |||
+ | ==== Via Circle Shaders ==== | ||
+ | (Segment Between – Opacity in range 100%, Opacity Out of range 0%) | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | ===== Intro to Battery Meters ===== | ||
+ | |||
Battery Meters are one of the most requested “Math” functions among users of WatchMaker. | Battery Meters are one of the most requested “Math” functions among users of WatchMaker. | ||
Line 21: | Line 34: | ||
Segmented meters are used when you want an “LED” effect, where you light up equal segments such that an entire segment lights at once. This is very common for battery meters and makes a cool effect. | Segmented meters are used when you want an “LED” effect, where you light up equal segments such that an entire segment lights at once. This is very common for battery meters and makes a cool effect. | ||
+ | ===== Explanation of Examples ===== | ||
+ | ==== Rotation ==== | ||
So let’s explain those examples. | So let’s explain those examples. | ||
- | The first example is a simple meter, working as a clock hand. 100% at 12:00, moving counterclockwise, | + | The first example is a simple meter, working as a clock hand. 100% at 12:00, moving counterclockwise, |
+ | |||
+ | 3.6*{bl} | ||
The next couple examples assume more of a “watch battery on one side, phone battery on the other” approach. | The next couple examples assume more of a “watch battery on one side, phone battery on the other” approach. | ||
- | The first example of the set is the left side. We’re basically just cutting the first example in half, so the rotation is the same, but we need to start at 180ᵒ, instead of 0ᵒ, and the meter only has to move half as far. So, we reduce the multiplier down to 1.8, and we add the start point at the end. Thus, 3.6*{bl} becomes | + | The first example of the set is the left side. We’re basically just cutting the first example in half, so the rotation is the same, but we need to start at 180ᵒ, instead of 0ᵒ, and the meter only has to move half as far. So, we reduce the multiplier down to 1.8, and we add the start point at the end. Thus, 3.6*{bl} becomes... |
- | The second of the set needs to rotate in the other direction, so we take the INVERSE of battery percentage. | + | (1.8*{bl})+180 |
- | **Segments.** | + | The second of the set needs to rotate in the other direction, so we take the INVERSE of battery percentage. |
+ | | ||
+ | |||
+ | ==== Circle Shaders (Segments) ==== | ||
This is where things tend to get tricky. | This is where things tend to get tricky. | ||
Line 39: | Line 59: | ||
For these examples, we’re going to duplicate the “watch on one side/ | For these examples, we’re going to duplicate the “watch on one side/ | ||
- | On the left side, the formula is %%180+(9*(math.floor(({bl}/ | + | On the left side, the formula is %%180+(9*(math.floor(({bl}/ |
+ | |||
+ | 180+(9*(math.floor(({bl}/ | ||
+ | |||
+ | For the right side we’re moving the other way, so we end at 180ᵒ and subtract the rest, where we’d added before. | ||
- | For the right side we’re moving the other way, so we end at 180ᵒ and subtract the rest, where we’d added before. | + | 180-(9*(math.floor(({bl}/ |
tips/batterymeters.txt · Last modified: 2015/01/22 05:01 by jt3