Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    IMouseDevice Interface

    Namespace: Stride.Input
    Assembly: Stride.Input.dll

    Represents functionality specific to mouse input such as buttons, wheels, mouse locking and setting cursor position

    public interface IMouseDevice : IPointerDevice, IInputDevice
    Name Description
    Properties
    Delta

    Mouse delta

    DownButtons

    The mouse buttons that are down

    IsPositionLocked

    Gets or sets if the mouse is locked to the screen

    Position

    Normalized position of the mouse inside the window

    PressedButtons

    The mouse buttons that have been pressed since the last frame

    ReleasedButtons

    The mouse buttons that have been released since the last frame

    Methods
    LockPosition(Boolean)

    Locks the mouse position to the screen

    SetPosition(Vector2)

    Attempts to set the pointer position, this only makes sense for mouse pointers

    UnlockPosition()

    Unlocks the mouse position if it was locked

    | Improve this Doc View Source

    Properties


    Delta

    Mouse delta

    Vector2 Delta { get; }
    Property Value
    Type Description
    Vector2

    DownButtons

    The mouse buttons that are down

    IReadOnlySet<MouseButton> DownButtons { get; }
    Property Value
    Type Description
    IReadOnlySet<MouseButton>

    IsPositionLocked

    Gets or sets if the mouse is locked to the screen

    bool IsPositionLocked { get; }
    Property Value
    Type Description
    System.Boolean

    Position

    Normalized position of the mouse inside the window

    Vector2 Position { get; }
    Property Value
    Type Description
    Vector2

    PressedButtons

    The mouse buttons that have been pressed since the last frame

    IReadOnlySet<MouseButton> PressedButtons { get; }
    Property Value
    Type Description
    IReadOnlySet<MouseButton>

    ReleasedButtons

    The mouse buttons that have been released since the last frame

    IReadOnlySet<MouseButton> ReleasedButtons { get; }
    Property Value
    Type Description
    IReadOnlySet<MouseButton>
    | Improve this Doc View Source

    Methods


    LockPosition(Boolean)

    Locks the mouse position to the screen

    void LockPosition(bool forceCenter = false)
    Parameters
    Type Name Description
    System.Boolean forceCenter

    Force the mouse position to the center of the screen


    SetPosition(Vector2)

    Attempts to set the pointer position, this only makes sense for mouse pointers

    void SetPosition(Vector2 normalizedPosition)
    Parameters
    Type Name Description
    Vector2 normalizedPosition

    UnlockPosition()

    Unlocks the mouse position if it was locked

    void UnlockPosition()

    Inherited Members

    IPointerDevice.SurfaceSize
    IPointerDevice.SurfaceAspectRatio
    IPointerDevice.PressedPointers
    IPointerDevice.ReleasedPointers
    IPointerDevice.DownPointers
    IPointerDevice.SurfaceSizeChanged
    IInputDevice.Name
    IInputDevice.Id
    IInputDevice.Priority
    IInputDevice.Source
    IInputDevice.Update(List<InputEvent>)

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    MouseDeviceExtensions.IsButtonPressed(IMouseDevice, MouseButton)
    MouseDeviceExtensions.IsButtonReleased(IMouseDevice, MouseButton)
    MouseDeviceExtensions.IsButtonDown(IMouseDevice, MouseButton)
    • Improve this Doc
    • View Source
    In This Article
    In This Article
    • Properties
      • Delta
      • DownButtons
      • IsPositionLocked
      • Position
      • PressedButtons
      • ReleasedButtons
    • Methods
      • LockPosition(Boolean)
      • SetPosition(Vector2)
      • UnlockPosition()
    • Inherited Members
    • Extension Methods

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation