Beispiel #1
0
 public MenuButton(string id, Vector2 pos, StatusMenuButton status,bool abstractPos, SpriteFont font,
     Color normal, Color selected, Event onClick, bool normalSelect = true, PosOnScreen posOnScreen = PosOnScreen.TopLeft,
     bool isDrawable = true)
     : this(id, pos, status, abstractPos, () => GameEngine.LangCenter.GetString(id), 
     (isSelect) => GameEngine.LangCenter.GetImage(id, !isSelect),() => GameEngine.Config.ResolutionWidth/1920f
     , font, normal, selected, onClick, normalSelect,posOnScreen,isDrawable)
 {
 }
Beispiel #2
0
 internal SimpleText(NameFunc nameFunc,Vector2 position, PosOnScreen pos, SpriteFont font, Color colorNormal, Color colorSelected, bool isDrawable = true)
     : base(CreateRectangle(position, font, nameFunc.Invoke()), pos, isDrawable)
 {
     Font = font;
     _nameFunc = nameFunc;
     ColorNormal = colorNormal;
     ColorSelected = colorSelected;
 }
Beispiel #3
0
 private Item(Rectangle rectangle, PosOnScreen pos, bool isExpandable, bool isDrawable = true)
 {
     IsDrawable = isDrawable;
     IsExpandable = isExpandable;
     ItemRectangle = rectangle;
     Pos = pos;
     ActualHeight = Height;
     ActualWidth = Width;
     SetRectangles();
 }
Beispiel #4
0
 internal MenuButton(string id, Vector2 pos, StatusMenuButton status, bool abstractPos, NameFunc text, TextureFunc image,
     RatioFunc ratioFunc, SpriteFont font, Color normal, Color selected, Event onClick, bool normalSelect = true,
     PosOnScreen posOnScreen = PosOnScreen.TopLeft, bool isDrawable = true)
     : base(new Rectangle((int)pos.X, (int)pos.Y, 0, 0),posOnScreen,isDrawable)
 {
     Id = id;
     MiddlePos = (abstractPos) ? Position : pos;
     Status = status;
     AbstractPos = abstractPos;
     Text = text;
     Image = image;
     Ratio = ratioFunc;
     Font = font;
     ColorNormal = normal;
     ColorSelected = selected;
     OnClick = onClick;
     NormalSelect = normalSelect;
     UpdateRectangles();
 }
Beispiel #5
0
 public MenuButton(string id, Vector2 pos, SpriteFont font, Color normal, Color selected, Event onClick, bool normalSelect = true,
     PosOnScreen posOnScreen = PosOnScreen.TopLeft, bool isDrawable = true)
     : this(id, pos, StatusMenuButton.None,true, font, normal, selected, onClick,normalSelect,posOnScreen, isDrawable)
 {
 }
Beispiel #6
0
 public SimpleText(NameFunc text, Vector2 position, PosOnScreen pos, SpriteFont font, Color colorNormal, bool isDrawable = true)
     : this(text,position, pos, font, colorNormal, colorNormal,isDrawable)
 {
 }
Beispiel #7
0
 public SimpleText(string text, Vector2 position, PosOnScreen pos, SpriteFont font, Color colorNormal, bool isDrawable = true)
     : this(() => GameEngine.LangCenter.GetString(text), position, pos, font, colorNormal, colorNormal,isDrawable)
 {
 }
Beispiel #8
0
 protected Item(Rectangle rectangle, PosOnScreen pos, bool isDrawable = true)
     : this(rectangle, pos, false, isDrawable)
 {
 }