// Updates the gui public virtual void update(GameTime time) { if(set== null) return; set.update(ref time); }
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; }
// 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); }
// 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); } }
// 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); }
// Updates gui public virtual void update(GameTime time) { if(pSet== null) return; pSet.update(ref time, ref game); }
// 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; } }
// 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]); }
// 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); }
// This is the default update function when no update function is provided protected virtual void defaultUpdateFunc(GameTime time) { return; }
// This is the default update function when no update function is provided protected virtual void defaultRenderFunc(GameTime time) { return; }
// Updates the gui component public override void update(ref GameTime time) { for(int i= 0; i< size; i++) components[i].update(ref time); }
// 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); }
// Refreshes the viewport public void refreshViewport(GameTime pmTime) { time= pmTime; Refresh(); }
// 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); }
// 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); }
// Renders the game protected virtual void render(GameTime time) { pRenderFunc(time); }
// 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); }
// Updates the game protected virtual void update(GameTime time) { if(e_input!= null) e_input(GameInput.getInputArgs()); window.viewport.refreshViewport(time); pUpdateFunc(time); }
// 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(); }
// 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); }