コード例 #1
0
ファイル: CameraMoveClass.cs プロジェクト: Tsuguri/EngineQ
 private void F2Action(Input.Key key, Input.KeyAction action)
 {
     if (action == Input.KeyAction.Press)
     {
         reverseY = !reverseY;
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: nobbele/SoteriaEngine
 protected override void Start()
 {
     up    = Input.Key.w;
     down  = Input.Key.s;
     left  = Input.Key.a;
     right = Input.Key.d;
 }
コード例 #3
0
ファイル: CameraMoveClass.cs プロジェクト: Tsuguri/EngineQ
        private void ChangeFOVAction(Input.Key key, Input.KeyAction action)
        {
            if (action != Input.KeyAction.Repeat && action != Input.KeyAction.Press)
            {
                return;
            }

            var camera = this.Entity.GetComponent <Camera>();
            var fov    = camera.FieldOfView;

            if (key == Input.Key.Equal)
            {
                fov += 1.0f;
                if (fov > 170.0f)
                {
                    fov = 170.0f;
                }
            }
            else
            {
                fov -= 1.0f;
                if (fov < 10.0f)
                {
                    fov = 10.0f;
                }
            }

            camera.FieldOfView = fov;
        }
コード例 #4
0
ファイル: CameraMoveClass.cs プロジェクト: Tsuguri/EngineQ
 private void EscapeAction(Input.Key key, Input.KeyAction action)
 {
     if (action == Input.KeyAction.Press)
     {
         Application.Exit();
     }
 }
コード例 #5
0
        private void ChangedOptionValueAction(Input.Key key, Input.KeyAction action)
        {
            if (action != Input.KeyAction.Press && action != Input.KeyAction.Repeat)
            {
                return;
            }

            if (options.Count == 0)
            {
                return;
            }

            int value = 1;

            if (Input.IsKeyPressed(Input.Key.LeftShift))
            {
                value = 3;
            }

            if (key == Input.Key.Kp8)
            {
                options[currentOption].Changed(value);
            }
            if (key == Input.Key.Kp2)
            {
                options[currentOption].Changed(-value);
            }

            Console.WriteLine($"{options[currentOption].Name} = {options[currentOption].Value}");
        }
コード例 #6
0
 private void ResizeUp(Input.Key key, Input.KeyAction action)
 {
     if (action == Input.KeyAction.Press && light != null)
     {
         light.TextureSize = light.TextureSize * 2;
         Console.WriteLine("Pressed: " + light.TextureSize);
     }
 }
コード例 #7
0
ファイル: CameraMoveClass.cs プロジェクト: Tsuguri/EngineQ
 private void BoostAction(Input.Key key, Input.KeyAction action)
 {
     if (action == Input.KeyAction.Press)
     {
         this.boost = BoostMultiplier;
     }
     if (action == Input.KeyAction.Release)
     {
         this.boost = 1.0f;
     }
 }
コード例 #8
0
ファイル: RotateTest.cs プロジェクト: Tsuguri/EngineQ
        private void ChangeShader2(Input.Key key, Input.KeyAction action)
        {
            if (action == Input.KeyAction.Press)
            {
                var resourceManager = ResourceManager.Instance;
                var renderable      = this.Entity.GetComponent <Renderable>();

                renderable.UseDeferredShader(resourceManager.GetResource <Shader>("TestDeferred2"));

                renderable.DeferredShader.Material.DiffuseTexture = resourceManager.GetResource <Texture>("Numbers");

                renderable.Mesh = resourceManager.GetResource <Mesh>("Skull");
            }
        }
コード例 #9
0
        private void CurrentOptionAction(Input.Key key, Input.KeyAction action)
        {
            if (action != Input.KeyAction.Press)
            {
                return;
            }

            if (options.Count == 0)
            {
                return;
            }

            Console.WriteLine($"Current option: {options[currentOption].Name} = {options[currentOption].Value}");
        }
コード例 #10
0
ファイル: RotateTest.cs プロジェクト: Tsuguri/EngineQ
        private void ChangeShader1(Input.Key key, Input.KeyAction action)
        {
            if (action == Input.KeyAction.Press)
            {
                var resourceManager = ResourceManager.Instance;
                var renderable      = this.Entity.GetComponent <Renderable>();

                renderable.UseDeferredShader(resourceManager.GetResource <Shader>("TestDeferred1"));

                renderable.DeferredShader.Material.Diffuse = new Vector3f((float)random.NextDouble(), (float)random.NextDouble(), (float)random.NextDouble());

                renderable.Mesh = resourceManager.GetResource <Mesh>("EngineQ/Cube");

                Console.WriteLine($"Set diffuse color to {renderable.DeferredShader.Material.Diffuse}");
            }
        }
コード例 #11
0
        private void ChangedOptionAnction(Input.Key key, Input.KeyAction action)
        {
            if (action != Input.KeyAction.Press && action != Input.KeyAction.Repeat)
            {
                return;
            }

            if (options.Count == 0)
            {
                Console.WriteLine("<No options>");
                return;
            }

            if (key == Input.Key.Kp4)
            {
                currentOption = (currentOption + 1) % options.Count;
            }
            if (key == Input.Key.Kp6)
            {
                currentOption = (currentOption + options.Count - 1) % options.Count;
            }

            Console.WriteLine($"Selected option: {options[currentOption].Name} = {options[currentOption].Value}");
        }
コード例 #12
0
ファイル: KeyboardManager.cs プロジェクト: WildGenie/WIMP
 public static VirtualKey ToVirtual(this Input.Key key)
 {
     return((VirtualKey)System.Windows.Input.KeyInterop.VirtualKeyFromKey((System.Windows.Input.Key)key));
 }
コード例 #13
0
ファイル: RotateTest.cs プロジェクト: Tsuguri/EngineQ
 private void SwitchAction(Input.Key key, Input.KeyAction action)
 {
     mode = (mode + 1) % 3;
 }