public virtual void Update(GameTime time) { }
public override void Update(GameTime time) { bool[] buttons = new bool[4]; int scroll = 0; int num = 0; Game.Input.GetAbsMouseState(ref mAbsPosX, ref mAbsPosY, ref buttons[0], ref buttons[1], ref buttons[2], ref buttons[3], ref scroll); int wheel = scroll > LastScroll ? -1 : (scroll < LastScroll ? 1 : 0); LastScroll = scroll; Game.Input.GetKeyBuffer(KeyBuffer, ref num); GUI.SetMouse(mAbsPosX, mAbsPosY, wheel); GUI.SetButtons(buttons); KeyData[] keys = new KeyData[num]; for (int i = 0; i < keys.Length; i++) { keys[i].Scancode = KeyBuffer[i].Key; keys[i].Pressed = KeyBuffer[i].Pressed != 0; keys[i].Released = KeyBuffer[i].Released != 0; } GUI.SetKeyboard(keys); GUI.TimeElapsed = time.ElapsedMilliseconds; calculateCamera(); checkCombatButtons(); base.Update(time); }
public override void Update(GameTime time) { cameraService.calcualteCameraStat(); TV_3DVECTOR pos = cameraStat.Position; TV_3DVECTOR lookAt = cameraStat.LookAt; setCamera(pos, lookAt); base.Update(time); }
public override void Draw(GameTime time) { desktop.Size = new Squid.Point(Game.Engine.GetViewport().GetWidth(), Game.Engine.GetViewport().GetHeight()); desktop.Update(); desktop.Draw(); }
public virtual void Draw(GameTime time) { }
private void StartEngine() { Time = new GameTime(); Components = new List<GameComponent>(); Engine = new TVEngine(); Scene = new TVScene(); Screen2D = new TVScreen2DImmediate(); Textures = new TVTextureFactory(); Text2D = new TVScreen2DText(); Globals = new TVGlobals(); Materials = new TVMaterialFactory(); Math = new TVMathLibrary(); Effects = new TVGraphicEffect(); Atmosphere = new TVAtmosphere(); Internal = new TVInternalObjects(); Light = new TVLightEngine(); Input = new TVInputEngine(); Random = new Random(); Engine.SetInternalShaderVersion(CONST_TV_SHADERMODEL.TV_SHADERMODEL_BEST); Engine.SetAngleSystem(CONST_TV_ANGLE.TV_ANGLE_DEGREE); Engine.AllowMultithreading(true); Engine.SetFPUPrecision(true); Engine.EnableSmoothTime(false); Engine.SetDebugMode(true, true); Engine.SetDebugFile("debug.txt"); Engine.EnableProfiler(false); Engine.DisplayFPS(false); Engine.SetVSync(false); Engine.SetAntialiasing(false, CONST_TV_MULTISAMPLE_TYPE.TV_MULTISAMPLE_NONE); Engine.Init3DWindowed(Form.Handle); //Engine.Init3DFullscreen(1920, 1200, 32, true, false, CONST_TV_DEPTHBUFFERFORMAT.TV_DEPTHBUFFER_BESTBUFFER, 1, Window.Handle); Engine.GetViewport().SetAutoResize(true); Input.Initialize(true, true); Input.SetRepetitionDelay(400, 100); Textures.SetTextureMode(CONST_TV_TEXTUREMODE.TV_TEXTUREMODE_BETTER); Light.SetGlobalAmbient(0, 0, 0); }
protected virtual void Update(GameTime time) { Form.LostFocus += new EventHandler(Form_LostFocus); Form.GotFocus += new EventHandler(Form_GotFocus); if (inFocus) { foreach (GameComponent component in Components) component.Update(time); } }
protected virtual void Draw(GameTime time) { foreach (GameComponent component in Components) { if (component is DrawableGameComponent) { ((DrawableGameComponent)component).Draw(time); } } }
public override void Draw(GameTime time) { actor.Render(); base.Draw(time); }