forked from decentraland/sdk7-goerli-plaza
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
1,092 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.* | ||
bin/*.map | ||
package-lock.json | ||
yarn-lock.json | ||
build.json | ||
export | ||
tsconfig.json | ||
tslint.json | ||
node_modules | ||
*.ts | ||
*.tsx | ||
.vscode | ||
Dockerfile | ||
dist | ||
README.md | ||
*.blend | ||
*.fbx | ||
*.zip | ||
*.rar | ||
src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: test-build | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
lint-and-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 18.x | ||
- name: install dependencies | ||
run: npm install | ||
- name: npm run build | ||
run: npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package-lock.json | ||
*.js | ||
node_modules | ||
bin/ | ||
.DS_Store | ||
**/.DS_Store | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["decentralandfoundation.decentraland-sdk7"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
// Use the Decentraland Editor extension of VSCode to debug the scene | ||
// in chrome from VSCode | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "chrome", | ||
"request": "launch", | ||
"name": "Debug Decentraland in Chrome", | ||
"url": "${command:decentraland-sdk7.commands.getDebugURL}", | ||
"webRoot": "${workspaceFolder}/bin", | ||
"sourceMapPathOverrides": { | ||
"dcl:///*": "${workspaceFolder}/*" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
## Pixel Canvas API | ||
|
||
A scene that fetches pixel color data from an API and displays it on a giant canvas. Set your own pixel on the canvas and sync it with an online database via API. | ||
|
||
|
||
|
||
![](images/screenshot.jpg) | ||
|
||
|
||
This scene shows you: | ||
|
||
- How to call a REST API and parse a JSON response | ||
- How to store data in an online databse | ||
- How to detect if player points on an entity | ||
- How to update scene via messageBus | ||
- How to use components to manage entities | ||
|
||
|
||
|
||
## 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** | ||
|
||
1. Download this full repository from [sdk7-goerli-plaza](https://github.com/decentraland/sdk7-goerli-plaza/tree/main), including this and several other example scenes on SDK7. | ||
2. Install the [Decentraland Editor](https://docs.decentraland.org/creator/development-guide/sdk7/editor/) | ||
3. Open a Visual Studio Code window on this scene's root folder. Not on the root folder of the whole repo, but instead on this sub-folder that belongs to the scene. | ||
4. Open the Decentraland Editor tab, and press **Run Scene** | ||
|
||
Alternatively, you can use the command line. Inside this scene root directory run: | ||
|
||
```bash | ||
|
||
npm run start | ||
|
||
``` | ||
|
||
## Scene Setup | ||
|
||
1. Create an account on [restdb.io](https://restdb.io/) | ||
|
||
2. Set up a table in the database with the required fields. Restdb.io will autogenerate a REST API for your table. | ||
|
||
The table for this scene should have the following format: | ||
|
||
```javascript | ||
posX: number | ||
posY: number | ||
color: string | ||
``` | ||
|
||
***CORS Configuration*** | ||
To allow access from a Decentraland scene: | ||
|
||
|
||
1. Navigate to the API tab under settings on restdb.io. | ||
2. Create a new "Web page API key (CORS)". | ||
3. Replace the `apiKey` value in `api.ts` with your generated API key. | ||
|
||
|
||
|
||
|
||
## Copyright info | ||
|
||
This scene is protected with a standard Apache 2 licence. See the terms and conditions in the [LICENSE](/LICENSE) file. |
Oops, something went wrong.