I’m looking for an unusual code again.
I want to create 16 fields.
These 16 fields are intended to show the batt status in stages.
That would actually be relatively easy.
now comes the hard part…
I don’t just want to turn it on and off, I want to dim it.
So link visibility to battery level.
At 100% all circles are at 100 opacity.
The battery level goes down, the the 5th circle gets dimmer, once battery is below 80, opacity is 0. And so on.
ok.
Take the 1st circle. I want it to dim between level 2 and level 20 of the battery (could also be 0-20). So the condition should be: if BLN bigger 2, then show a dimmed value. Below 2, value is 0.
At level 20 it should have opacity 100, so I need the opacity to be 5x20. If the battery level is 21, obviously, the formula will have opacity 5x21, but I don’t care. In the opacity field anything bigger 100 will be the same as 100.
The 2nd circle, I want it to dim between 20-40, so at level 40, the opacity needs to be 100, so BLNx2.5.
I just ask myself one question…
the dimming is evenly distributed among all, right?
i.e. the dimming is always calculated from the entire 100% of the battery…
is there a way to modify the code, so the circle doesn’t start dimming ubtil it drops to 60%? Or is there another way to keep the circle at full opacity longer? (with dimming between 60 - 20%)
RN, I’m using a slightly modified code to make the gem dim until 20%, as the battery depletes
$#BLN#>=20?#BLN#:0$
Goal is to postpone the dimming, so the gem remains at full opacity (=full glow) until it drops below 60%, then it starts going dark.
Are you talking about the gem in the centre . Not that it makes any difference . If it was a liner solution I would take the Battery count down from something like 160 . Easier if I show you . I am intrigued to see how your Formula works . Just dimming something is not the best data but good for character . I would have some sort of pointer .
.
.
Here is a basic test . I have better Fading formulas for three layers. Red and Green do not mix well Blue and Red do . See the number that can be changed 400 gives a fade starting at 25% 200 Gives 50% etc .
I presume oy know how to inspect this Face To get the Formula .
.
.
Thanks, thad did the trick. There are some points in the code, that I don’t understand, why do I get different results by removing brackets? Also, what’s the correlation between the number and the point the gem starts fading?
I didn’t think of giving accurate data on the battery, the gems were supposed to be the energy source of magickal machinery. The dimming is simply the gem running out of energy.
No it is all good what you are doing .
I use Brackets on everything Because I am not a Mathematician . If you know what you are doing in maths you know the Precedence of the operands . So which is done first + or * . I can not remember , so the most nested maths is done first . ( in the Middle ) The first part makes the Battery percent into a number between 0 and 1 .Then multiply that by say 400 . That gives you a number 400 to 0 imitating the battery percent . While the number is over 100 it will be Full Opacity . In the case of 400 it will start to fade at 25% . As you may Imagine there ar many more complex ways of doing it . Start Here .
Play with these number in a Text box or apply it to the rotation of a seconds hand and you can see what is happening to the numbers .
Just a suggestion . On your compass if if you do it again do not rotate the moonstone you could flash it like this with the motion of the pointer . In the Draft you will see I used the accelerometer.
.
.