Exemplo n.º 1
0
 public Button(Rectangle rectangle, string text, OnClick onClick)
 {
     base.zOrder        = 0;
     this.text          = text;
     this.areaRectangle = rectangle;
     base.onClick       = onClick;
     texNormalS         = "normal.jpg";
     texPressedS        = "pressed.jpg";
     textHoverS         = "hover.jpg";
     texCurrent         = texNormal;
     textWidth          = GLFont.GlSize("verdana", 18, text);
     textPosition       = new Vector2(areaRectangle.X + (areaRectangle.Width - textWidth) / 2,
                                      areaRectangle.Y + ((areaRectangle.Height - 15) / 2) + 14);
     this.fontId = GLFont.GetFontId("verdana", 18);
 }