32 Star 227 Fork 40

GVPI++俱乐部/Dora-SSR

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Mouse.mdx 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
Li Jin 提交于 2025-01-06 16:24 +08:00 . Fixed doc site prismjs language adding. [skip CI]
# Mouse
**Description:**
  An interface for handling mouse inputs.
## position
**Type:** Readonly Field.
**Description:**
  The position of the mouse in the visible window.
You can use `Mouse.position * App.devicePixelRatio` to get the coordinate in the game world.
Then use `node:convertToNodeSpace()` to convert the world coordinate to the local coordinate of the node.
**Signature:**
```tl
const position: Vec2
```
**Usage:**
```tl
local worldPos = Mouse.position * App.devicePixelRatio
local nodePos = node:convertToNodeSpace(worldPos)
```
## leftButtonPressed
**Type:** Readonly Field.
**Description:**
  Whether the left mouse button is being pressed down.
**Signature:**
```tl
const leftButtonPressed: boolean
```
## rightButtonPressed
**Type:** Readonly Field.
**Description:**
  Whether the right mouse button is being pressed down.
**Signature:**
```tl
const rightButtonPressed: boolean
```
## middleButtonPressed
**Type:** Readonly Field.
**Description:**
  Whether the middle mouse button is being pressed down.
**Signature:**
```tl
const middleButtonPressed: boolean
```
## wheel
**Type:** Readonly Field.
**Description:**
  The mouse wheel value.
**Signature:**
```tl
const wheel: Vec2
```
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/ippclub/Dora-SSR.git
git@gitee.com:ippclub/Dora-SSR.git
ippclub
Dora-SSR
Dora-SSR
main

搜索帮助