Giter Club home page Giter Club logo

bevy-in-app's Introduction

Bevy in App

Integrate the Bevy engine into existing iOS | Android apps.

If you want to add a mini-game to an existing app, or implement some dynamic UI components, charts ..., or just want to take advantage of the Motion Sensors on your phone for some cool gameplay, you can't use WinitPlugin. Because winit will take over the entire app initialization process and windowing, but we need to create bevy::App in an existing app instance, and we may also want bevy::App to run in an iOS UIView or Android SurfaceView of any size.

This repository implements such a scenario and uses the phone's motion sensor to play breakout mini-games.

Screenshot

Bevy in iOS App Bevy in Android App

iOS

# Add iOS target
rustup target add aarch64-apple-ios

# Build for iOS target
sh ./ios_build.sh --release

Then, Open iOS/bevy_in_iOS.xcodeproj with Xcode,connect an iOS device and run.

Android

Set up Android environment

Assuming your computer already has Android Studio installed, go to Android Studio > Tools > SDK Manager > Android SDK > SDK Tools. Check the following options for installation and click OK.

  • Android SDK Build-Tools
  • Android SDK Command-line Tools
  • NDK(Side by side)

Then, set two following environment variables:

export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
# Replace the NDK version number with the version you installed
export NDK_HOME=$ANDROID_SDK_ROOT/ndk/23.1.7779620

Add build targets

# Since simulator and virtual devices only support GLES,
# `x86_64-linux-android` and `i686-linux-android` targets are not necessary
rustup target add aarch64-linux-android

Build

# Install cargo-so subcommand
cargo install cargo-so

# Build
sh ./android_build.sh --release

Compatible Bevy versions

Bevy version bevy-in-app version
0.14 dev 0.3
0.11-0.12 0.2
0.10 0.1

bevy-in-app's People

Contributors

jinleili avatar aprchen avatar

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.