@Override protected void paintImpl (Surface surf) { surf.setAlpha(_alpha).setFillColor(0xFF000000).fillRect(0, 0, fwidth/4, fheight); } };
@Override protected void paintImpl (Surface surf) { surf.saveTx(); surf.scale(_destScale, _destScale); Float alpha = Scale9Background.this.alpha; if (alpha != null) surf.setAlpha(alpha); if (_tint != Tint.NOOP_TINT) surf.setTint(_tint); // issue the 9 draw calls for (int yy = 0; yy < 3; ++yy) for (int xx = 0; xx < 3; ++xx) { drawPart(surf, xx, yy); } if (alpha != null) surf.setAlpha(1); // alpha is not part of save/restore surf.restoreTx(); }
public void render (Surface surf) { surf.setFillColor(0xFF0000FF).fillRect(0, 0, 100, 25); // these two alpha fills should look the same surf.setFillColor(0x80FF0000).fillRect(0, 0, 50, 25); surf.setAlpha(0.5f).setFillColor(0xFFFF0000).fillRect(50, 0, 50, 25).setAlpha(1f); } }, 100, 25, "left and right half both same color");
protected void paintImpl (Surface surf) { surf.setFillColor(0xFF0000FF).fillRect(0, 0, 100, 25); // these two alpha fills should look the same surf.setFillColor(0x80FF0000).fillRect(0, 0, 50, 25); surf.setAlpha(0.5f).setFillColor(0xFFFF0000).fillRect(50, 0, 50, 25).setAlpha(1f); } }, 100, 25, "left and right half both same color");
surf1.surface().setAlpha(0.5f).drawImage(image, 0, 0); groupLayer.addAt(graphics().createImageLayer(surf1), x, offset); addDescrip("surface a=0.5\nimg layer a=1", x, offset + height, width); surf1b.surface().setAlpha(0.5f).drawImage(image, 0, 0); groupLayer.addAt(graphics().createImageLayer(surf1b), x, offset + 2 * height); x += width;
surf1.begin().clear().setAlpha(0.5f).draw(imtex, 0, 0).end().close(); groupLayer.addAt(new ImageLayer(surf1.texture), x, y0); addDescrip("surface a=0.5\nimg layer a=1", x, y1, width);