@Override public Canvas fillText(TextLayout layout, float x, float y) { currentState().prepareFill(gfx); ((JavaTextLayout)layout).fill(gfx, x, y); isDirty = true; return this; }
@Override public Canvas strokeText(TextLayout layout, float x, float y) { currentState().prepareStroke(gfx); ((JavaTextLayout)layout).stroke(gfx, x, y); isDirty = true; return this; }
@Override public int ensureTexture() { // if we have a canvas, and it's dirty, force the recreation of our texture which will obtain // the latest canvas data if (canvas.dirty()) { canvas.clearDirty(); refreshTexture(); } return super.ensureTexture(); }
public void handleEvent (Event event) { if (event.widget == platform.graphics().canvas) { Point xy = scaleCoord(event); float dx = xy.x - lastX, dy = xy.y - lastY; onMouseMove(event.time, xy.x, xy.y, dx, dy); } } private float lastX, lastY;
public void handleEvent (Event event) { if (event.widget == platform.graphics().canvas) { Point xy = scaleCoord(event); onMouseWheelScroll(event.time, xy.x, xy.y, -event.count); } } });
@Override protected Graphics2D gc() { currentState().prepareFill(g2d); return g2d; }
/** * Loads a Java font from {@code path}. Currently only TrueType ({@code .ttf}) fonts are * supported. * * @param path the path to the font resource (relative to the asset manager's path prefix). * @throws Exception if an error occurs loading or decoding the font. */ public Font getFont(String path) throws Exception { return requireResource(path).createFont(); }
public void handleEvent (Event event) { if (event.widget == platform.graphics().canvas) { Point xy = scaleCoord(event); onMouseDown(event.time, xy.x, xy.y, mapButton(event.button)); } } });
@Override protected TouchImpl createTouch (Config config) { if (config.emulateTouch) { return new SWTEmulatedTouch(); } else { return super.createTouch(config); } }
@Override public Canvas fillText(TextLayout layout, float x, float y) { currentState().prepareFill(g2d); ((JavaTextLayout)layout).fill(g2d, x, y); isDirty = true; return this; }
@Override public Canvas strokeText(TextLayout layout, float x, float y) { currentState().prepareStroke(gfx); ((JavaTextLayout)layout).stroke(gfx, x, y); isDirty = true; return this; }
@Override public int ensureTexture() { // if we have a canvas, and it's dirty, force the recreation of our texture which will obtain // the latest canvas data if (canvas.dirty()) { canvas.clearDirty(); refreshTexture(); } return super.ensureTexture(); }
public void handleEvent (Event event) { if (event.widget == platform.graphics().canvas) { Point xy = scaleCoord(event); float dx = xy.x - lastX, dy = xy.y - lastY; onMouseMove(event.time, xy.x, xy.y, dx, dy); } } private float lastX, lastY;
public void handleEvent (Event event) { if (event.widget == platform.graphics().canvas) { Point xy = scaleCoord(event); onMouseWheelScroll(event.time, xy.x, xy.y, -event.count); } } });
@Override protected Graphics2D gc() { currentState().prepareFill(gfx); return gfx; }
@Override public Canvas fillText(TextLayout layout, float x, float y) { currentState().prepareFill(gfx); ((JavaTextLayout)layout).fill(gfx, x, y); isDirty = true; return this; }
@Override public Canvas strokeText(TextLayout layout, float x, float y) { currentState().prepareStroke(g2d); ((JavaTextLayout)layout).stroke(g2d, x, y); isDirty = true; return this; }
@Override public Canvas fillText(TextLayout layout, float x, float y) { currentState().prepareFill(g2d); ((JavaTextLayout)layout).fill(g2d, x, y); isDirty = true; return this; }
@Override public Canvas strokeText(TextLayout layout, float x, float y) { currentState().prepareStroke(g2d); ((JavaTextLayout)layout).stroke(g2d, x, y); isDirty = true; return this; }