If it’s only the angle of the needle that changes along with the text percentage it could be done with two items: one for the background and text and one for the needle.
Bruno-Isa LAMOUR-ARNOULD I don’t think it is. I’m pretty sure rotation is only supported on the item itself not its contents meaning you need an item to rotate and another to stay level.
Probably a way to do it with scripts and a custom view but I have no idea what I’m doing when it comes to that.
There is a way (with lightning there is almost always a way! ) but not what James is thinking.
The way is to simply draw the thing as the background of the item, like my battery binding. Unfortunately making a customizable one will make it so long that I prefer not to do it, sorry.
Choose one (from the picture or not) and I’ll try to make it. You can always read it and make changes yourself.
It’s quite cheap performance wise because the image is only created once, then reused (although copies may happen). Time to render the image will then mostly depends on drawing instructions.
< ![CDATA[
I know I can do it easily with 3 items but really if 1 item it will be even better
]]>
< ![CDATA[
If it’s only the angle of the needle that changes along with the text percentage it could be done with two items: one for the background and text and one for the needle.
]]>
< ![CDATA[
yes but looking if possible with only 1 item 🙂
]]>
< ![CDATA[
Bruno-Isa LAMOUR-ARNOULD I don’t think it is. I’m pretty sure rotation is only supported on the item itself not its contents meaning you need an item to rotate and another to stay level.
Probably a way to do it with scripts and a custom view but I have no idea what I’m doing when it comes to that.
]]>
< ![CDATA[
TrianguloY is making miracles here
]]>
< ![CDATA[
There is a way (with lightning there is almost always a way! ) but not what James is thinking.
The way is to simply draw the thing as the background of the item, like my battery binding. Unfortunately making a customizable one will make it so long that I prefer not to do it, sorry.
Choose one (from the picture or not) and I’ll try to make it. You can always read it and make changes yourself.
]]>
< ![CDATA[
TrianguloY Your battery binding? Do you have a link to that?
]]>
< ![CDATA[
James Coyle sorry James, I meant the analog clock binding (https://plus.google.com/105066926163073195690/posts/AnDFCcahtZa)
I said battery because I think Bruno used the clock as so.
]]>
< ![CDATA[
TrianguloY Ah. Didn’t realize you could generate images like that. How resource intensive is that?
]]>
< ![CDATA[
Not really sure. It is not as intensive as creating new images (it is only drawing) but I can’t tell how much.
Pierre Hébert?
]]>
< ![CDATA[
TrianguloY the first one ,please
]]>
< ![CDATA[
TrianguloY could you add a PNG for charging ?
]]>
< ![CDATA[
It’s quite cheap performance wise because the image is only created once, then reused (although copies may happen). Time to render the image will then mostly depends on drawing instructions.
]]>
< ![CDATA[
I would say, use the JavaScript-widget itself in a webView; if you want the exact thing.
You can communicate values from LL to the view via the item.tag
This is Ofcourse way more battery/resource expensive.
]]>
< ![CDATA[
Jappie Toutenhoofd good idea
Trying to have main widgets from LL
]]>