Hey friends,
Is it possible to have an image change to another image based on if a certain threshold of steps has been achieved by a certain time in the day?
Thanks!
Hey friends,
Is it possible to have an image change to another image based on if a certain threshold of steps has been achieved by a certain time in the day?
Thanks!
There is a way to imitate this behavior. You can add two images and change their opacity based on a certain threshold of steps. Here is how you would do it:
Step 1: Open a project in the watch face studio.
Step 2: From the Add Component section add two (or more) images.
Step 3: Select one image
[SC]>5000?100:0
[SC]>5000?0:100
Not an answer, but I like the idea. I wrote an app (with complications) that indicated steps (and calorie, etc) progress compared to time of day.
Great! Iāll try this out tomorrow.
One thing Iāll have to figure out is how to get it to do the above at the time, so set opacity to 0 if steps are under 2000 by 9pm, etc
You can combine multiple boolean expressions using and/or operations
The secret is the Boolean for AND on WFS is * . Remember you can use the Users Steps Goal in WFS Tag Formulas . Shout if you get stuck . It is so much more satisfying if you get it by yourself .
BTW + is OR . You will have to look up the rest .
Got it!
The answer was the brackets and the * for āandā, thanks @imrulanwar836 & @russellcresser
ā([SC]>5000)*([HOUR_1_24])>21?100:0ā
in english:
if stepcount is greater than 5000, and itās after 9pm - turn this imageās opacity from 0-100
Youāre right though, figuring out the last part myself was way more satisfying <3
Great well done . I think I am right in saying that you can nest 3 conditionals if you need to .
Ok, hereās one last piece of the puzzle, but let me explain whatās actually happening first:
For my watchface, I have an image sequence of a creature that changes based on what percentage of your daily walking goal youāve done. Itās essentially a tamagotchi that evolves based on walking. What Iāve currently got is code that says āif you donāt have more that 10% of your daily goal done before 9pmā, the creature dies (eg, itās spriteās opacity is 0, and the gravestone sprite appears).
This is all currently working a treat - but I realised yesterday that if you then achieve more than 10% of your step count AFTER 9pm, the creature appears again and the grave goes away, because the creatureās set to:
([SC_PER]<10)*([HOUR_0_23])>20?0:100
and the grave is set to:
([SC_PER]<10)*([HOUR_0_23])>20?100:0
So is there any way to to store a value? Like say "at 9pm, if you havenāt walked more than 10% of your goal, the grave appears and also āDEAD=1ā
And then for the other sprites they basically have "If youāve walked X-AMOUNT of step percentage, and DEAD doesnāt = 1, turn opacity to 100.
Or is there another way to so something like this if we canāt store values?
Apologies for my not-overly-programming-centric brain!
J
I think with WFS wont be possible to workaround no data storage, since they still consider it being designer and not developer tool and also that watchfaces with new format are not meant to execute anything, like they are no real applications. You would need to program what you want in something more capable maybe like android studio and maybe even into an app or complication, rather than just watchface.