Ignore:
Timestamp:
2011-06-07 15:08:33 (9 years ago)
Author:
tekrjant
Message:
  • Map and HUD are no separeted
  • Button works with events
  • Lots of minor stuff
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 2011/23/sijoseha/AdventureGame/AdventureGame/Button.cs

    r1727 r1734  
    99namespace AdventureGame 
    1010{ 
     11 
     12    public delegate void ButtonClickedHandler(object sender, EventArgs e); 
     13 
    1114    public class Button 
    1215    { 
     16        public event ButtonClickedHandler Clicked; 
     17 
    1318        public Vector2 Position { get { return new Vector2(Boundaries.X, Boundaries.Y); } set { } } 
    1419        public Rectangle Boundaries { get; set; } 
     
    4449        } 
    4550 
     51        protected void OnClicked(EventArgs e) 
     52        { 
     53            if (Clicked != null) 
     54                Clicked(this, e); 
     55        } 
     56 
     57        public void Pressed() 
     58        { 
     59            OnClicked(EventArgs.Empty); 
     60        } 
     61 
    4662        public void Draw(SpriteBatch sb) 
    4763        { 
Note: See TracChangeset for help on using the changeset viewer.