diff options
Diffstat (limited to 'hello_world')
21 files changed, 0 insertions, 467 deletions
diff --git a/hello_world/.gitignore b/hello_world/.gitignore deleted file mode 100644 index 796b96d..0000000 --- a/hello_world/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/hello_world/README.md b/hello_world/README.md deleted file mode 100644 index 5cfb640..0000000 --- a/hello_world/README.md +++ /dev/null @@ -1,3 +0,0 @@ -## Hello World plugin - -Showcase how to build a simple Godot Android plugin which is invoked from gdscript diff --git a/hello_world/build.gradle b/hello_world/build.gradle deleted file mode 100644 index 4c12e93..0000000 --- a/hello_world/build.gradle +++ /dev/null @@ -1,43 +0,0 @@ -plugins { - id 'com.android.library' - id 'org.jetbrains.kotlin.android' -} - -android { - compileSdk versions.compileSdk - - defaultConfig { - minSdk versions.minSdk - targetSdk versions.targetSdk - versionCode 1 - versionName "1.0" - } - - // Used to customize the name of generated AAR file. - libraryVariants.all { variant -> - variant.outputs.all { output -> - output.outputFileName = "HelloWorld.${variant.name}.aar" - } - } - -} - -dependencies { - compileOnly "org.godotengine:godot:$versions.godotLibVersion" - implementation "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlinVersion" -} - -task copyDebugAARToAddons(type: Copy) { - from 'build/outputs/aar' - include 'HelloWorld.debug.aar' - into 'demo/addons/hello_world_plugin/export' -} - -task copyReleaseAARToAddons(type: Copy) { - from 'build/outputs/aar' - include 'HelloWorld.release.aar' - into 'demo/addons/hello_world_plugin/export' -} - -assemble.finalizedBy(copyDebugAARToAddons) -assemble.finalizedBy(copyReleaseAARToAddons) diff --git a/hello_world/demo/.gitignore b/hello_world/demo/.gitignore deleted file mode 100644 index b405634..0000000 --- a/hello_world/demo/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.import -/android/ diff --git a/hello_world/demo/Main.gd b/hello_world/demo/Main.gd deleted file mode 100644 index c5174eb..0000000 --- a/hello_world/demo/Main.gd +++ /dev/null @@ -1,11 +0,0 @@ -extends Node2D - -var hello_world_plugin : HelloWorldPlugin - -func _ready(): - hello_world_plugin = preload("res://addons/hello_world_plugin/interface/hello_world_plugin.gd").new() - - -func _on_Button_pressed(): - if hello_world_plugin: - hello_world_plugin.helloWorld() diff --git a/hello_world/demo/Main.tscn b/hello_world/demo/Main.tscn deleted file mode 100644 index 57d3eb0..0000000 --- a/hello_world/demo/Main.tscn +++ /dev/null @@ -1,19 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://bgtr75kiyu5fh"] - -[ext_resource type="Script" path="res://Main.gd" id="1"] - -[node name="Main" type="Node2D"] -script = ExtResource("1") - -[node name="Button" type="Button" parent="."] -anchors_preset = 14 -anchor_top = 0.5 -anchor_right = 1.0 -anchor_bottom = 0.5 -offset_left = 40.0 -offset_top = 250.0 -offset_right = 320.0 -offset_bottom = 312.0 -text = "Hello World" - -[connection signal="pressed" from="Button" to="." method="_on_Button_pressed"] diff --git a/hello_world/demo/addons/hello_world_plugin/export/.gdignore b/hello_world/demo/addons/hello_world_plugin/export/.gdignore deleted file mode 100644 index e69de29..0000000 --- a/hello_world/demo/addons/hello_world_plugin/export/.gdignore +++ /dev/null diff --git a/hello_world/demo/addons/hello_world_plugin/export/HelloWorld.debug.aar b/hello_world/demo/addons/hello_world_plugin/export/HelloWorld.debug.aar Binary files differdeleted file mode 100644 index 4d59e06..0000000 --- a/hello_world/demo/addons/hello_world_plugin/export/HelloWorld.debug.aar +++ /dev/null diff --git a/hello_world/demo/addons/hello_world_plugin/export/HelloWorld.release.aar b/hello_world/demo/addons/hello_world_plugin/export/HelloWorld.release.aar Binary files differdeleted file mode 100644 index 6b112c5..0000000 --- a/hello_world/demo/addons/hello_world_plugin/export/HelloWorld.release.aar +++ /dev/null diff --git a/hello_world/demo/addons/hello_world_plugin/export/hello_world_editor_export_plugin.gd b/hello_world/demo/addons/hello_world_plugin/export/hello_world_editor_export_plugin.gd deleted file mode 100644 index 46a8a3b..0000000 --- a/hello_world/demo/addons/hello_world_plugin/export/hello_world_editor_export_plugin.gd +++ /dev/null @@ -1,16 +0,0 @@ -@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_world_plugin/export/HelloWorld.debug.aar"]) - else: - return PackedStringArray(["hello_world_plugin/export/HelloWorld.release.aar"]) - -func _get_name(): - return "HelloWorldPlugin" diff --git a/hello_world/demo/addons/hello_world_plugin/export/hello_world_editor_plugin.gd b/hello_world/demo/addons/hello_world_plugin/export/hello_world_editor_plugin.gd deleted file mode 100644 index 3865634..0000000 --- a/hello_world/demo/addons/hello_world_plugin/export/hello_world_editor_plugin.gd +++ /dev/null @@ -1,17 +0,0 @@ -@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_world_editor_export_plugin.gd").new() - add_export_plugin(export_plugin) - pass - - -func _exit_tree(): - # Clean-up of the plugin goes here. - remove_export_plugin(export_plugin) - export_plugin = null diff --git a/hello_world/demo/addons/hello_world_plugin/interface/hello_world_plugin.gd b/hello_world/demo/addons/hello_world_plugin/interface/hello_world_plugin.gd deleted file mode 100644 index ed84ef3..0000000 --- a/hello_world/demo/addons/hello_world_plugin/interface/hello_world_plugin.gd +++ /dev/null @@ -1,18 +0,0 @@ -class_name HelloWorldPlugin extends Object - -## Interface used to access the functionality provided by this plugin - -var _hello_world_singleton - -func _init(): - if Engine.has_singleton("HelloWorld"): - _hello_world_singleton = Engine.get_singleton("HelloWorld") - else: - printerr("Initialization error: unable to access the java logic") - -## Toggle between showing and hiding the hello world text -func helloWorld(): - if _hello_world_singleton: - _hello_world_singleton.helloWorld() - else: - printerr("Initialization error") diff --git a/hello_world/demo/addons/hello_world_plugin/plugin.cfg b/hello_world/demo/addons/hello_world_plugin/plugin.cfg deleted file mode 100644 index bc8575e..0000000 --- a/hello_world/demo/addons/hello_world_plugin/plugin.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[plugin] - -name="HelloWorldPlugin" -description="Sample to showcase how to package a Godot Android plugin " -author="Fredia Huya-Kouadio (m4gr3d)" -version="" -script="export/hello_world_editor_plugin.gd" diff --git a/hello_world/demo/default_env.tres b/hello_world/demo/default_env.tres deleted file mode 100644 index 3868def..0000000 --- a/hello_world/demo/default_env.tres +++ /dev/null @@ -1,7 +0,0 @@ -[gd_resource type="Environment" load_steps=2 format=3 uid="uid://bi2meuxrf37pv"] - -[sub_resource type="Sky" id="1"] - -[resource] -background_mode = 2 -sky = SubResource("1") diff --git a/hello_world/demo/export_presets.cfg b/hello_world/demo/export_presets.cfg deleted file mode 100644 index 6356705..0000000 --- a/hello_world/demo/export_presets.cfg +++ /dev/null @@ -1,201 +0,0 @@ -[preset.0] - -name="Android" -platform="Android" -runnable=true -dedicated_server=false -custom_features="" -export_filter="all_resources" -include_filter="" -exclude_filter="" -export_path="android/Hello World Plugin Demo.apk" -encryption_include_filters="" -encryption_exclude_filters="" -encrypt_pck=false -encrypt_directory=false - -[preset.0.options] - -custom_template/debug="" -custom_template/release="" -gradle_build/use_gradle_build=true -gradle_build/export_format=0 -gradle_build/min_sdk="" -gradle_build/target_sdk="" -architectures/armeabi-v7a=true -architectures/arm64-v8a=true -architectures/x86=false -architectures/x86_64=false -version/code=1 -version/name="1.0" -package/unique_name="fhuyakou.godot.plugin.android.helloworld.demo" -package/name="" -package/signed=true -package/app_category=2 -package/retain_data_on_uninstall=false -package/exclude_from_recents=false -launcher_icons/main_192x192="" -launcher_icons/adaptive_foreground_432x432="" -launcher_icons/adaptive_background_432x432="" -graphics/opengl_debug=false -xr_features/xr_mode=0 -screen/immersive_mode=true -screen/support_small=true -screen/support_normal=true -screen/support_large=true -screen/support_xlarge=true -user_data_backup/allow=false -command_line/extra_args="" -apk_expansion/enable=false -apk_expansion/SALT="" -apk_expansion/public_key="" -permissions/custom_permissions=PackedStringArray() -permissions/access_checkin_properties=false -permissions/access_coarse_location=false -permissions/access_fine_location=false -permissions/access_location_extra_commands=false -permissions/access_mock_location=false -permissions/access_network_state=false -permissions/access_surface_flinger=false -permissions/access_wifi_state=false -permissions/account_manager=false -permissions/add_voicemail=false -permissions/authenticate_accounts=false -permissions/battery_stats=false -permissions/bind_accessibility_service=false -permissions/bind_appwidget=false -permissions/bind_device_admin=false -permissions/bind_input_method=false -permissions/bind_nfc_service=false -permissions/bind_notification_listener_service=false -permissions/bind_print_service=false -permissions/bind_remoteviews=false -permissions/bind_text_service=false -permissions/bind_vpn_service=false -permissions/bind_wallpaper=false -permissions/bluetooth=false -permissions/bluetooth_admin=false -permissions/bluetooth_privileged=false -permissions/brick=false -permissions/broadcast_package_removed=false -permissions/broadcast_sms=false -permissions/broadcast_sticky=false -permissions/broadcast_wap_push=false -permissions/call_phone=false -permissions/call_privileged=false -permissions/camera=false -permissions/capture_audio_output=false -permissions/capture_secure_video_output=false -permissions/capture_video_output=false -permissions/change_component_enabled_state=false -permissions/change_configuration=false -permissions/change_network_state=false -permissions/change_wifi_multicast_state=false -permissions/change_wifi_state=false -permissions/clear_app_cache=false -permissions/clear_app_user_data=false -permissions/control_location_updates=false -permissions/delete_cache_files=false -permissions/delete_packages=false -permissions/device_power=false -permissions/diagnostic=false -permissions/disable_keyguard=false -permissions/dump=false -permissions/expand_status_bar=false -permissions/factory_test=false -permissions/flashlight=false -permissions/force_back=false -permissions/get_accounts=false -permissions/get_package_size=false -permissions/get_tasks=false -permissions/get_top_activity_info=false -permissions/global_search=false -permissions/hardware_test=false -permissions/inject_events=false -permissions/install_location_provider=false -permissions/install_packages=false -permissions/install_shortcut=false -permissions/internal_system_window=false -permissions/internet=false -permissions/kill_background_processes=false -permissions/location_hardware=false -permissions/manage_accounts=false -permissions/manage_app_tokens=false -permissions/manage_documents=false -permissions/manage_external_storage=false -permissions/master_clear=false -permissions/media_content_control=false -permissions/modify_audio_settings=false -permissions/modify_phone_state=false -permissions/mount_format_filesystems=false -permissions/mount_unmount_filesystems=false -permissions/nfc=false -permissions/persistent_activity=false -permissions/process_outgoing_calls=false -permissions/read_calendar=false -permissions/read_call_log=false -permissions/read_contacts=false -permissions/read_external_storage=false -permissions/read_frame_buffer=false -permissions/read_history_bookmarks=false -permissions/read_input_state=false -permissions/read_logs=false -permissions/read_phone_state=false -permissions/read_profile=false -permissions/read_sms=false -permissions/read_social_stream=false -permissions/read_sync_settings=false -permissions/read_sync_stats=false -permissions/read_user_dictionary=false -permissions/reboot=false -permissions/receive_boot_completed=false -permissions/receive_mms=false -permissions/receive_sms=false -permissions/receive_wap_push=false -permissions/record_audio=false -permissions/reorder_tasks=false -permissions/restart_packages=false -permissions/send_respond_via_message=false -permissions/send_sms=false -permissions/set_activity_watcher=false -permissions/set_alarm=false -permissions/set_always_finish=false -permissions/set_animation_scale=false -permissions/set_debug_app=false -permissions/set_orientation=false -permissions/set_pointer_speed=false -permissions/set_preferred_applications=false -permissions/set_process_limit=false -permissions/set_time=false -permissions/set_time_zone=false -permissions/set_wallpaper=false -permissions/set_wallpaper_hints=false -permissions/signal_persistent_processes=false -permissions/status_bar=false -permissions/subscribed_feeds_read=false -permissions/subscribed_feeds_write=false -permissions/system_alert_window=false -permissions/transmit_ir=false -permissions/uninstall_shortcut=false -permissions/update_device_stats=false -permissions/use_credentials=false -permissions/use_sip=false -permissions/vibrate=false -permissions/wake_lock=false -permissions/write_apn_settings=false -permissions/write_calendar=false -permissions/write_call_log=false -permissions/write_contacts=false -permissions/write_external_storage=false -permissions/write_gservices=false -permissions/write_history_bookmarks=false -permissions/write_profile=false -permissions/write_secure_settings=false -permissions/write_settings=false -permissions/write_sms=false -permissions/write_social_stream=false -permissions/write_sync_settings=false -permissions/write_user_dictionary=false -xr_features/hand_tracking=0 -xr_features/hand_tracking_frequency=0 -xr_features/passthrough=0 diff --git a/hello_world/demo/icon.png b/hello_world/demo/icon.png Binary files differdeleted file mode 100644 index 5f7f827..0000000 --- a/hello_world/demo/icon.png +++ /dev/null diff --git a/hello_world/demo/project.godot b/hello_world/demo/project.godot deleted file mode 100644 index 3fcf242..0000000 --- a/hello_world/demo/project.godot +++ /dev/null @@ -1,33 +0,0 @@ -; Engine configuration file. -; It's best edited using the editor UI and not directly, -; since the parameters that go here are not all obvious. -; -; Format: -; [section] ; section goes between [] -; param=value ; assign values to parameters - -config_version=5 - -[application] - -config/name="Hello World Plugin Demo" -run/main_scene="res://Main.tscn" -config/features=PackedStringArray("4.1") -config/icon="res://icon.png" - -[debug] - -settings/stdout/verbose_stdout=true - -[editor_plugins] - -enabled=PackedStringArray("res://addons/hello_world_plugin/plugin.cfg") - -[rendering] - -renderer/rendering_method="gl_compatibility" -renderer/rendering_method.mobile="gl_compatibility" -textures/vram_compression/import_etc2_astc=true -environment/defaults/default_environment="res://default_env.tres" -quality/driver/driver_name="GLES2" -vram_compression/import_etc=true diff --git a/hello_world/src/main/AndroidManifest.xml b/hello_world/src/main/AndroidManifest.xml deleted file mode 100644 index 8bb5fa4..0000000 --- a/hello_world/src/main/AndroidManifest.xml +++ /dev/null @@ -1,20 +0,0 @@ -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="fhuyakou.godot.plugin.android.helloworld"> - - <application> - <!-- - Plugin metadata: - - - In the `android:name` attribute, the `org.godotengine.plugin.v1` prefix - is required so Godot can recognize the project as a valid Godot - Android plugin. The plugin name following the prefix should match the value - of the plugin name returned by the plugin initializer. - - - The `android:value` attribute should be the classpath to the plugin - initializer. - --> - <meta-data - android:name="org.godotengine.plugin.v1.HelloWorld" - android:value="fhuyakou.godot.plugin.android.helloworld.HelloWorldPlugin" /> - </application> -</manifest> diff --git a/hello_world/src/main/java/fhuyakou/godot/plugin/android/helloworld/HelloWorldPlugin.java b/hello_world/src/main/java/fhuyakou/godot/plugin/android/helloworld/HelloWorldPlugin.java deleted file mode 100644 index 1dfa1b2..0000000 --- a/hello_world/src/main/java/fhuyakou/godot/plugin/android/helloworld/HelloWorldPlugin.java +++ /dev/null @@ -1,49 +0,0 @@ -package fhuyakou.godot.plugin.android.helloworld; - -import android.app.Activity; -import android.view.View; -import org.godotengine.godot.Godot; -import org.godotengine.godot.plugin.GodotPlugin; -import org.godotengine.godot.plugin.UsedByGodot; - -public class HelloWorldPlugin extends GodotPlugin { - - private static final String HELLO_WORLD = "Hello World"; - - private View helloWorldContainer; - - public HelloWorldPlugin(Godot godot) { - super(godot); - } - - @Override - public String getPluginName() { - return "HelloWorld"; - } - - @Override - public View onMainCreate(Activity activity) { - View view = activity.getLayoutInflater().inflate(R.layout.hello_world_view, null); - helloWorldContainer = view.findViewById(R.id.hello_world_container); - return view; - } - - /** - * Show/hide, print and return "Hello World". - */ - @UsedByGodot - public String helloWorld() { - if (helloWorldContainer != null) { - helloWorldContainer.post(() -> { - if (helloWorldContainer.getVisibility() == View.VISIBLE) { - helloWorldContainer.setVisibility(View.GONE); - } else { - helloWorldContainer.setVisibility(View.VISIBLE); - } - }); - } - - System.out.println(HELLO_WORLD); - return HELLO_WORLD; - } -} diff --git a/hello_world/src/main/res/layout/hello_world_view.xml b/hello_world/src/main/res/layout/hello_world_view.xml deleted file mode 100644 index e831d87..0000000 --- a/hello_world/src/main/res/layout/hello_world_view.xml +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/hello_world_container" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:visibility="gone"> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center" - android:padding="10dp" - android:text="@string/hello_world" - android:textSize="20sp" /> - -</FrameLayout>
\ No newline at end of file diff --git a/hello_world/src/main/res/values/strings.xml b/hello_world/src/main/res/values/strings.xml deleted file mode 100644 index d2cf3ac..0000000 --- a/hello_world/src/main/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<resources> - <string name="hello_world">Hello World</string> -</resources>
\ No newline at end of file |