Rectangle boundRect = polygon.getBoundingRectangle();
Rectangle boundRect = polygon.getBoundingRectangle();
actor.getBBox().getBoundingRectangle().getCenter(unproject2Tmp);
continue; Rectangle r = a.getBBox().getBoundingRectangle(); sbTmp.setLength(0); sbTmp.append(a.getId());
Rectangle r = a.getBBox().getBoundingRectangle(); sbTmp.setLength(0); sbTmp.append(a.getId());
Rectangle r = p.getBoundingRectangle(); float oX = r.x + r.width / 2; float oY = r.y + r.height / 2;
public boolean inScaleIcon(float px, float py) { Polygon p = selectedActor.getBBox(); if (selectedActor instanceof SpriteActor) { InteractiveActor ia = (InteractiveActor) selectedActor; if (!scn.getLayer(ia.getLayer()).isVisible()) return false; Rectangle r = p.getBoundingRectangle(); worldToScreenCoords(tmpV2Transform.set(r.x + r.width, r.y + r.height)); float x = tmpV2Transform.x; float y = tmpV2Transform.y; Rectangle r2 = new Rectangle(x - scnMoveIcon.getRegionWidth() / 2, y, scnMoveIcon.getRegionWidth(), scnMoveIcon.getRegionHeight()); worldToScreenCoords(tmpV2Transform.set(px, py)); return r2.contains(tmpV2Transform.x, tmpV2Transform.y); } return false; }
Rectangle rdest = actor.getBBox().getBoundingRectangle();
Rectangle boundingRectangle = a.getBBox().getBoundingRectangle();
Rectangle boundRect = polygon.getBoundingRectangle();
Rectangle r = a.getBBox().getBoundingRectangle();
Rectangle r = a.getBBox().getBoundingRectangle();
@Override public boolean run(VerbRunner cb) { // EngineLogger.debug("LOOKAT ACTION"); InteractiveActor a = (InteractiveActor) w.getCurrentScene().getActor(actor, true); if (w.getInventory().get(actor) == null) { CharacterActor player = w.getCurrentScene().getPlayer(); if (direction != null && player != null) player.lookat(direction.getDirection()); else if (a != null && player != null) { Rectangle bbox = a.getBBox().getBoundingRectangle(); player.lookat(new Vector2(bbox.width / 2 + bbox.x, bbox.y)); } } if (text != null) { String actorId = w.getCurrentScene().getPlayer() != null ? w.getCurrentScene().getPlayer().getId() : null; w.getCurrentScene().getTextManager().addText(text, TextManager.POS_SUBTITLE, TextManager.POS_SUBTITLE, false, Text.Type.SUBTITLE, null, null, actorId, voiceId, null, wait ? cb : null); return wait; } return false; }
private void drawTransformIcons(SpriteBatch batch, BaseActor a) { Polygon p = a.getBBox(); if (!(a instanceof AnchorActor)) { if (a instanceof InteractiveActor) { InteractiveActor ia = (InteractiveActor) a; if (!scn.getLayer(ia.getLayer()).isVisible()) return; } Rectangle r = p.getBoundingRectangle(); worldToScreenCoords(tmpV2Transform.set(r.x, r.y)); float x = tmpV2Transform.x; float y = tmpV2Transform.y; worldToScreenCoords(tmpV2Transform.set(r.x + r.width, r.y + r.height)); float x2 = tmpV2Transform.x; float y2 = tmpV2Transform.y; batch.draw(scnMoveIcon, x + (x2 - x - scnMoveIcon.getRegionWidth()) / 2, y2); if (a instanceof SpriteActor) { batch.draw(scnRotateIcon, x2 - scnRotateIcon.getRegionWidth() / 3, y2 - scnRotateIcon.getRegionHeight() / 3); if (!((SpriteActor) a).getFakeDepth()) { batch.draw(scnScaleLockIcon, x - scnScaleLockIcon.getRegionWidth(), y2); batch.draw(scnScaleIcon, x - scnScaleIcon.getRegionWidth(), y - scnScaleIcon.getRegionHeight()); } } } }
CharacterActor player = w.getCurrentScene().getPlayer(); Rectangle boundingRectangle = player.getBBox().getBoundingRectangle(); float x = boundingRectangle.getX() + boundingRectangle.getWidth() / 2; float y = boundingRectangle.getY() + boundingRectangle.getHeight(); Rectangle boundingRectangle = actor.getBBox().getBoundingRectangle(); float x = boundingRectangle.getX() + boundingRectangle.getWidth() / 2; float y = boundingRectangle.getY() + boundingRectangle.getHeight();
public boolean inTransformIcon(float px, float py, DraggingModes dm) { Polygon p = selectedActor.getBBox(); Rectangle r = p.getBoundingRectangle(); worldToScreenCoords(tmpV2Transform.set(r.x, r.y)); float x = tmpV2Transform.x; float y = tmpV2Transform.y; worldToScreenCoords(tmpV2Transform.set(r.x + r.width, r.y + r.height)); float x2 = tmpV2Transform.x; float y2 = tmpV2Transform.y; Rectangle r2 = null; if (dm == DraggingModes.ROTATE_ACTOR) { r2 = new Rectangle(x2 - scnRotateIcon.getRegionWidth() / 3, y2 - scnRotateIcon.getRegionHeight() / 3, scnRotateIcon.getRegionWidth(), scnRotateIcon.getRegionHeight()); } else if (dm == DraggingModes.SCALE_ACTOR) { r2 = new Rectangle(x - scnScaleIcon.getRegionWidth(), y - scnScaleIcon.getRegionHeight(), scnScaleIcon.getRegionWidth(), scnScaleIcon.getRegionHeight()); } else if (dm == DraggingModes.SCALE_LOCK_ACTOR) { r2 = new Rectangle(x - scnScaleLockIcon.getRegionWidth(), y2, scnScaleLockIcon.getRegionWidth(), scnScaleLockIcon.getRegionHeight()); } else if (dm == DraggingModes.DRAGGING_ACTOR) { r2 = new Rectangle(x + (x2 - x - scnMoveIcon.getRegionWidth()) / 2, y2, scnMoveIcon.getRegionWidth(), scnMoveIcon.getRegionHeight()); } worldToScreenCoords(tmpV2Transform.set(px, py)); return r2.contains(tmpV2Transform.x, tmpV2Transform.y); }
Rectangle rect = p.getBoundingRectangle();
Rectangle boundingRectangle = bbox.getBoundingRectangle(); width = boundingRectangle.getWidth(); height = boundingRectangle.getHeight();