You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • What do you all think about something like this: https://www.espruino.com/ide/?emulator&u­pload&gist=8cad25a87c633e2c614d0eefa52fc­d2e

    The layout for an app might look something like this:

    var layout = { type: "v", content: [
        {type:"txt", font:"6x8", label:"Temperature", col:"#f00", halign:0, pad:4},
        {type:"h", content: [
          {type:"img", src: ()=>atob("CgoCLguH9f2/7+v6/79f56CtAAAD9f­w/n8Hx9A=="), valign:0, pad:4},
          {type:"txt", font:"30%", label:"20.0"},
          {type:"txt", font:"6x8", label:"'C", valign:-1}
        ]},
        {type:"txt", font:"4x6", label:"left", halign:-1},
        {type:"txt", font:"4x6", label:"center"/*, halign:0*/},
        {type:"txt", font:"4x6", label:"right", halign:1},
        {type:"custom", _w:64, _h:64, render:myRenderer, fill:true},
        {type:"btn", label:"More...", click:() => print("Hello")},
        {type:"custom", _w:64, _h:64, render:myRenderer, fill:true}
      ]
    };
    

    So you can have horizontal/vertical alignment, the ability to fill available space, padding and color. By putting in elements with fill:true you can pad out certain areas too,

    Nothing sorted for button handling yet, but so far the code seems like it'd be reasonably fast and compact.

    Maybe the thing to do is to look at existing apps and see how easily they can be converted to use it.

About

Avatar for Gordon @Gordon started