private void MouseDown(IGesture gesture, GameTime time, IInputDevice device) { if (RespondOnMouseDown) OnSelected(); _mouseDown = true; }
public override void Update(GameTime gameTime) { var time = gameTime.TotalGameTime.TotalSeconds; _metadata.Set(new TypedName<Vector4>("colour"), new Vector4((float)Math.Sin(time), (float)Math.Sin(time * 2), (float)Math.Sin(time * 3), 1f)); base.Update(gameTime); }
public void Evaluate(GameTime gameTime, Control focused, UserInterface ui) { var type = typeof(TouchDevice); for (int i = 0; i < _touches.Count; i++) { var t = _touches[i]; Current = t; ui.FindControls(t.Position.FromXNA(), _buffer); _current.AddRange(_buffer); for (int j = 0; j < _buffer.Count; j++) { _buffer[j].Gestures.Evaluate(gameTime, this); if (_buffer[j].Gestures.BlockedDevices.Contains(type)) break; } ui.EvaluateGlobalGestures(gameTime, this); _blocked.Clear(); _buffer.Clear(); } foreach (var item in _cooled) item.HeatCount--; foreach (var item in _warmed) item.HeatCount++; _previous.Clear(); _previous.AddRange(_current); _current.Clear(); }
public override void Update(GameTime gameTime) { var keyboard = Keyboard.GetState(); if (keyboard.IsKeyDown(Keys.D1)) _ssaoPlan.Apply(); else if (keyboard.IsKeyDown(Keys.D3)) _edgeDetectPlan.Apply(); else if (keyboard.IsKeyDown(Keys.D4)) _lightingPlan.Apply(); else if (keyboard.IsKeyDown(Keys.D5)) _normalPlan.Apply(); else if (keyboard.IsKeyDown(Keys.D6)) _depthPlan.Apply(); else if (keyboard.IsKeyDown(Keys.D7)) _diffusePlan.Apply(); else if (keyboard.IsKeyDown(Keys.D8)) _noAaPlan.Apply(); else _fullPlan.Apply(); if (keyboard.IsKeyDown(Keys.D2)) _ssaoIntensity.Value = 0; else _ssaoIntensity.Value = 20; _scene.Update(gameTime); base.Update(gameTime); }
public void Evaluate(GameTime gameTime, Control focused, UserInterface ui) { ui.FindControls(Position, _controls); foreach (var item in _cooled) item.HeatCount--; foreach (var item in _warmed) item.HeatCount++; var type = typeof(MouseDevice); for (int i = 0; i < _controls.Count; i++) { _controls[i].Gestures.Evaluate(gameTime, this); if (_controls[i].Gestures.BlockedDevices.Contains(type)) break; } ui.EvaluateGlobalGestures(gameTime, this); _previous.Clear(); _previous.AddRange(_controls); _blocked.Clear(); _controls.Clear(); }
public override void Draw(GameTime gameTime) { if (Game.DisplayUI) UI.Draw(gameTime); base.Draw(gameTime); }
/// <summary> /// Updates the control and its' children. /// </summary> /// <param name="gameTime">The current game time.</param> public override void Update(GameTime gameTime) { var c = IsFocused || IsWarm ? Highlight : Colour; Label.Colour = c; SetSize((int)Label.TextSize.X, (int)Label.TextSize.Y); base.Update(gameTime); }
public override void Update(GameTime gameTime) { foreach (var actor in UI.Actors) actor.Update(gameTime); UI.Update(gameTime); base.Update(gameTime); }
public override void Update(GameTime gameTime) { base.Update(gameTime); _scene.Update((float)gameTime.ElapsedGameTime.TotalSeconds); //_dude.Transform *= Matrix4x4.CreateTranslation(50 * new Vector3(_animationPlayer.RootBoneTransfomationDelta.Translation.X, 0, _animationPlayer.RootBoneTransfomationDelta.Translation.Z)); //_dude.Transform = Matrix4x4.CreateFromAxisAngle(Vector3.UnitY, (float)gameTime.TotalSeconds() / 4) * Matrix4x4.CreateScale(20f) * Matrix4x4.CreateTranslation(0, 0, 175); }
/// <summary> /// Draws visible screens. /// </summary> /// <param name="gameTime">The game time.</param> public void Draw(GameTime gameTime) { foreach (var screen in _screens) { if (screen.TransitionState != TransitionState.Hidden) screen.Draw(gameTime); } }
public void Update(GameTime gameTime) { _touches = TouchPanel.GetState(); _buffer = new List<Control>(); _current = new List<Control>(); _previous = new List<Control>(); _blocked = new List<int>(); _cooled = _previous.Except(_current).Distinct(); _warmed = _current.Except(_previous).Distinct(); }
public void Update(GameTime gameTime) { _previousState = _currentState; _currentState = Keyboard.GetState(_player); lock (_newCharacters) { _characters.Clear(); _characters.AddRange(_newCharacters); _newCharacters.Clear(); } }
public override void Update(GameTime gameTime) { if (Keyboard.GetState().IsKeyDown(Keys.Space) && !_keyboardState.IsKeyDown(Keys.Space)) _spin = !_spin; _keyboardState = Keyboard.GetState(); if (_spin) _rotation += (float)gameTime.ElapsedGameTime.TotalSeconds; _camera.View = Matrix4x4.CreateLookAt(new Vector3((float)Math.Sin(_rotation) * 300, 0, (float)Math.Cos(_rotation) * 300), new Vector3(0, 0, 0), Vector3.UnitY); _scene.Update((float)gameTime.ElapsedGameTime.TotalSeconds); base.Update(gameTime); }
public override void Update(GameTime gameTime) { _scene.Update(gameTime); base.Update(gameTime); if (!Keyboard.GetState().IsKeyDown(Keys.F)) { _fullPlan.Apply(); } else { _noAaPlan.Apply(); } }
public void Draw(GameTime gametime) { if (!drawn) { drawn = true; room.Draw(gametime); foreach (RoomGraph n in neighbourg.Values) { if (!n.drawn) n.Draw(gametime); } drawn = false; } }
public override void Update(GameTime gameTime) { if (_tracker.Statistic.IsDisposed) { Dispose(); return; } bool read, changed; float value = _tracker.GetValue(out read, out changed); if (read) _graph.Add(value); if (changed) _value.Text = value.ToString(CultureInfo.InvariantCulture); base.Update(gameTime); }
public Server(string[] args) { Log("Setting up server .."); _random = new Random(Guid.NewGuid().GetHashCode()); _logic = new PureLogic(this, null, _random); foreach (Actor a in _logic.map.actors) { a.online = false; } _clients = new Dictionary<IPEndPoint, ClientData>(); _gameTime = new Microsoft.Xna.Framework.GameTime(); discoveredBy = new List<string>(); if (args.Length > 0) { _servername = args[0]; } try { _config = new NetPeerConfiguration("DungeonCrawler"); _config.EnableMessageType(NetIncomingMessageType.DiscoveryRequest); _config.EnableMessageType(NetIncomingMessageType.ConnectionApproval); _config.Port = 666; _config.PingInterval = 0.25f; _config.ConnectionTimeout = 20f; _config.MaximumHandshakeAttempts = 3; _config.ResendHandshakeInterval = 5; _config.UseMessageRecycling = true; _config.EnableUPnP = true; _config.AcceptIncomingConnections = false; _server = new NetServer(_config); _server.Start(); _server.UPnP.ForwardPort(666, "Dungeon Crawler"); } catch (Exception ex) { Log("Error during startup: " + ex.Message); error = true; } Console.CursorTop = 0; Console.CursorLeft = 0; }
public void Evaluate(GameTime gameTime, Control focused, UserInterface ui) { var type = typeof(KeyboardDevice); _charactersBlocked = false; for (var control = focused; control != null; control = control.Parent) { control.Gestures.Evaluate(gameTime, this); if (control.Gestures.BlockedDevices.Contains(type)) break; } ui.EvaluateGlobalGestures(gameTime, this); _blocked.Clear(); }
/// <summary> /// Updates the transition. /// </summary> /// <param name="gameTime">Game time.</param> public void Update(GameTime gameTime) { var dt = gameTime.Seconds(); if (_targettingOn) { if (_onTime.Ticks == 0) _progress = 1; else _progress = MathHelper.Clamp(_progress + (dt / (float)_onTime.TotalSeconds), 0, 1); } else { if (_offTime.Ticks == 0) _progress = 0; else _progress = MathHelper.Clamp(_progress - (dt / (float)_offTime.TotalSeconds), 0, 1); } }
public override void Run() { //Grab the Update method manually since it's protected var vanilla = this.SourceDefinition.Type("Terraria.Main").Method("Update"); var tmp = new Microsoft.Xna.Framework.GameTime(); var cbkBegin = this.Method(() => OTAPI.Callbacks.Terraria.Main.UpdateBegin(null, ref tmp)); var cbkEnd = this.Method(() => OTAPI.Callbacks.Terraria.Main.UpdateEnd(null, ref tmp)); vanilla.Wrap ( beginCallback: cbkBegin, endCallback: cbkEnd, beginIsCancellable: false, noEndHandling: false, allowCallbackInstance: true ); }
public override void Update(GameTime gameTime) { base.Update(gameTime); _scene.Update((float)gameTime.ElapsedGameTime.TotalSeconds); MouseState mouse = Mouse.GetState(); KeyboardState keyboard = Keyboard.GetState(); Game.IsMouseVisible = false; if (mouse.IsButtonDown(MouseButtons.Right)) { var mousePosition = new Vector2(mouse.X, mouse.Y); var mouseDelta = mousePosition - _resolution.Value / 2; _cameraRotation.Y -= mouseDelta.X * gameTime.Seconds() * 0.1f; _cameraRotation.X -= mouseDelta.Y * gameTime.Seconds() * 0.1f; var rotation = Matrix4x4.CreateFromYawPitchRoll(_cameraRotation.Y, _cameraRotation.X, _cameraRotation.Z); var forward = Vector3.TransformNormal(-Vector3.UnitZ, rotation); var right = Vector3.TransformNormal(Vector3.UnitX, rotation); if (keyboard.IsKeyDown(Keys.W)) _cameraPosition += forward * gameTime.Seconds() * 50; if (keyboard.IsKeyDown(Keys.S)) _cameraPosition -= forward * gameTime.Seconds() * 50f; if (keyboard.IsKeyDown(Keys.A)) _cameraPosition -= right * gameTime.Seconds() * 50f; if (keyboard.IsKeyDown(Keys.D)) _cameraPosition += right * gameTime.Seconds() * 50f; Matrix4x4 invView; Matrix4x4.Invert(rotation * Matrix4x4.CreateTranslation(_cameraPosition), out invView); _camera.View = invView; Mouse.SetPosition((int)_resolution.Value.X / 2, (int)_resolution.Value.Y / 2); //camera.View = Matrix.CreateLookAt(new Vector3(0, 60, -7), new Vector3(50, 30, -50), Vector3.Up); } }
public virtual void update(Microsoft.Xna.Framework.GameTime Time) { this.timeRemaining -= Time.ElapsedGameTime.Milliseconds; this.timeRemainingUntilNextTrigger -= Time.ElapsedGameTime.Milliseconds; }
public void Update(Microsoft.Xna.Framework.GameTime GameTime) { Time = GameTime; }
private void NextOption(IGesture gesture, GameTime time, IInputDevice device) { SelectedOption++; }
public override void Update(Microsoft.Xna.Framework.GameTime gameTime) { Map.CursorPosition = new Microsoft.Xna.Framework.Vector3(CursorPosition.X, CursorPosition.Y, Map.CursorPosition.Z); Map.CursorPositionVisible = Map.CursorPosition; IsEnded = true; }
/// <summary> /// Draws a frame with a default clear color. /// </summary> /// <param name="gameTime">Time passed since last <see cref="Draw(GameTime)"/>.</param> public void Draw(GameTime gameTime) { FramesPerSecond = (float)(1 / gameTime.ElapsedGameTime.TotalSeconds); Draw(gameTime, Color.DarkOliveGreen); }
/// <summary> /// Updates sound manager. /// </summary> /// <param name="time">Data containing game time information.</param> public void Update(Microsoft.Xna.Framework.GameTime time) { //Updates FMOD CheckError(m_System.update()); }
public override void Update(Microsoft.Xna.Framework.GameTime gameTime) { }
public override void Draw(GameTime gameTime) { _quad.Draw(_material, _metadata); base.Draw(gameTime); }
protected override void Draw(Microsoft.Xna.Framework.GameTime gameTime, RenderHelper render) { }
protected override void Draw(Microsoft.Xna.Framework.GameTime gameTime) { RenderProcess.Draw(); base.Draw(gameTime); }
protected override void Update(Microsoft.Xna.Framework.GameTime gameTime) { base.Update(gameTime); }
public override void Update(Microsoft.Xna.Framework.GameTime gameTime) { //_engine.Update(); base.Update(gameTime); }
public void Update(Microsoft.Xna.Framework.GameTime time) { Tiles.ForEach(tile => tile.Update(time)); }
/// <summary> /// Draws this instance. /// </summary> /// <param name="gameTime">The game time.</param> public virtual void Draw(GameTime gameTime) { }
public override void Draw(GameTime gameTime) { base.Draw(gameTime); _scene.Draw(); }
public void Update(Microsoft.Xna.Framework.GameTime gameTime) { _model.Update(gameTime); }
public void PreDrawnPhase(Microsoft.Xna.Framework.GameTime gt, SceneControl.IWorld mundo, SceneControl.IObject obj, Cameras.ICamera cam, IList <Light.ILight> lights, SceneControl.RenderHelper render) { material.PreDrawnPhase(gt, mundo, obj, cam, lights, render); }
/// <summary> /// Runs any operations needed at the beginning of the <see cref="Komodo.Core.Game.Update(GameTime)"/> loop. /// </summary> /// <remarks> /// Will initialize any new uninitialized <see cref="Komodo.Core.ECS.Components.SoundComponent"/> objects. /// </remarks> /// <param name="_">Time passed since last <see cref="Komodo.Core.Game.Update(GameTime)"/>.</param> public void PreUpdate(GameTime _) { InitializeComponents(); }
/// <summary> /// Update. /// </summary> /// <param name="gametime">The gametime.</param> /// <param name="obj">The obj.</param> /// <param name="lights">The lights.</param> public void Update(Microsoft.Xna.Framework.GameTime gametime, SceneControl.IObject obj, IWorld world) { shader.Update(gametime, obj, world.Lights); }
public override void Update(Microsoft.Xna.Framework.GameTime gameTime) { UnitSpawner.Update(gameTime); IsEnded = UnitSpawner.IsEnded; }
public override void Update(Microsoft.Xna.Framework.GameTime gameTime) { CMasterControl.mapManager.updateMap(gameTime); }
public override void Update(GameTime gameTime) { base.Update(gameTime); _scene.Update((float) gameTime.ElapsedGameTime.TotalSeconds); }
/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(Microsoft.Xna.Framework.GameTime gameTime) { GraphicsDevice.Clear(ClearColor); base.Draw(gameTime); }
private void PreviousOption(IGesture gesture, GameTime time, IInputDevice device) { SelectedOption--; }
public virtual void Update(Microsoft.Xna.Framework.GameTime time) { CurrentWorld.Update(time); }
public void Update(GameTime gameTime) { _previousState = _currentState; _currentState = Mouse.GetState(); }
protected override void AfterDraw(PloobsEngine.SceneControl.RenderHelper render, Microsoft.Xna.Framework.GameTime gt, ref Microsoft.Xna.Framework.Matrix activeView, ref Microsoft.Xna.Framework.Matrix activeProjection) { foreach (var item in primitives) { item.iDraw(activeView, activeProjection, render, batch); } base.AfterDraw(render, gt, ref activeView, ref activeProjection); }
/// <summary> /// Spricht die View im vorgegebenen Takt an. /// </summary> /// <remarks> /// Um den Aufruf muss sich nicht gekümmert werden. /// </remarks> /// <param name="gameTime">Weiterreichung von der Game-Klasse</param> public override void ViewUpdate(Microsoft.Xna.Framework.GameTime gameTime) { //Sorgt dafür, dass das Spiel im Hintergrund des Pausemenüs gerendert wird - TB previousState.ViewUpdate(gameTime); base.ViewUpdate(gameTime); }
public override void Draw(Microsoft.Xna.Framework.GameTime gt, Microsoft.Xna.Framework.Graphics.SpriteBatch batch, Tantric.Graphical.Camera cam) { }
public override void Update(GameTime gameTime) { _scene.Update(gameTime); base.Update(gameTime); }
public override void Update(Microsoft.Xna.Framework.GameTime gameTime) { Map.LayerManager.ListLayer[0].LayerGrid.ReplaceForegrounds(ListForegrounds); }
/// <summary> /// Updates the screen. /// </summary> /// <param name="gameTime">The game time.</param> public virtual void Update(GameTime gameTime) { }
public override void Update(Microsoft.Xna.Framework.GameTime gameTime) { Map.PlayerRoster.TeamCharacters.RemoveAll(_CharacterName); ExecuteEvent(this, 0); IsEnded = true; }
public void Draw(Microsoft.Xna.Framework.GameTime gameTime, SpriteBatch spriteBatch) { currentSprite.Draw(gameTime, spriteBatch); }
protected override void UpdateObject(Microsoft.Xna.Framework.GameTime gameTime) { //NOOP }
/// <summary> /// Pos drawn Function. /// Called after all objects are Draw /// </summary> /// <param name="gt">The gt.</param> /// <param name="obj">The obj.</param> /// <param name="cam">The cam.</param> /// <param name="lights">The lights.</param> /// <param name="render">The render.</param> public void PosDrawnPhase(Microsoft.Xna.Framework.GameTime gt, SceneControl.IObject obj, Cameras.ICamera cam, IList <Light.ILight> lights, SceneControl.RenderHelper render) { shader.PosDrawPhase(gt, obj, render, cam, lights); }
/// <summary> /// Erlaubt die Ausführung der in der View enthalten Spielmechanik. /// </summary> /// <param name="game">Referenz des Games aus dem XNA Framework.</param> /// <param name="gameTime">Bietet die aktuelle Spielzeit an.</param> /// <param name="state">Gibt den aktuellen State an von dem diese Funktion aufgerufen wurde.</param> public void Update(GameManager game, Microsoft.Xna.Framework.GameTime gameTime, State state) { }
public override void Update(Microsoft.Xna.Framework.GameTime gameTime) { throw new NotImplementedException(); }
public void Update(Microsoft.Xna.Framework.GameTime gametime, SceneControl.IObject obj, SceneControl.IWorld world) { material.Update(gametime, obj, world); }