public Actor hit (float x, float y, boolean touchable) { if (touchable && getTouchable() == Touchable.disabled) return null; if (!isVisible()) return null; Vector2 point = tmp; Actor[] childrenArray = children.items; for (int i = children.size - 1; i >= 0; i--) { Actor child = childrenArray[i]; child.parentToLocalCoordinates(point.set(x, y)); Actor hit = child.hit(point.x, point.y, touchable); if (hit != null) return hit; } return super.hit(x, y, touchable); }
public Actor hit (float x, float y, boolean touchable) { if (touchable && getTouchable() == Touchable.disabled) return null; if (!isVisible()) return null; Vector2 point = tmp; Actor[] childrenArray = children.items; for (int i = children.size - 1; i >= 0; i--) { Actor child = childrenArray[i]; child.parentToLocalCoordinates(point.set(x, y)); Actor hit = child.hit(point.x, point.y, touchable); if (hit != null) return hit; } return super.hit(x, y, touchable); }
public void draw () { Camera camera = viewport.getCamera(); camera.update(); if (!root.isVisible()) return; Batch batch = this.batch; batch.setProjectionMatrix(camera.combined); batch.begin(); root.draw(batch, 1); batch.end(); if (debug) drawDebug(); }
public void draw () { Camera camera = viewport.getCamera(); camera.update(); if (!root.isVisible()) return; Batch batch = this.batch; batch.setProjectionMatrix(camera.combined); batch.begin(); root.draw(batch, 1); batch.end(); if (debug) drawDebug(); }
public Actor hit (float x, float y, boolean touchable) { if (touchable && getTouchable() == Touchable.disabled) return null; if (!isVisible()) return null; Vector2 point = tmp; Actor[] childrenArray = children.items; for (int i = children.size - 1; i >= 0; i--) { Actor child = childrenArray[i]; child.parentToLocalCoordinates(point.set(x, y)); Actor hit = child.hit(point.x, point.y, touchable); if (hit != null) return hit; } return super.hit(x, y, touchable); }
public void draw () { Camera camera = viewport.getCamera(); camera.update(); if (!root.isVisible()) return; Batch batch = this.batch; batch.setProjectionMatrix(camera.combined); batch.begin(); root.draw(batch, 1); batch.end(); if (debug) drawDebug(); }
@Override public void draw() { if (!getRoot().isVisible()) return; Engine.getSpriteBatch().begin(); getRoot().draw(Engine.getSpriteBatch(), 1); Engine.getSpriteBatch().end(); } }
@Override public void drawStage(Stage stage) { endRendering(); Camera stageCamera = stage.getViewport().getCamera(); stageCamera.up.set(0, -1, 0); stageCamera.direction.set(0, 0, 1); stageCamera.update(); if (!stage.getRoot().isVisible()) { return; } renderingStage = true; beginRendering(); spriteBatch.setProjectionMatrix(stageCamera.combined); polygonSpriteBatch.setProjectionMatrix(stageCamera.combined); shapeRenderer.setProjectionMatrix(stageCamera.combined); spriteBatch.begin(); stage.getRoot().draw(spriteBatch, 1); spriteBatch.end(); endRendering(); renderingStage = false; }
private void updateGroupProperties( ExternalGroupModel model, Group group){ group.setName( model.getName()); model.setWidth( group.getWidth()); model.setHeight( group.getHeight()); // For example .. <FriendsPanel > in top xml and its implementation's root group (FriendsPanel.xml file's) // should both be visible=true in order to set whole group visible, if at least one of them set to false // whole group will be invisible. group.setVisible(model.isVisible() && group.isVisible()); Vector2 screenPos; if (model.getScreenAlignmentSupport() == null) { screenPos = calculateScreenPosition(model.getScreenAlignment(), model); } else { screenPos = calculateScreenPosition(model.getScreenAlignment(), model.getScreenAlignmentSupport(), model); } if (screenPos != null) { group.setPosition(screenPos.x, screenPos.y); } else { float positionMultiplier = resolutionHelper.getPositionMultiplier(); group.setPosition(model.getX() * positionMultiplier, model.getY() * positionMultiplier); } setScaleProperty(model, group); } }