Exemplo n.º 1
0
 public GameUpdater(int pFPS, UpdateEvent updateCall)
 {
     updateTimer=	new GameClock();
     update=	updateCall;
     prevTime=	DateTime.Now;
     time=	new GameTime(DateTime.Now-prevTime);
     framesPerSecond=	pFPS;
     Application.Idle+=	appIdle;
 }
Exemplo n.º 2
0
        // Renders the gui control normally
        protected override void renderNormal(ref Game game, ref GameTime time)
        {
            game.graphics.renderRect(pBounds, pBGColors.normal);
            base.renderNormal(ref game, ref time);
            if(bHasSelection)
            {

            }
        }
Exemplo n.º 3
0
        // Called when the game has been updated
        protected virtual void onUpdate(GameTime time)
        {
            // Variables
            InputArgs	args=	GameInput.getInputArgs();

            window.viewport.cls();

            try
            {
                // Handles the input
                guiInputEvent(args);
                gsmInputEvent(args);
            }catch{}

            try
            {
                // Updates the game
                guiUpdateEvent(time);
                gsmUpdateEvent(time);
            }catch{}

            try
            {
                // Renders the game
                gsmRenderEvent(time);
                guiRenderEvent(time);
            }catch{}

            GL.Flush();
            window.viewport.SwapBuffers();
        }
Exemplo n.º 4
0
 // Renders the gui control when it is pressed down on
 protected override void renderPressed(ref Game game, ref GameTime time)
 {
     game.graphics.renderString(pText, pFont, location, pFGColors.pressed);
 }
Exemplo n.º 5
0
 // Renders the gui control normally
 protected override void renderNormal(ref Game game, ref GameTime time)
 {
     game.graphics.renderString(pText, pFont, location, pFGColors.normal);
 }
Exemplo n.º 6
0
 // Used to safely override and render without having to destroy the main render stuff
 protected override void innerRender(ref Game game, ref GameTime time)
 {
 }
Exemplo n.º 7
0
 // Renders the gui control when it is being pressed down on
 protected override void renderPressed(ref Game game, ref GameTime time)
 {
     game.graphics.renderRect(pBounds, pBGColors.pressed);
     game.graphics.renderString(pText, pFont, location, pFGColors.pressed);
     pBorder.render(game, pBounds, 3);
 }
Exemplo n.º 8
0
 // Renders the gui control normally
 protected override void renderNormal(ref Game game, ref GameTime time)
 {
     game.graphics.renderRect(pBounds, pBGColors.normal);
     game.graphics.renderString(pText, pFont, location, pFGColors.normal);
     pBorder.render(game, pBounds, 0);
 }
Exemplo n.º 9
0
        // Renders the progress bar
        private void renderProgressBar(ref Game game, ref GameTime time, Color baseColor, Color textColor, Color progColor, Color progLeftColor)
        {
            // Variables
            float	p;

            if(pHorizontal)
            {
                p=	width*pProgress;
                game.graphics.renderRect(pBounds, baseColor);
                if(p> 0)
                    game.graphics.renderRect(new Rectangle(new Point2(x+1f, y+1f), new Size2(p-2f, height-2f)), progColor);
                else
                    p=	1f;
                game.graphics.renderRect(new Rectangle(new Point2(x+p, y+1f), new Size2((width-p)-1f, height-2f)), progLeftColor);
            }
            else
            { // TODO: Change for vertical progress bar
                p=	height*pProgress;
                game.graphics.renderRect(pBounds, baseColor);
                if(p> 0)
                    game.graphics.renderRect(new Rectangle(new Point2(x+1f, y+1f), new Size2(width-2f, p-2f)), progColor);
                else
                    p=	1f;
                game.graphics.renderRect(new Rectangle(new Point2(x+p, y+1f), new Size2(width-2f, (p-height)-1f)), progLeftColor);
            }

            if(pAutoLabel)
            {
                game.graphics.renderString(pText, pFont, location, textColor);
            }
        }
Exemplo n.º 10
0
 // Renders the gui control when it is pressed down on
 protected override void renderPressed(ref Game game, ref GameTime time)
 {
     renderProgressBar(ref game, ref time, pBGColors.pressed, pFGColors.pressed, pProgressColors.pressed, pProgressLeftColors.pressed);
 }
Exemplo n.º 11
0
 // Renders the gui control normally
 protected override void renderNormal(ref Game game, ref GameTime time)
 {
     renderProgressBar(ref game, ref time, pBGColors.normal, pFGColors.normal, pProgressColors.normal, pProgressLeftColors.disabled);
 }
Exemplo n.º 12
0
 // Renders the game state
 public override void render(GameTime time)
 {
 }
Exemplo n.º 13
0
 // Updates the gui
 public virtual void update(GameTime time)
 {
     for(int i= 0; i< actives.size; i++)
         csets.getViaIndex(actives.items[i]).update(ref game, ref time);
 }