https://github.com/kiwijuice56/godot-android-camera
A basic Godot 4.4+ plugin that provides in-game access to an Android device's camera
https://github.com/kiwijuice56/godot-android-camera
android camera godot
Last synced: 7 months ago
JSON representation
A basic Godot 4.4+ plugin that provides in-game access to an Android device's camera
- Host: GitHub
- URL: https://github.com/kiwijuice56/godot-android-camera
- Owner: kiwijuice56
- License: mit
- Created: 2025-02-27T04:10:18.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-03-03T18:19:59.000Z (7 months ago)
- Last Synced: 2025-03-03T19:28:42.246Z (7 months ago)
- Topics: android, camera, godot
- Language: Java
- Homepage:
- Size: 126 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# godot-android-camera
A Godot 4.4+ plugin that provides in-game access to an Android device's camera. API is currently limited, but allows for sampling raw data from the camera at regular intervals (i.e to display camera output in real time).## Usage
Build the plugin (using `./gradlew build` in the root directory) and copy the output folder (in `plugin/demo/addons/`) into your Godot project's addons folder. After activating the plugin, you can use the `AndroidCamera` node to access the camera:```
extends Nodevar android_camera: AndroidCamera
func _ready() -> void:
android_camera = AndroidCamera.new()android_camera.camera_frame.connect(_on_camera_frame)
%CheckCameraPermissionsButton.pressed.connect(_on_check_camera_permissions)
%StartCapturingButton.pressed.connect(_on_start_capturing_pressed)
%StopCapturingButton.pressed.connect(_on_stop_capturing_pressed)func _on_camera_frame(image_texture: ImageTexture) -> void:
%Canvas.texture = image_texturefunc _on_check_camera_permissions() -> void:
android_camera.request_camera_permissions()func _on_start_capturing_pressed() -> void:
android_camera.start_camera(1024, 1024, 50, false)func _on_stop_capturing_pressed() -> void:
android_camera.stop_camera()```