while (parent != null) { if (parent instanceof WidgetGroup) return; parent = parent.getParent();
while (parent != null) { if (parent instanceof WidgetGroup) return; parent = parent.getParent();
/** @return the highest parent in the hierarchy tree of the given actor */ public static Group lastParent(Actor actor) { if(!actor.hasParent()) return null; Group parent = actor.getParent(); while(parent.hasParent()) parent = parent.getParent(); assert !parent.hasParent(); return parent; }
@Override public float[] getPositionAndSizeGui(String name) { IGui gui = GaiaSky.instance.mainGui; Actor actor = gui.getGuiStage().getRoot().findActor(name); if (actor != null) { float x = actor.getX(); float y = actor.getY(); // x and y relative to parent, so we need to add coordinates of // parents up to top Group parent = actor.getParent(); while (parent != null) { x += parent.getX(); y += parent.getY(); parent = parent.getParent(); } return new float[] { x, y, actor.getWidth(), actor.getHeight() }; } else { return null; } }
while (parent != null) { if (parent instanceof WidgetGroup) return; parent = parent.getParent();
fy+=dy; while(father!=root){ Group nextFather=father.getParent(); fx+=father.getX(); fy+=father.getY();
fy+=dy; while(father!=root){ Group nextFather=father.getParent(); fx+=father.getX(); fy+=father.getY();
fy+=dy; while(father!=root){ Group nextFather=father.getParent(); fx+=father.getX(); fy+=father.getY();
fy+=dy; while(father!=root){ Group nextFather=father.getParent(); fx+=father.getX(); fy+=father.getY();