Events API Board
Call the Decentraland Events API to display events that are currently going on. If there are several active at the same time, it will cycle through up to 5 events.
This scene shows you:
- How to call the Decentraland Events API
- How to handle async functions that require waiting for a response
- How to parse a JSON response from an API
- How to parse incoming text fields so that they adjust to line width and a maximum length
- How to use a system to shuffle through different in-world UI screens
- How to use a teleport to travel to other locations in Decentraland
Events that are currently going on have a live
field = true, so it's easy to filter through the returned events to only pick those that are live.
The board displays the event's title, screenshot, location, and location name (if applicable). The board also works as a teleport when clicked, taking players to the currently displayed event.
About the events API:
Root URL: https://events.decentraland.org/api/events/
Events are always ordered by their start_at
time
optional params:
- limit: only show x amount of events
- offset: start showing events from x position onwards
- position: a single event on x position
- estate_id: only events that happen in a given estate
- user: only events created by a given user
- onlyUpcoming: only events that have not started yet
Try it out
Install the CLI
Download and install the Decentraland CLI by running the following command:
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
If there are no live events right now, you won't see the board when running the preview. If there are several live events, they will be shuffled through every few seconds, or you can also click on the dots on the bottom of the board to switch through them manually.
Learn more about how to build your own scenes in our documentation site.
If something doesn’t work, please file an issue.
Copyright info
This scene is protected with a standard Apache 2 licence. See the terms and conditions in the LICENSE file.