Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    MouseDeviceState Class

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

    An extension to PointerDeviceState that handle mouse input and translates it to pointer input

    System.Object → MouseDeviceState
    Derived from MouseDeviceState:

    public class MouseDeviceState
    Name Description
    Constructors
    MouseDeviceState(PointerDeviceState, IMouseDevice)
    Fields
    Events
    MouseDevice
    PointerState
    Properties
    Delta
    DownButtons
    Position
    PressedButtons
    ReleasedButtons
    Methods
    HandleButtonDown(MouseButton)
    HandleButtonUp(MouseButton)
    HandleMouseDelta(Vector2)

    Special move that generates pointer events with just delta

    HandleMouseWheel(Single)
    HandleMove(Vector2)

    Handles a single pointer move

    HandlePointerDown()

    Handles a single pointer down

    HandlePointerUp()

    Handles a single pointer up

    Update(List<InputEvent>)

    Generate input events

    | Improve this Doc View Source

    Constructors


    MouseDeviceState(PointerDeviceState, IMouseDevice)

    public MouseDeviceState(PointerDeviceState pointerState, IMouseDevice mouseDevice)
    Parameters
    Type Name Description
    PointerDeviceState pointerState
    IMouseDevice mouseDevice
    | Improve this Doc View Source

    Fields


    Events

    protected readonly List<InputEvent> Events
    Field Value
    Type Description
    System.Collections.Generic.List<InputEvent>

    MouseDevice

    protected IMouseDevice MouseDevice
    Field Value
    Type Description
    IMouseDevice

    PointerState

    protected PointerDeviceState PointerState
    Field Value
    Type Description
    PointerDeviceState
    | Improve this Doc View Source

    Properties


    Delta

    public Vector2 Delta { get; set; }
    Property Value
    Type Description
    Vector2

    DownButtons

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

    Position

    public Vector2 Position { get; set; }
    Property Value
    Type Description
    Vector2

    PressedButtons

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

    ReleasedButtons

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

    Methods


    HandleButtonDown(MouseButton)

    public void HandleButtonDown(MouseButton button)
    Parameters
    Type Name Description
    MouseButton button

    HandleButtonUp(MouseButton)

    public void HandleButtonUp(MouseButton button)
    Parameters
    Type Name Description
    MouseButton button

    HandleMouseDelta(Vector2)

    Special move that generates pointer events with just delta

    public void HandleMouseDelta(Vector2 delta)
    Parameters
    Type Name Description
    Vector2 delta

    The movement delta


    HandleMouseWheel(Single)

    public void HandleMouseWheel(float wheelDelta)
    Parameters
    Type Name Description
    System.Single wheelDelta

    HandleMove(Vector2)

    Handles a single pointer move

    public void HandleMove(Vector2 newPosition)
    Parameters
    Type Name Description
    Vector2 newPosition

    New position of the pointer


    HandlePointerDown()

    Handles a single pointer down

    public void HandlePointerDown()

    HandlePointerUp()

    Handles a single pointer up

    public void HandlePointerUp()

    Update(List<InputEvent>)

    Generate input events

    public void Update(List<InputEvent> inputEvents)
    Parameters
    Type Name Description
    System.Collections.Generic.List<InputEvent> inputEvents

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

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