Exemple #1
0
        public ControlCommon()
        {
            Enabled = true;

            Width = 1;
            Height = 1;

            Mouse = new Mouse();
        }
Exemple #2
0
 public void SetMouse(Mouse newMouse)
 {
     X = newMouse.X;
     Y = newMouse.Y;
     LeftButton = newMouse.LeftButton;
     MiddleButton = newMouse.MiddleButton;
     RightButton = newMouse.RightButton;
     PixelX = newMouse.PixelX;
     PixelY = newMouse.PixelY;
 }
Exemple #3
0
        public LibtcodShell(string title, int width, int height)
            : base(title, width, height)
        {
            //Mouse = new Mouse();
            OldMouse = new Mouse();

            TCODConsole.initRoot(Width, Height, Title, false, TCODRendererType.SDL);
            TCODConsole.root.setBackgroundColor(TCODColor.black);
            TCODConsole.root.setForegroundColor(TCODColor.white);
            TCODConsole.root.setKeyColor(TCODColor.red);
            TCODConsole.root.clear();
            TCODSystem.setFps(24);

            Screen = new LibtcodScreen(Width, Height, TCODConsole.root);

            TCODConsole.flush();
        }
Exemple #4
0
 protected void SetMouse(Mouse newMouse, TCODMouseData mouse)
 {
     newMouse.X = mouse.CellX;
     newMouse.Y = mouse.CellY;
     newMouse.LeftButton = mouse.LeftButton;
 }
Exemple #5
0
 public override void OnMouseMove(Mouse mouse)
 {
     if (LayoutData.IsMouseInControl(mouse))
     {
         var mouseInControl = LayoutData.GetMouseInControl(mouse);
         Control.OnMouseMove(mouseInControl);
     }
 }
Exemple #6
0
        public virtual void OnMouseMove(Mouse mouse)
        {
            if (MouseMoveEvent != null)
            {
                MouseMoveEvent(mouse);
            }

            Mouse.SetMouse(mouse);
        }
Exemple #7
0
 public virtual void OnMouseButton(Mouse mouse)
 {
     if (MouseButtonEvent != null)
     {
         MouseButtonEvent(mouse);
     }
 }