Ejemplo n.º 1
0
        public GUI(RenderContext rc, GameWorld gw)
        {
            //Basic Init
            _gw = gw;

            _fontSmall = rc.LoadFont("Assets/Cabin.ttf", 12);
            _fontMedium = rc.LoadFont("Assets/Cabin.ttf", 18);
            _fontBig = rc.LoadFont("Assets/Cabin.ttf", 40);

            _guiHandler = new GUIHandler();
            _guiHandler.AttachToContext(rc);

            //Start Pannel Init
            _startPanel1 = new GUIPanel("RocketGame", _fontMedium, 10, 10, 150, 110);
            _startPanelButtonStart = new GUIButton("Start", _fontSmall, 10, 30, 130, 30);
            _startPanelButtonStart.OnGUIButtonDown += OnGUIButtonDown;
            _startPanelButtonStart.OnGUIButtonUp += OnGUIButtonUp;
            _startPanelButtonStart.OnGUIButtonEnter += OnGUIButtonEnter;
            _startPanelButtonStart.OnGUIButtonLeave += OnGUIButtonLeave;
            _startPanelButtonStuff = new GUIButton("Stuff", _fontSmall, 10, 70, 130, 30);
            _startPanelButtonStuff.OnGUIButtonDown += OnGUIButtonDown;
            _startPanelButtonStuff.OnGUIButtonUp += OnGUIButtonUp;
            _startPanelButtonStuff.OnGUIButtonEnter += OnGUIButtonEnter;
            _startPanelButtonStuff.OnGUIButtonLeave += OnGUIButtonLeave;
            _startPanel1.ChildElements.Add(_startPanelButtonStart);
            _startPanel1.ChildElements.Add(_startPanelButtonStuff);

            _startPanel2 = new GUIPanel("Find and activate all the red cubes!", _fontMedium, 170, 20, 300, 30);

            _playPanel = new GUIPanel("Goals found:", _fontMedium, 10, 10, 150, 60);
            _playScore = new GUIText("", _fontMedium, 48, 45, new float4(1, 0, 0, 1));
            _playPanel.ChildElements.Add(_playScore);

            _overText = new GUIText("Game Over, you Win!", _fontBig, 200, 100, new float4(0, 1, 0, 1));

            ShowStartGUI();
        }
Ejemplo n.º 2
0
        // is called on startup
        public override void Init()
        {
            RC.ClearColor = new float4(1, 1, 1, 1);

            _gameWorld = new GameWorld(RC);
        }
Ejemplo n.º 3
0
        // is called on startup
        public override void Init()
        {
            RC.ClearColor = new float4(1, 1, 1, 1);

            _gameWorld = new GameWorld(RC);
        }