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 }
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; }