public override bool OnActionPressed(SceneControls action) { switch (action) { case SceneControls.Left: yRotating -= rotationVelocity; return(true); case SceneControls.Right: yRotating += rotationVelocity; return(true); case SceneControls.Up: xRotating -= rotationVelocity; return(true); case SceneControls.Down: xRotating += rotationVelocity; return(true); case SceneControls.One: zRotating -= rotationVelocity; return(true); case SceneControls.Two: zRotating += rotationVelocity; return(true); } return(base.OnActionPressed(action)); }
public override void OnActionReleased(SceneControls action) { switch (action) { case SceneControls.Left: yRotating += rotationVelocity; return; case SceneControls.Right: yRotating -= rotationVelocity; return; case SceneControls.Up: xRotating += rotationVelocity; return; case SceneControls.Down: xRotating -= rotationVelocity; return; case SceneControls.One: zRotating += rotationVelocity; return; case SceneControls.Two: zRotating -= rotationVelocity; return; } base.OnActionPressed(action); }
public override bool OnActionPressed(SceneControls action) { var returnValue = false; foreach (var node in nodes) { switch (action) { case SceneControls.Left: node.Velocity.X -= 1; returnValue = true; break; case SceneControls.Right: node.Velocity.X += 1; returnValue = true; break; case SceneControls.Up: node.Velocity.Y += 1; returnValue = true; break; case SceneControls.Down: node.Velocity.Y -= 1; returnValue = true; break; } } return(returnValue); }
public MenuItem(Vector2 position, String contents, SceneControls control) : base(position, contents) { zindex = 0.2f; fontColor = Color.White; highlightColor = Color.White; this.control = control; }
public override bool OnActionPressed(SceneControls action) { if (action != SceneControls.One) { return(base.OnActionPressed(action)); } drawable.Visible = !drawable.Visible; return(true); }
protected override void Initialize() { base.Initialize(); Scene.setDefaultDesignResolution(427, 240, Scene.SceneResolutionPolicy.FixedHeight); // PP Fix scene = Scene.createWithDefaultRenderer(); base.Update(new GameTime()); base.Draw(new GameTime()); // Set first scene scene = new SceneControls(); }
public override bool OnActionPressed(SceneControls action) { targetYaw += action switch { SceneControls.Left => 30, SceneControls.Right => - 30, _ => 0 }; targetPitch += action switch { SceneControls.Up => 30, SceneControls.Down => - 30, _ => 0 }; targetPitch = MathF.Min(90, MathF.Max(-90, targetPitch)); return(base.OnActionPressed(action)); }
public override bool OnActionPressed(SceneControls action) { switch (action) { case SceneControls.One: worldViewer2d.GridDistance -= 0.5f; return(true); case SceneControls.Two: worldViewer2d.GridDistance += 0.5f; return(true); case SceneControls.Up: worldViewer2d.Target += new Vector2(0, 1); return(true); case SceneControls.Down: worldViewer2d.Target -= new Vector2(0, 1); return(true); case SceneControls.Left: worldViewer2d.Target -= new Vector2(1, 0); return(true); case SceneControls.Right: worldViewer2d.Target += new Vector2(1, 0); return(true); case SceneControls.Nine: worldViewer2d.FieldOfView -= 1; return(true); case SceneControls.Zero: worldViewer2d.FieldOfView += 1; return(true); default: return(base.OnActionPressed(action)); } }
public override void OnActionReleased(SceneControls action) { foreach (var node in nodes) { switch (action) { case SceneControls.Left: node.Velocity.X += 1; break; case SceneControls.Right: node.Velocity.X -= 1; break; case SceneControls.Up: node.Velocity.Y -= 1; break; case SceneControls.Down: node.Velocity.Y += 1; break; } } }