summaryrefslogtreecommitdiff
path: root/plugins/hello_gdextension/src/main/assets/addons
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/hello_gdextension/src/main/assets/addons')
-rw-r--r--plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.bin/.gdignore1
-rw-r--r--plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.bin/.gitignore2
-rw-r--r--plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.export/.gdignore1
-rw-r--r--plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.export/hello_gdextension_editor_export_plugin.gd16
-rw-r--r--plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.export/hello_gdextension_editor_plugin.gd15
-rw-r--r--plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/hello_gdextension.gdextension14
-rw-r--r--plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/interface/android_icon.svg2
-rw-r--r--plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/interface/hello_gdextension_plugin.gd26
-rw-r--r--plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/plugin.cfg7
9 files changed, 84 insertions, 0 deletions
diff --git a/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.bin/.gdignore b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.bin/.gdignore
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.bin/.gdignore
@@ -0,0 +1 @@
+
diff --git a/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.bin/.gitignore b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.bin/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.bin/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.export/.gdignore b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.export/.gdignore
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.export/.gdignore
@@ -0,0 +1 @@
+
diff --git a/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.export/hello_gdextension_editor_export_plugin.gd b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.export/hello_gdextension_editor_export_plugin.gd
new file mode 100644
index 0000000..5131aa2
--- /dev/null
+++ b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.export/hello_gdextension_editor_export_plugin.gd
@@ -0,0 +1,16 @@
+@tool
+extends EditorExportPlugin
+
+func _supports_platform(platform):
+ if platform is EditorExportPlatformAndroid:
+ return true
+ return false
+
+func _get_android_libraries(platform, debug):
+ if debug:
+ return PackedStringArray(["hello_gdextension_plugin/.bin/debug/HelloGDExtension.debug.aar"])
+ else:
+ return PackedStringArray(["hello_gdextension_plugin/.bin/release/HelloGDExtension.release.aar"])
+
+func _get_name():
+ return "Hello GDExtension plugin"
diff --git a/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.export/hello_gdextension_editor_plugin.gd b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.export/hello_gdextension_editor_plugin.gd
new file mode 100644
index 0000000..f74419c
--- /dev/null
+++ b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/.export/hello_gdextension_editor_plugin.gd
@@ -0,0 +1,15 @@
+@tool
+extends EditorPlugin
+
+# A class member to hold the export plugin during its lifecycle
+var export_plugin : EditorExportPlugin
+
+func _enter_tree():
+ # Initialization of the plugin goes here.
+ export_plugin = preload("hello_gdextension_editor_export_plugin.gd").new()
+ add_export_plugin(export_plugin)
+
+func _exit_tree():
+ # Clean up of the plugin goes here.
+ remove_export_plugin(export_plugin)
+ export_plugin = null
diff --git a/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/hello_gdextension.gdextension b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/hello_gdextension.gdextension
new file mode 100644
index 0000000..176a194
--- /dev/null
+++ b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/hello_gdextension.gdextension
@@ -0,0 +1,14 @@
+[configuration]
+
+entry_symbol = "example_library_init"
+compatibility_minimum = 4.1
+
+[exportable]
+
+android=false
+
+[libraries]
+
+macos = "res://addons/hello_gdextension_plugin/.bin/libhello_gdextension.macos.template_debug.framework"
+android.debug.arm64 = "res://addons/hello_gdextension_plugin/.bin/debug/libhello_gdextension.so"
+android.release.arm64 = "res://addons/hello_gdextension_plugin/.bin/release/libhello_gdextension.so"
diff --git a/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/interface/android_icon.svg b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/interface/android_icon.svg
new file mode 100644
index 0000000..29c0fde
--- /dev/null
+++ b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/interface/android_icon.svg
@@ -0,0 +1,2 @@
+<svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128"><path
+ d="M40-239q8-106 65-196.5T256-579l-75-129q-3-9-.5-18t10.5-14q9-5 19.5-2t15.5 12l74 127q86-37 180-37t180 37l75-127q5-9 15.5-12t19.5 2q8 5 11.5 14.5T780-708l-76 129q94 53 151 143.5T920-239H40Zm240-110q20 0 35-15t15-35q0-20-15-35t-35-15q-20 0-35 15t-15 35q0 20 15 35t35 15Zm400 0q20 0 35-15t15-35q0-20-15-35t-35-15q-20 0-35 15t-15 35q0 20 15 35t35 15Z"/></svg>
diff --git a/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/interface/hello_gdextension_plugin.gd b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/interface/hello_gdextension_plugin.gd
new file mode 100644
index 0000000..b46fb27
--- /dev/null
+++ b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/interface/hello_gdextension_plugin.gd
@@ -0,0 +1,26 @@
+class_name HelloGDExtensionPlugin extends Object
+
+## Interface used to access the functionality provided by the HelloGDExtension plugin
+
+var _hello_gdextension_singleton
+
+func _init():
+ if Engine.has_singleton("HelloGDExtension"):
+ _hello_gdextension_singleton = Engine.get_singleton("HelloGDExtension")
+ else:
+ printerr("Couldn't find HelloGDExtension singleton")
+
+
+## Add a GDExample node
+func add_gdexample_node(parent_node_path: NodePath):
+ if _hello_gdextension_singleton:
+ _hello_gdextension_singleton.addGDExampleNode(parent_node_path)
+ else:
+ printerr("Unable to add gdexample node")
+
+## Update the visibility of the gdexample node
+func set_gdexample_visible(visible: bool):
+ if _hello_gdextension_singleton:
+ _hello_gdextension_singleton.setGDExampleVisible(visible)
+ else:
+ printerr("Unable to update gdexample visibility")
diff --git a/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/plugin.cfg b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/plugin.cfg
new file mode 100644
index 0000000..5c60f2b
--- /dev/null
+++ b/plugins/hello_gdextension/src/main/assets/addons/hello_gdextension_plugin/plugin.cfg
@@ -0,0 +1,7 @@
+[plugin]
+
+name="Hello GDExtension plugin"
+description="Showcases how to package an Android GDExtension plugin"
+author="Fredia Huya-Kouadio"
+version=""
+script=".export/hello_gdextension_editor_plugin.gd"