Esempio n. 1
0
 /// <summary>
 /// Ctor for a DrawCommand with the very basic information to draw.
 /// </summary>
 internal DrawCommand(GameTexture texture, Vector2 position, float depth)
 {
     clear();
     Texture = texture;
     Position = position;
     Depth = depth;
 }
Esempio n. 2
0
 public Decoration(GameTexture decorationSetTexture, int indexNumber, Vector2 drawPos, DecorationInfo di)
     : this(decorationSetTexture, indexNumber, drawPos, di, new Color((float)RandomManager.get().NextDouble()/5f + 0.80f,
                                                                         (float)RandomManager.get().NextDouble() / 5f + 0.80f,
                                                                         (float)RandomManager.get().NextDouble() / 5f + 0.80f))
 {
     // nch
 }
Esempio n. 3
0
        private Color m_tint; // a tint to put on the decoration

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Create a new decoration
        /// </summary>
        /// <param name="decorationSetTexture">Texture containing this decoration's graphic</param>
        /// <param name="indexNumber">An index into the texture, which finds this decoration's location in it</param>
        /// <param name="drawPos">Where in the area the decoration should be drawn</param>
        /// <param name="di">XML information about properties of the Decoration (load from Content)</param>
        /// <param name="tint">Color tint to apply to the graphic</param>
        public Decoration(GameTexture decorationSetTexture, int indexNumber, Vector2 drawPos, DecorationInfo di, Color tint)
        {
            this.m_texture = decorationSetTexture;
            this.m_drawIndex = indexNumber;
            this.m_drawPosition = drawPos;

            Rectangle bounds = new Rectangle(
                di.collision.X - di.graphic.X + (int)drawPos.X,
                di.collision.Y - di.graphic.Y + (int)drawPos.Y,
                di.collision.Width,
                di.collision.Height);
            this.m_collider = new Collider(this, bounds, ColliderType.Scenery, -1); // -1 is a flag for non-NPC colliders.

            this.m_tint = tint;
        }
Esempio n. 4
0
 /// <summary>
 /// Method used to set a DrawCommand with many of the most common
 /// parameters.
 /// </summary>
 internal void set(GameTexture texture,
                     int imageIndex,
                     Vector2 position,
                     CoordinateTypeEnum coordType,
                     float depth,
                     bool centered,
                     Color color,
                     float rotation,
                     float scale)
 {
     Texture = texture;
     Position = position;
     UseDestination = false;
     ImageIndex = imageIndex;
     CoordinateType = coordType;
     Depth = depth;
     Centered = centered;
     Effects = SpriteEffects.None;
     Color = color;
     Rotation = rotation;
     Scale = scale;
 }
Esempio n. 5
0
 private static void initialize()
 {
     Engine e = GlobalHelper.getInstance().Engine;
     s_blankTexture = new GameTexture(@"Sprites\blank");
 }