Giter Site home page Giter Site logo

godot-android-live-wallpaper's Introduction

wp1 wp2

The Moon Application (Android, iOS)

Godot Android Live Wallpaper

Make your Godot Android application run in the background as a live wallpaper. To download the release, ready to use plugin files go to the Release section. To learn more about Godot Android Live Wallpaper, read more.

This project template is from Android Plugin Template. Also see Creating Android plugins for more details about godot plugins for android.

How to setup

  • Make sure the addons folder plugin is at res://addons/.
  • Go to Project -> Project settings -> Plugins.
  • Enable LiveWallpaper plugin.
  • Go to Project then click Reload Current Project.
  • Now add LiveWallpaper node using the plus add-node button in the scene tab.

How to use

Once the LiveWallpaper node has been added to the scene. You can:

  • reference it from any script and start live wallpaper service by calling start_live_wallpaper_service() method
$LiveWallpaper.start_live_wallpaper_service()
  • Connect to its signals by clicking connect from the Node tab. For example, connecting to signal visibility_changed(visibility:bool) to receive visibility updates, or from code as follows
$LiveWallpaper.visibility_changed.connect(is_user_viewing_my_wallpaper)

Building the plugin

You might want to build the plugin yourself to set wallpaper name and preview picture. To build the plugin:

  • Open the terminal in the project's root directory, and run this command:
compile "Wallpaper Name" "path/to/your/thumbnail.png"
  • Make sure the thumbnail is in PNG format and its filename contains only lowercase letters with no spaces or numbers.

  • If everything goes as expected, static debug and release libraries will be compiled into the plugin/addons/LiveWallpaper/bin folder. After that, copy this addons folder into your Godot project folder, and enable the plugin.

Known Issues

  • Setting the app as a live wallpaper for the lock screen, home screen, or both will always set it to both in Android 14. A workaround is to set it manually from the device wallpaper settings.

Important Considerations:

  • The plugin will attempt to run your entire Godot application as a background live wallpaper, including handling all touch inputs. Therefore, ensure you query the is_live_wallpaper() function to delete or limit frame rate and free resources that are not essential to the live wallpaper process, such as UI elements. Check the sample project in the release section for a working implementation of this.

  • This plugin is essentially a workaround for Godot's native Android that expect Android Activity not Service. While the plugin has been tested with Godot versions 4.2.2.stable and 4.3.dev without any noticeable bugs or crashes, users with different devices might encounter issues.

  • The plugin runs in the background, so be mindful of memory usage and power consumption once your app starts running as a live wallpaper. The plugin provides callback signals such as 'trim_memory' and 'visibility_changed'. Although the app pauses when it is no longer visible, ensure that you do not run intensive tasks when it becomes visible again.

godot-android-live-wallpaper's People

Contributors

theoathman avatar

Stargazers

 avatar N avatar Andrew Watson avatar  avatar udithvb avatar Christopher Marín avatar  avatar Andrew Poženel - CaSCade5509 avatar Roman Goldman avatar  avatar

Watchers

Lucian avatar  avatar  avatar

Forkers

eitanbariboa p-7

godot-android-live-wallpaper's Issues

Two instances of the live wallpaper

Thank you for your work, it's great that you managed to get it working @TheOathMan .

I remember using LIBGDX a long time ago for live wallpapers.
I'm not sure if this interests you, but I believe the issue was resolved there.

Please check these methods; they might solve part of the problem.
Perhaps it could help.


Please see onSurfaceCreated , onCreate function in Engine is little diffirent, maybe this help...

https://github.com/libgdx/libgdx/blob/master/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidLiveWallpaperService.java#L226


Thanks!
Best regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.