Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/decentraland-scenes/Basic-Interactions
A minimal scene that shows all the basic ways a player can interact with a scene.
https://github.com/decentraland-scenes/Basic-Interactions
decentraland
Last synced: about 1 month ago
JSON representation
A minimal scene that shows all the basic ways a player can interact with a scene.
- Host: GitHub
- URL: https://github.com/decentraland-scenes/Basic-Interactions
- Owner: decentraland-scenes
- License: apache-2.0
- Created: 2019-08-13T18:27:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-01T17:25:45.000Z (over 2 years ago)
- Last Synced: 2024-08-05T15:04:33.847Z (5 months ago)
- Topics: decentraland
- Language: TypeScript
- Homepage:
- Size: 2.38 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Repository - Button events - interactions.png" width="200"> | A simple example of each way in which players can use button events to interact with the scene. Each shape's color is activated by interacting with it in a special way. | (Examples / Essentials)
README
# Basic button events
A scene with examples of some simple interactions. Perform the corresponding action on each cube to turn it green.
![](screenshot/screenshot.png)
This scene shows you:
- How to handle a click event on an entity
- How to handle pointer down event on an entity
- How to handle pointer up event on an entity
- How to handle a global pointer down event
- How to handle a global pointer up event
- How to handle key E up and down events on an entity
- How to handle key F up and down events on an entity
- How to handle global key E up and down events
- How to handle global key F up and down events
- How to periodically check the distance between the player and an entity
- How to fetch the name of the specific mesh that a button event acted on from a GLTFShape, to handle different behaviors depending on the mesh
- How to change the materials of a primitive shape
- How to delay an action## Try it out
**Install the CLI**
Download and install the Decentraland CLI by running the following command:
```bash
npm i -g decentraland
```**Previewing the scene**
Download this example and navigate to its directory, then run:
```
$: dcl start
```Any dependencies are installed and then the CLI opens the scene in a new browser tab.
**Scene Usage**
Follow the labels on each cube to turn it green, testing all the different ways a player can interact with a Decentraland scene.
Learn more about how to build your own scenes in our [documentation](https://docs.decentraland.org/) site.
If something doesn’t work, please [file an issue](https://github.com/decentraland-scenes/Awesome-Repository/issues/new).
## Copyright info
This scene is protected with a standard Apache 2 licence. See the terms and conditions in the [LICENSE](/LICENSE) file.