public RectShape(String name, int sx, int sy, int ex, int ey, Color c) { super(name, c); rect.left = sx; rect.top = sy; rect.right = ex; rect.bottom = ey; this.updateGeometricState(); }
@Override public void doDraw(Graphics g, Camera cam, long interpol) { super.informRenderListeners(interpol); if (this.visible) { g.setColor(this.col); // Log.d("tag", "Drawing rect"); temp_rect.set(rect); temp_rect.offset( (int) -cam.left + this.world_coords_offset.x, (int) -cam.top + this.world_coords_offset.y); g.drawRect( temp_rect.left, temp_rect.top, temp_rect.right - temp_rect.left, temp_rect.bottom - temp_rect.top); } }
public void updateCoordsXYWH(int x, int y, int w, int h) { rect.left = x; rect.top = y; rect.right = x + w; rect.bottom = y + h; }