Beispiel #1
0
        public override bool OnMouseMove(MouseMoveEventArgs E)
        {
            int X = NanoVG.ScaleX(E.X);
            int Y = NanoVG.ScaleY(E.Y);

            if (DemoGameButton?.Collide(X, Y) == true)
            {
                DemoGameColor = Color.Green;
            }
            else
            {
                DemoGameColor = Color.White;
            }

            if (ExitButton?.Collide(X, Y) == true)
            {
                ExitColor = Color.Green;
            }
            else
            {
                ExitColor = Color.White;
            }

            return(true);
        }
Beispiel #2
0
        public override bool OnMouseButton(MouseButtonEventArgs E, bool Pressed)
        {
            int X = NanoVG.ScaleX(E.X);
            int Y = NanoVG.ScaleY(E.Y);

            if (Pressed && DemoGameButton?.Collide(X, Y) == true)
            {
                StateManager.Push(new DemoGameState());
                return(true);
            }

            if (Pressed && ExitButton?.Collide(X, Y) == true)
            {
                StateManager.Pop();
                Engine.Running = false;
                return(true);
            }

            return(base.OnMouseButton(E, Pressed));
        }