Giter Site home page Giter Site logo

gdx-backends's Introduction

Backends for libGDX, easy to build

Since we have no regular libGDX releases anymore, it is a problem to fix or extend backend behaviour that can't be overriden. While there's always a way to work around bugs in the core project, this is often not possible in the backends.

This is where this repo comes in.

If you need to change build-in behaviour, but don't manage to get the complete libGDX repo to build, don't want to build your very own version or don't want to use snapshot versions, this repo is what you need. Check my own additions to see what else is changed.

How to build

  • Clone this repo
  • Checkout the revision you need (next paragraph)
  • Type gradlew install
  • Change your project's backend dependency to the one you wish

How to use as a dependency

In case you don't want to change something here yourself, but just want to use some of the additions, you can also use a Jitpack dependency. Don't forget to add Jitpack as a repo to your project:

allprojects {
    repositories {
	    ...
	    maven { url 'https://jitpack.io' }
    }
}

News & Community

You can get help on the libgdx discord.

For use with libGDX 1.9.11 core

1.911.0

Checkout branch release/1.911.0 to use this version, or use the following dependencies for GWT:

  implementation 'com.github.MrStahlfelge.gdx-backends:gdx-backend-gwt:1.911.0'
  implementation 'com.github.MrStahlfelge.gdx-backends:gdx-backend-robovm:1.911.0'

Additions compared to official backends for 1.9.11:

  • GWT: Switched to WebAudio, fixes sounds for mobiles too. Original PR by @barkholt. See current PR for more information.
  • GWT: Faster bootstrap process by lazy loading assets. See current PR for more information.
  • GWT: Fixed density problems on mobile with new config setting. See current PR
  • GWT: Pulled feature policy implementation by @SimonIT. Pending PR
  • iOS: Handles hardware keyboard events like on other platforms Pending PR

Work still to do

GWT

  • Move resizable browser window support into the backend, no template hazzle any more
  • Electron extensions

For use with libGDX 1.9.10 core, or if you are still on 1.9.8 or 1.9.9...

See readme on branch release/1.910.2

gdx-backends's People

Contributors

acoppes avatar badlogic avatar code-disaster avatar cypherdare avatar darkyenus avatar davebaol avatar dsaltares avatar hneuer avatar intrigus avatar johnnyapol avatar jrenner avatar kotcrab avatar manuelbua avatar mgsx-dev avatar mobidevelop avatar mrstahlfelge avatar nathansweet avatar noblemaster avatar nooone avatar obigu avatar pokemmo avatar realitix avatar robertmassaioli avatar semtiko avatar simonit avatar stbachmann avatar tom-ski avatar ttencate avatar vmilea avatar xoppa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gdx-backends's Issues

Music not play on mobile Safari

Issue details

com.badlogic.gdx.audio.Music not play on:

  • MacOS: Safari broswer
  • iPhone: mobile Safari
  • iPad: mobile Safari and Chrome

On mac this error in console: Unhandled Promise Rejection: NotAllowedError.
But com.badlogic.gdx.audio.Sound works normally.

Reproduction steps/code

Play any music on Mobile safari.

Version of LibGDX and/or relevant dependencies

implementation 'com.github.MrStahlfelge.gdx-backends:gdx-backend-gwt:1.910.0'

Solve

Recreate Gdx.audio after user clicked anywhere.

public class HtmlLauncher extends GwtApplication {
         // USE THIS CODE FOR A FIXED SIZE APPLICATION
        @Override
        public GwtApplicationConfiguration getConfig () {
                GwtApplicationConfiguration cfg = new GwtApplicationConfiguration(1280, 720);
                // UNCOMMENT THIS CODE FOR MUSIC WORK
                cfg.disableAudio = true;
                // END OF CODE FOR MUSIC WORK
                return cfg;
        }
        // END CODE FOR FIXED SIZE APPLICATION

        public void recreateAudio() {
                Gdx.audio = new GwtAudio();
        }

Call this method from core code with interface or something.

Please select the affected platforms

  • Android
  • iOS (robovm)
  • iOS (MOE)
  • HTML/GWT
  • Windows
  • Linux
  • MacOS

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.