spaceconquest.IconButton.IconButton C# (CSharp) Method

IconButton() public method

public IconButton ( Rectangle r, String t, EventHandler c ) : System
r Microsoft.Xna.Framework.Rectangle
t String
c EventHandler
return System
        public IconButton(Rectangle r, String t, EventHandler c)
        {
            area = r;
            text = t;
            //Console.WriteLine(Game1.contentManager.RootDirectory);
            FileStream fs = new FileStream(@"Content/Buttons/" + t, FileMode.Open);
            texture = Texture2D.FromStream(Game1.device, fs);
            fs.Close();
            stringvector = new Vector2(area.Center.X, area.Center.Y) - (font.MeasureString(text) / 2);

            currentcolor = normalcolor = Color.White;
            clickedcolor = Color.Blue;
            selectedcolor = Color.Red;
            addClickEvent(c);
        }

Same methods

IconButton::IconButton ( Rectangle r, String t, String t2, EventHandler c ) : System