Beispiel #1
0
        public FixedPosition(Vector2 fixedPosition, GuiAnchor localAnchor, GuiAnchor parentAnchor)
        {
            if (localAnchor == null)
            {
                throw new ArgumentNullException("localAnchor");
            }
            if (parentAnchor == null)
            {
                throw new ArgumentNullException("parentAnchor");
            }

            mFixedPosition = fixedPosition;
            mLocalAnchor   = localAnchor;
            mParentAnchor  = parentAnchor;
        }
Beispiel #2
0
 public FollowWorldSpaceObject(Camera camera, Transform worldSpaceObject, GuiAnchor widgetAnchor, Vector2 offset, Vector3 worldSpaceOffset)
 {
     if (camera == null)
     {
         throw new ArgumentNullException("camera");
     }
     if (worldSpaceObject == null)
     {
         throw new ArgumentNullException("worldSpaceObject");
     }
     mTransform        = worldSpaceObject;
     mOffset           = offset;
     mCamera           = camera;
     mAnchor           = widgetAnchor;
     mWorldSpaceOffset = worldSpaceOffset;
 }
Beispiel #3
0
        public FloatFromPosition(IScheduler scheduler, Camera camera, Vector3 startPosition, GuiAnchor anchor, float floatSpeed, float floatTime, Hangout.Shared.Action onCompleteCallback)
        {
            if (camera == null)
            {
                throw new ArgumentNullException("camera");
            }
            if (scheduler == null)
            {
                throw new ArgumentNullException("scheduler");
            }

            mAnchor = anchor;

            scheduler.StartCoroutine(Animate(startPosition, camera, floatSpeed, floatTime));
            mOnCompleteCallback = onCompleteCallback;
        }
Beispiel #4
0
        public static FixedPosition BuildFixedPosition(string x, string y, XmlNode node)
        {
            FixedPosition result = null;

            if (x == null)
            {
                throw new ArgumentNullException("x");
            }
            if (y == null)
            {
                throw new ArgumentNullException("y");
            }
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }

            try
            {
                GuiAnchor localAnchor = BuildAnchor(node, "anchor");
                if (node.Attributes["parentAnchor"] != null)
                {
                    GuiAnchor parentAnchor = BuildAnchor(node, "parentAnchor");
                    result = new FixedPosition(new Vector2(float.Parse(x), float.Parse(y)), localAnchor, parentAnchor);
                }
                else
                {
                    result = new FixedPosition(new Vector2(float.Parse(x), float.Parse(y)), localAnchor);
                }
            }
            catch (FormatException)
            {
                throw new GuiConstructionException("Attempted to create a FixedPosition IGuiPosition from a node that doesn't parse to (float) X, (float) Y.");
            }

            return(result);
        }
Beispiel #5
0
 public GuiAnchor(GuiAnchor copy)
 {
     mHorizontal = copy.Horizontal;
     mVertical   = copy.Vertical;
 }
Beispiel #6
0
 public FixedPosition(float x, float y, GuiAnchor anchor)
     : this(new Vector2(x, y), anchor)
 {
 }
Beispiel #7
0
 public FixedPosition(Vector2 fixedPosition, GuiAnchor anchor)
     : this(fixedPosition, anchor, anchor)
 {
 }
Beispiel #8
0
 public FixedPosition(float x, float y, GuiAnchor localAnchor, GuiAnchor parentAnchor)
     : this(new Vector2(x, y), localAnchor, parentAnchor)
 {
 }