unit uMainMenu;

interface

uses
  vectorgeometry,vectortypes,
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, GLWin32Viewer, GLCrossPlatform, BaseClasses, GLScene, jpeg, glKeyboard,
  GLHUDObjects, GLObjects, GLCoordinates,GLMaterial;

Type
TGameMenu=class
private
GameNAme: TGLSprite;
Public
Start, Exit,MFone, About,AboutPlane,Restart: TGLSprite;
Started, Paused  : Boolean;
MenuCube         : TGLDummycube;
Procedure CreateGameMenu;
Procedure CheckStarted_Paused;
end;

implementation
Uses Unit1;

{ TGameMenu }

procedure TGameMenu.CheckStarted_Paused;
begin
if Started=true then begin
MenuCube.Visible:=false;
Form1.Timer1.Enabled:=true;
end  else  begin
MenuCube.Visible:=true;
Form1.Timer1.Enabled:=false;
end;
end;

procedure TGameMenu.CreateGameMenu;
begin
MenuCube:=TGLDummyCube.CreateAsChild(Form1.GLScene1.Objects);
MenuCube.Position.Y:=5;
Started:=false;



Start:=TGLSprite.CreateAsChild(MenuCube);
With start do begin                       //по оси X*(-1)    //по оси Y
Position.AsAffineVector:=AffineVectorMAke(2             ,3, 6);
Width:=4;
Height:=1;
Material.Texture.Disabled:=false;
Material.MaterialLibrary:=Form1.GLMaterialLibrary1;
Material.LibMaterialName:='Start';
tag:=100;
end;

About:=TGLSprite.CreateAsChild(MenuCube);
With about do begin                        //по оси X*(-1)    //по оси Y
Position.AsAffineVector:=AffineVectorMAke(2             ,3, 3);
Width:=8;
Height:=1;
Material.Texture.Disabled:=false;
Material.MaterialLibrary:=Form1.GLMaterialLibrary1;
Material.LibMaterialName:='About';
tag:=101;
end;

Exit:=TGLSprite.CreateAsChild(MenuCube);
With Exit do begin                        //по оси X*(-1)    //по оси Y
Position.AsAffineVector:=AffineVectorMAke(2             ,3, 0);
Width:=4;
Height:=1;
Material.Texture.Disabled:=false;
Material.MaterialLibrary:=Form1.GLMaterialLibrary1;
Material.LibMaterialName:='Exit';
tag:=102;
end;

AboutPlane:=TGLSprite.CreateAsChild(MenuCube);
With aboutPlane do begin                  //по оси X*(-1)    //по оси Y
Position.AsAffineVector:=AffineVectorMAke(2             ,4, 2);
Width:=14;
Height:=14;
Material.Texture.Disabled:=false;
Material.MaterialLibrary:=Form1.GLMaterialLibrary1;
Material.LibMaterialName:='AboutPlane';
tag:=108;
Visible:=false;
end;


MFone:=TGLSprite.CreateAsChild(MenuCube);
With MFone do begin                       //по оси X*(-1)    //по оси Y
//Position.AsAffineVector:=AffineVectorMAke(0             ,3, 8);
Width:=70;
Height:=40;
Material.FrontProperties.Emission.SetColor(0.21,0.51,0,1000);
Material.FrontProperties.Specular.SetColor(0,0.41,0,1000);
Material.FrontProperties.Diffuse.SetColor(0.31,0,0.71,1000);
tag:=106;
end;



GameName:=TGLsprite.CreateAsChild(MenuCube);
With GameName do begin
Position.AsAffineVector:=AffineVectorMAke(2,3,11);
Width:=12;
Height:=3;
Material.Texture.Disabled:=false;
Material.MaterialLibrary:=Form1.GLMaterialLibrary1;
Material.LibMaterialName:='Name';
tag:=129;
end;

end;

end.
