public static void BottomOn(LObject obj0, int w, int h) { obj0.SetLocation(w / 2 - obj0.GetWidth() / 2, h - obj0.GetHeight()); }
public static void LeftOn(LObject obj0, int w, int h) { obj0.SetLocation(0, h / 2 - obj0.GetHeight() / 2); }
public static void RightOn(LObject obj0, int w, int h) { obj0.SetLocation(w - obj0.GetWidth(), h / 2 - obj0.GetHeight() / 2); }
public static void CenterOn(LObject obj0, int w, int h) { obj0.SetLocation(w / 2 - obj0.GetWidth() / 2, h / 2 - obj0.GetHeight() / 2); }
public static void TopOn(LObject obj0, int w, int h) { obj0.SetLocation(w / 2 - h / 2, 0); }
private static void SetLocation(LObject objToBePositioned, float atp_W, float atp_H, float obj_X, float obj_Y, float obj_XW, float obj_YH, Position position) { switch (position) { case Position.CENTER: objToBePositioned.SetX((obj_XW / 2f) - atp_W / 2f); objToBePositioned.SetY((obj_YH / 2f) - atp_H / 2f); break; case Position.SAME: objToBePositioned.SetLocation(obj_X, obj_Y); break; case Position.LEFT: objToBePositioned.SetLocation(obj_X, obj_YH / 2f - atp_H / 2f); break; case Position.TOP_LEFT: objToBePositioned.SetLocation(obj_X, obj_YH - atp_H); break; case Position.TOP_LEFT_CENTER: objToBePositioned.SetLocation(obj_X - atp_W / 2f, obj_YH - atp_H / 2f); break; case Position.TOP_RIGHT: objToBePositioned.SetLocation(obj_XW - atp_W, obj_YH - atp_H); break; case Position.TOP_RIGHT_CENTER: objToBePositioned.SetLocation(obj_XW - atp_W / 2f, obj_YH - atp_H / 2f); break; case Position.TOP_CENTER: objToBePositioned.SetLocation(obj_XW / 2f - atp_W / 2f, obj_YH - atp_H); break; case Position.BOTTOM_LEFT: objToBePositioned.SetLocation(obj_X, obj_Y); break; case Position.BOTTOM_LEFT_CENTER: objToBePositioned.SetLocation(obj_X - atp_W / 2f, obj_Y - atp_H / 2f); break; case Position.BOTTOM_RIGHT: objToBePositioned.SetLocation(obj_XW - atp_W, obj_Y); break; case Position.BOTTOM_RIGHT_CENTER: objToBePositioned.SetLocation(obj_XW - atp_W / 2f, obj_Y - atp_H / 2f); break; case Position.BOTTOM_CENTER: objToBePositioned.SetLocation(obj_XW / 2f - atp_W / 2f, obj_Y); break; case Position.RIGHT_CENTER: objToBePositioned.SetLocation(obj_XW - atp_W, obj_YH / 2f - atp_H / 2f); break; default: objToBePositioned.SetLocation(objToBePositioned.GetX(), objToBePositioned.GetY()); break; } }