unit u_Menu_I;

interface
uses
  LexUtils, u_Button;

type
  T_M_I = class
    Button : T_Button;

    procedure Draw;
    procedure Work;
    constructor Create;
  end;

implementation
uses
  zglHeader, uMaterials, u_Menu, uConst;
  
constructor T_M_I.Create;
begin
  Button := T_Button.Create('Меню', 1, (WinW - 160) div 2, WinH div 2 + 100, 160, 48, 0.9);
end;

procedure T_M_I.Work;
begin
  if (Button.Work)
  or (Key_Press(k_ESCAPE)) then
    Menu.S := 0;
end;

var
 miStr : array[1..4] of string =
 ('Игра "Ведьмин новый год"',
  'разработчик: Трофимов cdmlex Алексей',
  'движок ZenGL: Andrey Kemka',
  'Для конкурса платформеров на www.IGDC.ru');

procedure T_M_I.Draw;
var
  I : Integer;
begin
 // Pr2D_Rect(WinW div 2 - 256, WinH div 2 - 150, 512, 320, $E0A0A0, $E5, PR2D_FILL);
  ssprite2d_Draw(mBgMenu, WinW div 2 - 256, WinH div 2 - 150, 512, 320, 0);
  Text_DrawEx(mFont_1,
             WinW div 2,
             WinH div 2 - 155 + 55, 0.98, 0,
             AnsiToUtf8(miStr[1]), 230, $250000, TEXT_HALIGN_CENTER);
  for I := 2 to Length(miStr) do
  Text_DrawEx(mFont_1,
             WinW div 2,
             WinH div 2 - 150 + 50 * I, 0.8, 0,
             AnsiToUtf8(miStr[I]), 200, $111111, TEXT_HALIGN_CENTER);
  Button.Draw;
end;

end.
