You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Maybe it's me but all I can do with this is scroll it up and down. Touching or tapping on a submenu has no effect

    In the demo, most of the submenus aren't implemented. The one labelled 'submenu' is though.

    Color

    That looks like a good idea, but I'm a bit concerned it's adding quite a lot of extra code for something that isn't used that much (and what if someone wants to specify something that's not one of those 8 colors?).

    However, it made my realise that now we can include images inside strings, it's actually as easy as writing:

      "A Color" : {
        value : 3,
        min:0,max:7,
        format : v => {
          var col = g.toColor(v&1,(v&2)>>1,(v&4)>>2);
          return String.fromCharCode(0,16,16,0x41,col>>8,­col&255)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0­\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";­
        },
        onchange : v => { number=v; }
      },
    

    Obviously that's a little cryptic, but we could maybe create some libraries to make it easy to provide this kind of functionality on top of the existing menu system, such that it only gets included when needed?

    (also right now it displays a square, but you can adjust the /0/0.... code to make it display whatever shape or glyph you want)

  • That looks like a good idea, but I'm a bit concerned it's adding quite a lot of extra code for something that isn't used that much (and what if someone wants to specify something that's not one of those 8 colors?).

    Yes, that is right.
    May be then it will be helpful just to add a "drawItem" callback? with (idx, item, x1,y1,x2,y2) params. There one can do whatever is needed after the item is rendered a standard way.

About

Avatar for Gordon @Gordon started