Monday 23 February 2015

WatchMaker - unpacking the .watch file

When you export a watch from WatchMaker, the app creates a ".watch" file.  This can then be imported by someone else, or uploaded to a face sharing website (such as FaceRepo) for others to enjoy.  

If you're like me though, you might be interested in how this ".watch" file is made up though, what it contains.  So let's take one of my first watch faces for example...



The file itself is a ZIP archive, so the first step is to extract the files.  Personally I prefer 7-Zip, but you can use the tool of your choice for this.

After you've unpacked the files, you should see a structure something like this...



The files included in this example are...

  • fonts
    • Roboto-Regular.ttf
  • images
    • battery_set_1.png
    • bg_premium5.jpg
    • hand_hour_22.png
    • hand_minute_22.png
  • preview.jpg
  • watch.xml

So any fonts and images that are used in the watch face are included in their respective folders.  For example, the "battery_set_1.png" is a Sprite that holds multiple images in one.  There is also the background ("bg_premium5.jpg") and both watch hands.

There is also a preview image ("preview.jpg") - this is the image that is displayed above, and it's also the one that FaceRepo uses.  There is currently a feature request to add a dimmed preview image to the ".watch" file as well.

The final file (watch.xml) is probably the most interesting, as this contains all of the settings and configuration of the watch face and the layers that make it up.  You can open this file to view in a web browser, or you can edit it in any text editor (I prefer Notepad++)...


This ".xml" file has a root <Watch> tag, with attributes that contain the settings for the watch face, and then a number of <Layer> tags, with attributes that contain the configuration for each layer.  Whilst you may or may not be familiar with XML, it should be easy enough to tell from the attributes and their values how these match up with the different properties in the WatchMaker app.  

This includes the layers of type "image" which have a "path" and those of type "text" which have a "font", both of which link to the included files above.  Also there's the "display" attribute, which is "b" for bright only, "d" for dimmed only and "bd" for always.

Next time I'm working on a complicated LUA script, I may well export it to Dropbox so I can write it on my laptop, then import it back into the WatchMaker app - much easier than typing curly braces on my phone keyboard!

1 comment:

  1. can you help with my zoiytop jm01 h1 smartwatch , i cant file what file gonna use to have a watch face , thanks

    ReplyDelete