Ejemplo n.º 1
0
 /// <summary>
 /// Add an item to a layer.
 /// </summary>
 /// <param name="layer">The destination layer.</param>
 /// <param name="item">The item to add.</param>
 public Item AddItem(Layer layer, Item item)
 {
     return layer.AddItem(item);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Add a texture item to a layer.
        /// </summary>
        /// <param name="layer">The layer to add the item to.</param>
        /// <param name="spritePath">The name of the item's sprite.</param>
        /// <param name="name">The name of the item.</param>
        /// <param name="position">The position of the item.</param>
        /// <param name="rotation">The rotation of the item.</param>
        /// <param name="scale">The scale of the item.</param>
        public TextureItem AddTextureItem(Layer layer, string spritePath, string name, Vector2 position, float rotation, Vector2 scale)
        {
            //The item.
            TextureItem item = new TextureItem(layer.Level, name, position, rotation, scale);
            item.AddSprite(spritePath);

            //Add the item and return it.
            return (layer.AddItem(item) as TextureItem);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Add a character to the game.
        /// </summary>
        /// <param name="layer">The layer that this character will belong to.</param>
        /// <param name="name">The name of the character.</param>
        /// <param name="position">The position of the character.</param>
        /// <param name="width">The width of the character.</param>
        /// <param name="height">The height of the character.</param>
        /// <returns>The character.</returns>
        public Character AddCharacter(Layer layer, string name, Vector2 position, float width, float height)
        {
            //Add the character to a layer.
            Character character = new Character(layer.Level, name, position, 0, Vector2.One, width, height);
            layer.AddItem(character);

            //Return the character.
            return character;
        }