Battery level using TrianguloY​ ‘s script

Battery level using TrianguloY​ ‘s script

So from red when low to green when high

drawarc( $bat_level,100, Color.HSVToColor([animate(“$bat_level”)/100*120,1,1]), 2, 0.3, 0.4);

]]>

5 Commentsto Battery level using TrianguloY​ ‘s script

  1. Anonymous says:

    < ![CDATA[

    Ehm … You need to write the whole binding and change the medium part with that function, otherwise I’m not sure what it will draw, and where.



    Edit: due to the small the editing box is, probably the whole binding is there, but out of view. I’ll keep this comment for future reference.

    ]]>

  2. Anonymous says:

    < ![CDATA[

    TrianguloY it’s included in your script 🙂 And working fine

    ]]>

  3. Anonymous says:

    < ![CDATA[

    TrianguloY is it possible to write the value at the end of the arc ?


    Like hour number on the arc for hour, minute on the arc for minutes… Like in the polarClock

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Try this:



    Add this code to the end of the binding


    ——————


    function drawText(n,max,color,width,from,to){



    p.setColor(color);


    p.setStrokeWidth(width);


    p.setTextAlign(Paint.Align.CENTER)


    p.setTextSize((to-from)*w);


    p.setStyle(Paint.Style.FILL);



    ang = n / max * 2 * Math.PI;


    at=(from+to)/2;



    c.drawText(


    n


    ,w + Math.sin(ang) * w * at


    ,w – Math.cos(ang) * w * at + (to-from)*w/2


    ,p);



    p.setStyle(Paint.Style.STROKE);


    }


    —————–



    And then use this to draw the text (the same parameters as arc and lines)




    drawText($ll_second , 60 , Color.WHITE , 1 , 0.85 , 1);

    ]]>

  5. Anonymous says:

    < ![CDATA[

    Sounds great


    I’ll try

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *