|
Deki 0.40.1
Modular C++ engine with a visual editor, for 2D and 3D
|
From downloading the editor to your own code running on a device.
Download the archive for your computer from the latest release, unpack it anywhere and run DekiEditor. The compiler is inside the archive, so there is nothing else to install.
Choose File → New Project..., give the project a name and a location, and leave the target platform on Desktop. A device comes later, and the same project runs on both.
The first time a project opens, the editor downloads and builds its packages. This takes a few minutes. Later opens take seconds.
The new project has one scene with three objects: a Camera, a gradient called Sky and a text called Hello.
| Panel | What it is for | |
|---|---|---|
| 1 | Hierarchy | The objects in the scene |
| 2 | Scene View | Where they are; drag them here |
| 3 | Inspector | The components of the selected object and their values |
| 4 | Asset Browser | Your files, with a Scripts tab for your code |
| 5 | Console | Messages from the engine and your code |
An object is a position in the scene. What it does comes from its components, and everything you see in the Inspector is a component.
Changes made while the game is playing are thrown away when it stops. The Inspector says so while it is playing.
Distances are in meters. The camera shows 15 meters from top to bottom, whatever the size of the screen: see Units and Screens.
In the Asset Browser, open Scripts, right-click and choose Create C++ Script. Name it Bob. The editor creates src/Bob.h and src/Bob.cpp. Open them in any text editor and replace what is there.
src/Bob.h:
src/Bob.cpp:
Save both files and go back to the editor. It sees the change and rebuilds your code; the progress is in the Activity panel, and compile errors are listed there.
Select Hello, press Add Component and pick Bob. Its two fields are in the Inspector. Press Run and the text moves up and down. Change a field or the code while it runs and try again.
Awake, Start and Update are the calls a component can receive. It declares the ones it needs.
The first build for a device takes several minutes. The scene you made runs on it unchanged. To add a device Deki does not have yet, see Use your own device.
Or play it in a browser. Choose Web in the list of platforms and press Build & Open in Browser: the game is built into a web page and opens in your browser. The first time, the panel installs Emscripten, the compiler for the web (about 2 GB). It is the same project, so what runs on the device runs there too, and the page's files can go on any website.