public void draw(BufferedImage buf) { WritableRaster dst = buf.getRaster(); blit(dst, bg.getRaster(), Coord.z); alphablit(dst, rmeter(sbars[0].getRaster(), lmax[0], max), mc[0]); alphablit( dst, lmeter(sbars[1].getRaster(), lmax[1], max), mc[1].sub(bars[1].getWidth() - 1, 0)); alphablit( dst, lmeter(sbars[2].getRaster(), lmax[2], max), mc[2].sub(bars[2].getWidth() - 1, 0)); alphablit(dst, rmeter(sbars[3].getRaster(), lmax[3], max), mc[3]); if (lfood != null) { double e = foodeff(lfood); alphablit(dst, rgmeter(lfood, e, 0), mc[0]); alphablit(dst, lgmeter(lfood, e, 1), mc[1].sub(bars[1].getWidth() - 1, 0)); alphablit(dst, lgmeter(lfood, e, 2), mc[2].sub(bars[1].getWidth() - 1, 0)); alphablit(dst, rgmeter(lfood, e, 3), mc[3]); } alphablit(dst, rmeter(bars[0].getRaster(), lev[0], max), mc[0]); alphablit(dst, lmeter(bars[1].getRaster(), lev[1], max), mc[1].sub(bars[1].getWidth() - 1, 0)); alphablit(dst, lmeter(bars[2].getRaster(), lev[2], max), mc[2].sub(bars[2].getWidth() - 1, 0)); alphablit(dst, rmeter(bars[3].getRaster(), lev[3], max), mc[3]); StringBuilder tbuf = new StringBuilder(); for (int i = 0; i < 4; i++) tbuf.append( String.format( "%s: %s/%s\n", rnm[i], Utils.fpformat(lev[i], 3, 1), Utils.fpformat(lmax[i], 3, 1))); tooltip = RichText.render(tbuf.toString(), 0).tex(); }
public Gobble(Coord c, Widget parent) { super(c, Utils.imgsz(Tempers.bg), parent); lcount(0, Color.WHITE); typelist = new TypeList(Coord.z, getparent(GameUI.class)); }