-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from dapp-craft/main
Adding support for 'auto' text size
- Loading branch information
Showing
15 changed files
with
552 additions
and
112 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
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,9 @@ | ||
package-lock.json | ||
*.js | ||
node_modules | ||
bin/ | ||
.DS_Store | ||
**/.DS_Store | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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,28 @@ | ||
{ | ||
"name": "dcl-project", | ||
"version": "1.0.0", | ||
"description": "SDK7 Template scene", | ||
"scripts": { | ||
"start": "sdk-commands start", | ||
"deploy": "sdk-commands deploy", | ||
"build": "sdk-commands build", | ||
"upgrade-sdk": "npm install --save-dev @dcl/sdk@latest", | ||
"upgrade-sdk:next": "npm install --save-dev @dcl/sdk@next", | ||
"link-sdk": "cd node_modules/@dcl/sdk && npm link && cd ../js-runtime && npm link" | ||
}, | ||
"devDependencies": { | ||
"@dcl/js-runtime": "7.3.36", | ||
"@dcl/sdk": "latest", | ||
"@dcl/asset-packs": "latest" | ||
}, | ||
"engines": { | ||
"node": ">=16.0.0", | ||
"npm": ">=6.0.0" | ||
}, | ||
"prettier": { | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 120, | ||
"trailingComma": "none" | ||
} | ||
} |
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,53 @@ | ||
{ | ||
"ecs7": true, | ||
"runtimeVersion": "7", | ||
"display": { | ||
"title": "SDK7 Scene Template", | ||
"description": "template scene with SDK7", | ||
"navmapThumbnail": "images/scene-thumbnail.png", | ||
"favicon": "favicon_asset" | ||
}, | ||
"owner": "", | ||
"contact": { | ||
"name": "SDK", | ||
"email": "" | ||
}, | ||
"main": "bin/index.js", | ||
"tags": [], | ||
"scene": { | ||
"parcels": [ | ||
"0,0" | ||
], | ||
"base": "0,0" | ||
}, | ||
"spawnPoints": [ | ||
{ | ||
"name": "spawn1", | ||
"default": true, | ||
"position": { | ||
"x": [ | ||
0, | ||
3 | ||
], | ||
"y": [ | ||
0, | ||
0 | ||
], | ||
"z": [ | ||
0, | ||
3 | ||
] | ||
}, | ||
"cameraTarget": { | ||
"x": 8, | ||
"y": 1, | ||
"z": 8 | ||
} | ||
} | ||
], | ||
"requiredPermissions": [ | ||
"ALLOW_TO_TRIGGER_AVATAR_EMOTE", | ||
"ALLOW_TO_MOVE_PLAYER_INSIDE_SCENE" | ||
], | ||
"featureToggles": {} | ||
} |
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,34 @@ | ||
import * as npc from 'dcl-npc-toolkit' | ||
import { MeshCollider } from '@dcl/sdk/ecs' | ||
import { Quaternion, Vector3 } from '@dcl/sdk/math' | ||
import { setupUi } from './uiComp' | ||
|
||
export function main() { | ||
|
||
setupUi() | ||
|
||
let myNPC = npc.create( | ||
{ position: Vector3.create(8, 1, 8), rotation: Quaternion.Zero(), scale: Vector3.create(1, 1, 1) }, | ||
{ | ||
type: npc.NPCType.CUSTOM, | ||
model: 'models/hi.glb', | ||
portrait: { path: 'images/hi.png', height: 220, width: 220 }, | ||
onActivate: () => { | ||
npc.talk(myNPC, [ | ||
{ | ||
text: `Quest Overview: In the mystical realm of Eldoria, a sinister force has swept through the winter lands, freezing the hearts of magical creatures and stealing the essence of Frostfire Crystals - the source of warmth and magic. As a valiant hero, you are called upon to embark on a quest to restore balance and save the fantastical festivities. `, | ||
windowHeight: 'auto', | ||
isQuestion: true, | ||
buttons: [ | ||
{ label: `Restore magic!`, goToDialog: 0, size: 'auto'}, | ||
{ label: `Crystal theft`, goToDialog: 0, size: 'auto'}, | ||
{ label: `Icy crisis`, goToDialog: 0, size: 100}, | ||
{ label: `Heroes darkness.`, goToDialog: 0 }, | ||
], | ||
} | ||
]) | ||
} | ||
} | ||
) | ||
MeshCollider.setBox(myNPC) | ||
} |
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,18 @@ | ||
import ReactEcs, { ReactEcsRenderer, UiEntity } from '@dcl/sdk/react-ecs' | ||
import * as npc from 'dcl-npc-toolkit' | ||
|
||
export function setupUi() { | ||
ReactEcsRenderer.setUiRenderer(uiComponent) | ||
} | ||
|
||
const uiComponent = () => ( | ||
<UiEntity | ||
uiTransform={{ | ||
width: '100%', | ||
height: '100%', | ||
}} | ||
> | ||
<npc.NpcUtilsUi/> | ||
</UiEntity> | ||
|
||
) |
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,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"strict": true | ||
}, | ||
"include": [ | ||
"src/**/*.ts", | ||
"src/**/*.tsx" | ||
], | ||
"extends": "@dcl/sdk/types/tsconfig.ecs7.json" | ||
} |
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
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
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
Oops, something went wrong.