示例#1
0
        // Updates the gui
        public virtual void update(GameTime time)
        {
            if(set== null)
                return;

            set.update(ref time);
        }
示例#2
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;
 }
示例#3
0
        // Renders the gui
        public virtual void render(GameTime time)
        {
            if(pSet== null)
                return;

            if(game.window.viewport.isGraphics3D)
            {
                //if(bRenderByBillboard)
                game.window.viewport.isGraphics3D=	false;
                pSet.render(ref time, ref game);
                game.window.viewport.isGraphics3D=	true;
            }
            else
                pSet.render(ref time, ref game);
        }
示例#4
0
        // Renders the gui
        public virtual void render(GameTime time)
        {
            if(set== null)
                return;

            if(game.window.viewport.isGraphics3D)
            {
                game.window.viewport.isGraphics3D=	false;
                set.render(ref game, ref time);
                game.window.viewport.isGraphics3D=	true;
            }
            else
            {
                set.render(ref game, ref time);
            }
        }
示例#5
0
        // Updates the gui component
        public override void update(ref GameTime time, ref Game game)
        {
            for(int i= 0; i< containerSize; i++)
                components.items[i].update(ref time, ref game);

            base.update(ref time, ref game);
        }
示例#6
0
        // Updates gui
        public virtual void update(GameTime time)
        {
            if(pSet== null)
                return;

            pSet.update(ref time, ref game);
        }
示例#7
0
        // Updates the tween
        public void update(GameTime time)
        {
            if(pFinished)
                return;

            totalT+=	time.totalMilliseconds;
            current=	tweenFunc(totalT, original, distance, totalDuration);
            if(totalT> totalDuration)
            {
                current=	original+distance;
                pFinished=	true;
            }
        }
示例#8
0
        // Redners the gui component when it is pressed down
        protected override void renderPressed(ref GameTime time, ref Game game)
        {
            if(textSprites.items[0].getColors()[0]!= pPressedColor)
            {
                for(int i= 0; i< textSprites.size; i++)
                    textSprites.items[i].applyColor(pPressedColor);
            }

            for(int i= 0; i< textSprites.size; i++)
                game.graphics.render(textSprites.items[i]);
        }
示例#9
0
        // Renders the gui component normally
        protected override void renderNormal(ref Game game, ref GameTime time)
        {
            if(!pSprite.textureBounds.Equals(pTexBounds))
                pSprite.setTextureBounds(pTexBounds);

            base.renderNormal(ref game, ref time);
        }
示例#10
0
 // This is the default update function when no update function is provided
 protected virtual void defaultUpdateFunc(GameTime time)
 {
     return;
 }
示例#11
0
 // This is the default update function when no update function is provided
 protected virtual void defaultRenderFunc(GameTime time)
 {
     return;
 }
示例#12
0
 // Updates the gui component
 public override void update(ref GameTime time)
 {
     for(int i= 0; i< size; i++)
         components[i].update(ref time);
 }
示例#13
0
 // Renders the gui component
 public override void render(ref Game game, ref GameTime time)
 {
     for(int i= 0; i< size; i++)
         components[i].render(ref game, ref time);
 }
示例#14
0
 // Refreshes the viewport
 public void refreshViewport(GameTime pmTime)
 {
     time=	pmTime;
     Refresh();
 }
示例#15
0
        // Renders the gui component
        public override void render(ref Game game, ref GameTime time)
        {
            if(!pVisible)
                return;
            if(pSprite== null)
                return;

            if(!pEnabled)
                renderDisabled(ref game, ref time);
            else if(click!= 0)
                renderPressed(ref game, ref time);
            else if(bHover)
                renderHover(ref game, ref time);
            else
                renderNormal(ref game, ref time);
        }
示例#16
0
        // Renders the gui component when it's disabled
        protected override void renderDisabled(ref Game game, ref GameTime time)
        {
            if(!pSprite.textureBounds.Equals(pDisabledTexBounds))
                pSprite.setTextureBounds(pDisabledTexBounds);
            if(pSprite.getColors()[0]!= pDisableColor)
                pSprite.setColor(pDisableColor);
            if(pSprite.texture!= pDisabledTexture)
                pSprite.setTexture(pDisabledTexture);

            game.graphics.render(pSprite);
        }
示例#17
0
 // Renders the game
 protected virtual void render(GameTime time)
 {
     pRenderFunc(time);
 }
示例#18
0
        // Renders the gui component when it is pressed
        protected virtual void renderPressed(ref Game game, ref GameTime time)
        {
            if(!pSprite.textureBounds.Equals(pPressedTexBounds))
                pSprite.setTextureBounds(pPressedTexBounds);
            if(pSprite.getColors()[0]!= pPressedColor)
                pSprite.setColor(pPressedColor);
            if(pSprite.texture!= pPressedTexture)
                pSprite.setTexture(pPressedTexture);

            game.graphics.render(pSprite);
        }
示例#19
0
 // Updates the game
 protected virtual void update(GameTime time)
 {
     if(e_input!= null)
         e_input(GameInput.getInputArgs());
     window.viewport.refreshViewport(time);
     pUpdateFunc(time);
 }
示例#20
0
 // Renders the gui component
 public override void render(ref GameTime time, ref Game game)
 {
     //game.graphics.startScissorCut(pLocation, pSize);
     base.render(ref time, ref game);
     //game.graphics.stopScissorCut();
 }
示例#21
0
        // Renders the gui component
        public override void render(ref GameTime time, ref Game game)
        {
            if(pText.Length== 0)
                return;
            if(!bVisible)
                return;

            textSprites.clear();

            for(int i= 0; i< pText.Length; i++)
                textSprites.add(font.createSprite(pText[i], location.x+i*16, location.y, 16));

            if(!pEnabled)
                renderDisabled(ref time, ref game);
            else if(bHover)
                renderHovered(ref time, ref game);
            else if(click!= 0)
                renderPressed(ref time, ref game);
            else
                renderNormal(ref time, ref game);
        }