Exemplo n.º 1
0
        /// <summary>
        /// Sets the given values of the object with the given name. </summary>
        /// <param name="name"> the name of the object </param>
        /// <param name="x"> the new position in x direction of the object </param>
        /// <param name="y"> the new position in y direction of the object </param>
        /// <param name="angle"> the new angle of the object </param>
        /// <param name="scaleX"> the new scale in x direction of the object </param>
        /// <param name="scaleY"> the new scale in y direction of the object </param>
        /// <param name="pivotX"> the new pivot in x direction of the object </param>
        /// <param name="pivotY"> the new pivot in y direction of the object </param>
        /// <param name="alpha"> the new alpha value of the object </param>
        /// <param name="folder"> the new folder index of the object </param>
        /// <param name="file"> the new file index of the object </param>
        /// <exception cref="SpriterException"> if no object exists of the given name </exception>
        public virtual void SetObject(string name, float x, float y, float angle, float scaleX, float scaleY, float pivotX, float pivotY, float alpha, int folder, int file)
        {
            int index = GetObjectIndex(name);

            if (index == -1)
            {
                throw new SpriterException("No object found for name \"" + name + "\"");
            }
            Mainline.Key.ObjectRef @ref = CurrentKey.GetObjectRef(index);
            Object @object = GetObject(index);

            @object.Set(x, y, angle, scaleX, scaleY, pivotX, pivotY, alpha, folder, file);
            UnmapObjects(@ref);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Returns a time line object at the given index. </summary>
 /// <param name="index"> the index of the object </param>
 /// <returns> the object with the given index. </returns>
 public virtual Object GetObject(int index)
 {
     return(this.UnmappedTweenedKeys[CurrentKey.GetObjectRef(index).Timeline].Object);
 }