public Hero(string name, HeroClass heroClass) { Collect = false; Online = TimeSpan.Zero; Target = Position; AcceptArrows = true; zLastPosition = Position; Netid = 0; Name = name; Class = heroClass; Position.Z = ZLayer.Npc; WalkingSpeed = 10; SpriteManager.AddPositionedObject(this); Collider = ShapeManager.AddCircle(); Collider.AttachTo(this, false); Collider.Visible = false; Sprite = LoadSprite(); Sprite.AttachTo(this, false); Sprite.Resize(4); Sprite.AnimationSpeed = 0.1f; Label = TextManager.AddText(name, Globals.Font); Label.AttachTo(this, false); Label.HorizontalAlignment = HorizontalAlignment.Center; Label.RelativePosition = new Vector3(0, 4, ZLayer.NpcLabel - Position.Z); InitStats(); }
private void CreateRotationHandleForPositionedObject(PositionedObject posObj) { float size = 10; Circle circ = new Circle(); circ.Radius = size / SpriteManager.Camera.PixelsPerUnitAt(posObj.Z); circ.Position = new Vector3(posObj.X, posObj.Y + 2, posObj.Z); circ.Color = Color.LightBlue; Handle handle = new Handle(Layer, circ); circ.AttachTo(posObj, true); }
private Circle AddHandle(float x, float y, float z, float size, float ScaleXCoef, float ScaleYCoef) { Circle circ = new Circle(); circ.Radius = size / SpriteManager.Camera.PixelsPerUnitAt(z); circ.Position = new Vector3(x, y, z); circ.Color = Color.LightBlue; circ.AttachTo((PositionedObject)mCurrentElement, true); Handle handle = new Handle(Layer, circ); handle.ScaleXCoefficient = ScaleXCoef; handle.ScaleYCoefficient = ScaleYCoef; handle.HandleSize = mHandleSize; //Add the handle to the lists mHandles.Add(handle); return circ; }