示例#1
0
文件: UI.cs 项目: WildGenie/Libraria
        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);
        }
示例#2
0
文件: UI.cs 项目: WildGenie/Libraria
        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));
        }