Ejemplo n.º 1
0
 public Slider(int maxToMoveSoldiers)
 {
     buttonTex = Utility.CurrentContent.Load <Texture2D>("Slider_Button");
     this.MaxToMoveSoldiers = maxToMoveSoldiers;
     currentState           = new MouseState();
     currentState           = Mouse.GetState();
     SliderBar          = new SliderBar(currentState);
     transform          = this.AddComponent <Transform>();
     transform.Position = new Vector2(SliderBar.Transform.Position.X - 17, SliderBar.Transform.Position.Y - 5);
     renderer           = this.AddComponent <Renderer>();
     renderer.SetImage(buttonTex);
     renderer.Start();
     renderer.SecScale = 0.5f;
     this.intRenderer  = this.AddComponent <IntRenderer>();
     this.intRenderer.Update(new Vector2(this.transform.Position.X + 15, this.transform.Position.Y + 10), ToMoveSoldiers);
     this.intRenderer.Start();
     EventManager.OnUpdate += Update;
 }
Ejemplo n.º 2
0
 public void Destroy(SliderBar sliderBar)
 {
     renderer.Destroy();
     Transform.Destroy();
     sliderBar = null;
 }