1

I'd like to show numbers in a digital 'LCD' font superimposed on top of the number 8 shown in light gray to imitate look of a physical display. So you see all the 'segments' of the 8 in light grey and the number on top, similar to this: https://cdn11.bigcommerce.com/s-cugyqi1aa5/product_images/uploaded_images/segment-lcds-300x240-new.jpg.

I've searched for examples or ways this can be done but haven't figured it out yet and I'm hoping someone has a suggestion for a simple way to achieve this?

user1246562
  • 825
  • 5
  • 7

1 Answers1

1

You can do something simpler and use a 7-segment font like this one: https://github.com/keshikan/DSEG which should support that just fine.

But if you want to do it that way you can do something like this:

Label topText = new Label("08:00", "TopFont");
Label bottomText = new Label("08:00", "BottomFont");
Container cnt = LayeredLayout.encloseIn(topText, bottomText);

Then use cnt which will include both texts. The trick to do it right is that top/bottom UIIDs must be identical in terms of font, padding, margin etc. and top must have 0 bgTransparency setting. Since they would be of the same size when placed in a layered layout they'll just appear one on top of the other exactly.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65