Tuesday 17 February 2015

WatchMaker - conditionality

One really simple but incredibly powerful feature in WatchMaker is the conditionality.  The conditions are in the format...

(CONDITION and (IF TRUE) or (IF FALSE))

For a developer or mathematician (or anyone who knows boolean logic) this is possibly not the most intuitive syntax, but it's straightforward to understand, and that's the point really.  It also works without the brackets, so you'll have to ignore the BODMAS rules.

I have particularly found these conditions useful when applied to the "Opacity" attribute, but you can actually apply them to anything.  I like creating battery indicators, like this...
  1. Click the plus icon to get a new layer
  2. Select the "Battery" type
  3. Choose "Watch Battery" at the bottom (or "Phone Battery")
  4. Choose your favourite battery set (4 designs to choose from)
  5. Position it where you want it, change the colour if required, etc

Now here comes the clever bit (even if I do say so myself).  In the "Opacity" attribute set the value to...

{bl}<25 and 100 or 0

So the watch battery level tag is {bl} and the condition is saying that when the battery level drops below 25 then the opacity should be 100 (100% visible), but otherwise the opacity should be 0 (0% visible).  This means that the battery indicator won't be there all the time, only when the battery level is low.  

You can create the same using the {pbl} tag for the phone battery level as well.  You can even put them in the same place, with whichever you feel is more important on top.  These means that they won't take up much space, in fact they'll hopefully never be visible!

I've made use of these battery indicators on my latest watch face, which I only uploaded yesterday...



This is obviously only one use of conditionality, but I'm sure I'll come up with plenty of other inventive uses moving forwards!

No comments:

Post a Comment