For example, let's say I have the text "Hi". Can I paint the top 30% red and the bottom 70% green?
For example, let's say I have the text "Hi". Can I paint the top 30% red and the bottom 70% green?
There's a section in the programmer's guide, and here's a video showing how to make a WF with one:
https://www.youtube.com/watch?v=PRQyA4BeqqE
Petr's using BMfont to make the font.
You…
Here's a very simple example of dong two color, that will work on any CIQ device:
The code:
//clear screen dc.setColor(Gfx.COLOR_BLACK,Gfx.COLOR_BLACK); dc.clear(); //define stuff var str="1234…
Here's a very simple example of dong two color, that will work on any CIQ device:
The code:
//clear screen dc.setColor(Gfx.COLOR_BLACK,Gfx.COLOR_BLACK); dc.clear(); //define stuff var str="1234"; var f=Gfx.FONT_MEDIUM; var fH=dc.getFontHeight(f); var sW=dc.getTextWidthInPixels(str,f); var x=100,y=100; //do the draws //red box dc.setColor(Gfx.COLOR_RED,Gfx.COLOR_TRANSPARENT); dc.fillRectangle(x, y+1, sW,fh+1); //green box at 50% dc.setColor(Gfx.COLOR_GREEN,Gfx.COLOR_TRANSPARENT); dc.fillRectangle(x, y+fH*.5-1, sW,fh*.5); //overlay text. dc.setColor(Gfx.COLOR_TRANSPARENT,Gfx.COLOR_BLACK); dc.drawText(x,y,f,str,Gfx.TEXT_JUSTIFY_LEFT);
The output: