-
I drew some inspiration from svgtoeagle when I was putting this together ☺️
Adding an option to output draw calls directly would be easy enough. The only downside is that the draw calls wouldn't allow for convenient on-the-fly translation/rotation/scaling.
Having a page for this on espruino.com would be great ☺️. I'll see about adding it to the EspruinoWebTools repo when I find the time.
-
I made a tool to convert SVG files into a format that's easier to render on a Bangle.js. Just feed the SVG through the converter, paste it in your source file, slap in some rendering code, and away you go!
The converter itself is moderately limited, but it should work for simple graphics. It basically converts all the shapes in the SVG into lists of points that can be fed to drawPoly or fillPoly.
I won't be able to test this outside the emulator until my smart watch arrives, so I would love to hear reports as to how well it works :)
GitHub repo (including the code for rendering the final output): https://github.com/nebbishhacker/svg2bangle
The tool itself: https://nebbishhacker.github.io/svg2bangle
Demo: https://www.espruino.com/ide/emulator.html?gist=7eda1614a48719190c7823cb10068f40 -
-
Yeah, that would be better. But how can I detect that widget is being dismissed?
Would the the E.on('kill',...) event work? (see https://github.com/espruino/BangleApps/blob/master/README.md#misc-notes)
-
Bangle.js doesn't support 4 bit RGBA - it assumes that all 4 bit images use the Mac palette. You can see what color formats are supported here: https://www.espruino.com/Reference#l_Graphics_drawImage
-
-
-
-
That would be super handy - I actually created SVG versions of most of the weather symbols while I was contemplating how to render them, so an SVG to Espruino draw call converter would have been perfect. I imagine you'd have to pick a subset of the SVG spec to support, though.
Another possibility would be to create a simple web-based vector editor with the limitations of the Graphics API in mind.
-
I've been having fun making a sort of mock up in the emulator with randomly generated weather :)
https://gist.github.com/nebbishhacker/cde2bef286bffa1a7e3b523180402c89
https://www.espruino.com/ide/emulator.html?gist=cde2bef286bffa1a7e3b523180402c89&upload -
Sounds like it. See here: https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Weather
-
-
When my watch arrives I was thinking I might see about creating a simple app or widget to tell me the current weather. Has anyone else started on anything like that?
Also, if I were to create such an app, what would be the most straightforward way to get current weather information onto the watch? I see that GadgetBridge supports weather for some other models of smart watches, would it be possible to take advantage of that?
The first time you call getArrayFromCSV it reads lines until it gets to the end of the file. The second time around it's already at the end of the file, so there are no more lines to read.
You can fix this either by reopening the file before each call, or by refactoring your function to pull out all the data you need in one pass.