Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
eva-plugin-joystick
Advanced tools
基于 Eva.js 的虚拟摇杆
import { Joystick } from 'eva-plugin-joystick'
const go = new GameObject('joystick')
const joystick = go.addComponent(new Joystick({
followPointer: {
open: true,
area: {
x: 0, y: 0,
width: 400,
height: 600
}
}
}))
joystick.on(JOYSTICK_EVENT.Begin, (data) => {
console.log('begin', data)
})
joystick.on(JOYSTICK_EVENT.Drag, (data) => {
console.log('drag', data)
})
joystick.on(JOYSTICK_EVENT.End, (data) => {
console.log('end', data)
})
game.scene.addChild(go)
limitRadius number
optional
摇杆的半径,限制操作杆的移动范围
boxImageResource string
optional
背景图片
boxRadius number
optional
背景图片的半径
btnImageResource string
optional
操作杆的图片
btnRadius number
optional
操作杆图片的半径
followPointer object
optional
手指跟随
open boolean
是否打开手指跟随
area object
request
手指跟随生效的范围 必填
number
number
number
nubmer
joystick.on(JOYSTICK_EVENT.Begin, (data) => {
console.log('begin', data)
data.x
data.y
})
参数为摇杆移动的二维向量,-1,1之间
JOYSTICK_EVENT.Begin
摇杆开始事件
JOYSTICK_EVENT.Drag
摇杆拖拽事件
JOYSTICK_EVENT.End
摇杆结束事件
FAQs
基于 Eva.js 的虚拟摇杆
The npm package eva-plugin-joystick receives a total of 6 weekly downloads. As such, eva-plugin-joystick popularity was classified as not popular.
We found that eva-plugin-joystick demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.