protected override void OnLoad(Microsoft.Xna.Framework.Content.ContentManager content, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd) { base.OnLoad(content, gd); AddChild(ChampionSprite); AddChild(ChampionRect = new DrawableRectangle(Champion.CreateCollisionRectangle(), Color.White * 0.7f)); ChampionRect.Visible = MainDrawableChampion.VIEW_DEBUG_RECTS; AddChild(LifeBar); }
public override bool IsBehind(Vector2 position) { if (Parent != null) { //TODO: use the rectangle of the current animation? return(GameLibHelper.ToRectangle(Champion.CreateCollisionRectangle()).Contains( (int)position.X, (int)position.Y)); } return(false); }
protected override void OnLoad(Microsoft.Xna.Framework.Content.ContentManager content, Microsoft.Xna.Framework.Graphics.GraphicsDevice gd) { Rect rect = Champion.CreateCollisionRectangle(); Parent.AddChild(ChampionServerRect = new DrawableRectangle(rect, Color.Green)); Parent.AddChild(ChampionSimulatedRect = new DrawableRectangle(rect, Color.Red)); Parent.AddChild(ChampionNoCorrection = new DrawableRectangle(rect, Color.Yellow * 0.5f)); Parent.AddChild(ChampionCorrectionUsed = new DrawableRectangle(rect, Color.Blue * 0.8f)); ChampionNoCorrection.Visible = ChampionServerRect.Visible = ChampionSimulatedRect.Visible = ChampionCorrectionUsed.Visible = VIEW_DEBUG_RECTS; base.OnLoad(content, gd); }