YAPI-HUD

YAPI-HUD

Yet Another Page Indicator

Head Up Display – style

Scripted with Canvas Paint.

]]>

13 Commentsto YAPI-HUD

  1. Anonymous says:

    < ![CDATA[

    Very very cool Jappie…nice work 🙂

    ]]>

  2. Anonymous says:

    < ![CDATA[

    ///////////////////////////////////////////////


    //———————————————


    //   YAPI    – Yet Another Page Indicator


    // HUD-style – Head Up Display


    //


    //———————————————


    // set this script on event Position-Changed


    //———————————————


    //


    //////////////////////////////////////////////


     


    /* config */


    var  BG_color = 0x33000000; 


    var HUD_color = 0x7777FF77;


    /* end-config */



    // Complete Image size


    var d = LL.getCurrentDesktop();


    if (d.getItemByLabel(“HUD”)==null) { Initialsetup();}



    var hud =  d.getItemByLabel(“HUD”);


    var hudW = hud.getWidth();


    var hudH = hud.getHeight();


    var hud_ratio = hudW / hudH;


    var img = LL.createImage( hudW, hudH);


    hud.setBoxBackground(img, “n”);


    var p = new Paint();


    p.setAntiAlias(true);


    var c = img.draw();



    // Outer Hud base on BoundingBox


    var bb = d.getBoundingBox();


    var cntW = bb.getRight() – bb.getLeft();


    var cntH = bb.getBottom() – bb.getTop();


    var cnt_ratio = cntW / cntH;



    if (hud_ratio > cnt_ratio)


    { // Container is higher


    var cnt_scale = hudH / cntH;


    }


    else


    { // Container is wider


    var cnt_scale = hudW / cntW;


    }



    p.setStyle(Paint.Style.FILL);


    p.setColor(BG_color);


    c.drawRect (0, 0, (cntW * cnt_scale), (cntH * cnt_scale), p);



    p.setStyle(Paint.Style.STROKE);


    p.setColor(HUD_color);


    p.setStrokeWidth(2);


    c.drawRect (0, 0, (cntW * cnt_scale), (cntH * cnt_scale), p);



    // Inner Hud based on Current View


    //drawRect ( Left, Top, Right, Bottom, Paint)


    var VwL = (d.getPositionX() – bb.getLeft());


    var VwT = (d.getPositionY() – bb.getTop()) ;


    var VwR = VwL+ ( d.getWidth() / d.getPositionScale());


    var VwB = VwT+ ( d.getHeight() / d.getPositionScale()) ;



    //d.getPositionScale();



    p.setStyle(Paint.Style.FILL);


    p.setColor(HUD_color);



    c.drawRect (VwL * cnt_scale , VwT * cnt_scale , VwR * cnt_scale , VwB * cnt_scale , p);



    img.update();



    function Initialsetup()


    {


    var newHud = d.addShortcut(“HUD”,new Intent(),0,0);


    d.setItemZIndex(newHud.getId(),d.getItems().getLength());


    var pe = newHud.getProperties().edit();


    pe.setBoolean(“i.onGrid”,false);


    pe.setString(“i.pinMode”,”XY”);


    pe.setBoolean(“i.enabled”,false);


    pe.setBoolean(“s.iconVisibility”,false);


    pe.setBoolean(“s.labelVisibility”,false);


    pe.commit();


    }

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Awesome, good work.


    A possible suggestion will be to paint the home page if possible, anyway you made a nice script with canvas.


    Congratulations

    ]]>

  4. Anonymous says:

    < ![CDATA[

    Thanks guys, anything is posible. Maybe I have time to make it full C&C-map style:


    Red = app or shortcut


    Blue = widget or panel


    😉

    ]]>

  5. Anonymous says:

    < ![CDATA[

    And, if you run out of ideas:


    Lines indicating the pages


    Smaller lines indicating the grid.


    A small cross with stop points (you can take the size of the stop point but instead of fill it draw two lines)


    Also I should separate widgets and panels.


    But hey, it’s your script. (Maybe I’ll make some tests, I’ll tell you if I make something)

    ]]>

  6. Anonymous says:

    < ![CDATA[

    @Josh im afraid im not familiar with Nova. Any Youtube example?

    ]]>

  7. Anonymous says:

    < ![CDATA[

    TrianguloY forget C&C-map…. How about True-map:


    var item = LL.getEvent().getItem();


    var img = item.getDefaultIcon();


    var bmp = img.getBitmap();


    var px = bmp.getPixel(20,20);


    Android.makeNewToast(Color.blue(px),false).show();

    ]]>

  8. Anonymous says:

    < ![CDATA[

    Not really sure what you mean.


    Are you talking about drawing the icon when shortcuts?

    ]]>

  9. Anonymous says:

    < ![CDATA[

    We talked about filling the HUD with red dots for icons.


    But with above script i can capture the real color of an icon and fill the HUD with that.

    ]]>

  10. Anonymous says:

    < ![CDATA[

    I really enjoyed this script but was curious if there is a way to get it fade away after a set amount of time.

    ]]>

  11. Anonymous says:

    < ![CDATA[

    That ‘s certainly on my Todo.

    ]]>

  12. Anonymous says:

    < ![CDATA[

    Thanks for the incredibly fast reply and I look forward to using this script in the future.

    ]]>

  13. Anonymous says:

    < ![CDATA[

    HUD v2 in minutes from now….

    ]]>

Leave a Reply

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