mirror of
https://github.com/oasis-engine/engine.git
synced 2024-03-18 12:33:29 +00:00
Page:
Input system design
Pages
Home
How to write an e2e Test for runtime
Input system design
Keyboard Input design
Migration Guide
Milestone 0.5 development
Milestone 0.6 development
Milestone 0.7 development
Milestone 0.8 development
Milestone 0.9 development
Milestone development process specification template(Old)
Milestone development process specification template
Physical system design
Roadmap
Text system design
Texture system design
如何与我们共建 Galacean 开源互动引擎
Clone
Table of Contents
This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Whether to unify single-point Touch and Mouse events needs to be discussed. From the point of view of ease of use for developers, I think we need to unify! Before we only consider mouse, but now we should consider mobile device(touch). So the call back named onMouseXX() is not good, I think use onPointerXX() instead onMouseXX() or onTouchXX() is better for modern design.
Schematic diagram
API Design
class Script
{
.......
/**
* Called when the pointer is down while over the Collider.
*/
onPointerDown(): void {}
/**
* Called when the pointer is up while over the Collider.
*/
onPointerUp(): void {}
/**
* Called when the pointer is down and up with the same collider.
*/
onPointerClick(): void {}
/**
* Called when the pointer is enters the Collider.
*/
onPointerEnter(): void {}
/**
* Called when the pointer is no longer over the Collider.
*/
onPointerExit(): void {}
/**
* Called when the pointer is down while over the Collider and is still holding down.
* @remarks onMouseDrag is called every frame while the pointer is down.
*/
onPointerDrag(): void {}
......
}
/**
* Input Manager.
*/
export class InputManager {
/** Whether to handle multi-touch. */
multiTouchEnabled: boolean;
/**
* The pointer list of the current frame.
*/
get pointers(): Readonly<Pointer[]> {
return null;
}
}
/**
* Description of pointer information.
*/
export class Pointer {
/** The unique identifier for the pointer. */
id: number;
/** The position of the pointer in screen space pixel coordinates. */
position: Vector2 = new Vector2();
}
Project Management
- Roadmap
- Migration Guide
- Milestone development process specification template
- Milestone 0.9 development
- Milestone 0.8 development
- Milestone 0.7 development
- Milestone 0.6 development
- Milestone 0.5 development
Architecture design
中文指引

