Refactor build resources
Move DUB files into /bld/d and add more instructions to README.
This commit is contained in:
parent
dd8e9d4296
commit
724659b25f
9 changed files with 69 additions and 28 deletions
|
|
@ -1,6 +0,0 @@
|
|||
import std;
|
||||
|
||||
void main()
|
||||
{
|
||||
printf("Start.");
|
||||
}
|
||||
30
src/init/d/bind.d
Normal file
30
src/init/d/bind.d
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import godot;
|
||||
// import godot.api.script; // for GodotScript!
|
||||
// import godot.api.register; // for GodotNativeLibrary
|
||||
// import godot.string; // for gs!
|
||||
|
||||
import godot.node;
|
||||
|
||||
// minimal class example with _ready method that will be invoked on creation
|
||||
class Greeter : GodotScript!Node {
|
||||
@Property String name;
|
||||
|
||||
// this method is a special godot entry point when object is added to the scene
|
||||
@Method
|
||||
void _ready() {
|
||||
// 'gs' is a string wrapper that converts D string to godot string
|
||||
// usually there is helper functions that takes regular D strings and do this for you
|
||||
print(gs!"Hello ", name);
|
||||
}
|
||||
}
|
||||
|
||||
// register classes, initialize and terminate D runtime, only one per plugin
|
||||
mixin GodotNativeLibrary!(
|
||||
// this is a name prefix of the plugin to be acessible inside godot
|
||||
// it must match the prefix in .gdextension file:
|
||||
// entry_symbol = "mydplugin_gdextension_entry"
|
||||
"mydplugin",
|
||||
|
||||
// here goes the list of classes you would like to expose in godot
|
||||
Greeter,
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue