├── .travis.yml ├── LibGDXonNative.iml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── audio │ │ └── waterpop │ │ │ ├── waterpop.wav │ │ │ └── waterpop2.wav │ ├── box2d │ │ ├── star.png │ │ └── star_self.png │ ├── particle │ │ ├── balloon │ │ │ ├── 1.png │ │ │ ├── 10.png │ │ │ ├── 11.png │ │ │ ├── 12.png │ │ │ ├── 13.png │ │ │ ├── 14.png │ │ │ ├── 15.png │ │ │ ├── 16.png │ │ │ ├── 2.png │ │ │ ├── 3.png │ │ │ ├── 4.png │ │ │ ├── 5.png │ │ │ ├── 6.png │ │ │ ├── 7.png │ │ │ ├── 8.png │ │ │ ├── 9.png │ │ │ └── heart.png │ │ ├── boxfour │ │ │ ├── frame0.png │ │ │ ├── frame1.png │ │ │ ├── frame10.png │ │ │ ├── frame2.png │ │ │ ├── frame3.png │ │ │ ├── frame4.png │ │ │ ├── frame5.png │ │ │ ├── frame6.png │ │ │ ├── frame7.png │ │ │ ├── frame8.png │ │ │ └── frame9.png │ │ ├── boxone │ │ │ ├── frame0.png │ │ │ ├── frame1.png │ │ │ ├── frame10.png │ │ │ ├── frame11.png │ │ │ ├── frame12.png │ │ │ ├── frame2.png │ │ │ ├── frame3.png │ │ │ ├── frame4.png │ │ │ ├── frame5.png │ │ │ ├── frame6.png │ │ │ ├── frame7.png │ │ │ ├── frame8.png │ │ │ └── frame9.png │ │ ├── boxthree │ │ │ ├── frame0.png │ │ │ ├── frame1.png │ │ │ ├── frame10.png │ │ │ ├── frame11.png │ │ │ ├── frame12.png │ │ │ ├── frame2.png │ │ │ ├── frame3.png │ │ │ ├── frame4.png │ │ │ ├── frame5.png │ │ │ ├── frame6.png │ │ │ ├── frame7.png │ │ │ ├── frame8.png │ │ │ └── frame9.png │ │ ├── boxtwo │ │ │ ├── frame0.png │ │ │ ├── frame1.png │ │ │ ├── frame10.png │ │ │ ├── frame11.png │ │ │ ├── frame12.png │ │ │ ├── frame2.png │ │ │ ├── frame3.png │ │ │ ├── frame4.png │ │ │ ├── frame5.png │ │ │ ├── frame6.png │ │ │ ├── frame7.png │ │ │ ├── frame8.png │ │ │ └── frame9.png │ │ ├── firebomb.p │ │ ├── firew │ │ │ ├── frame0.png │ │ │ ├── frame1.png │ │ │ ├── frame10.png │ │ │ ├── frame11.png │ │ │ ├── frame12.png │ │ │ ├── frame2.png │ │ │ ├── frame3.png │ │ │ ├── frame4.png │ │ │ ├── frame5.png │ │ │ ├── frame6.png │ │ │ ├── frame7.png │ │ │ ├── frame8.png │ │ │ └── frame9.png │ │ ├── gifts │ │ │ ├── 1 │ │ │ ├── 2 │ │ │ ├── 3 │ │ │ ├── 4 │ │ │ ├── 5 │ │ │ ├── 6 │ │ │ ├── 7 │ │ │ ├── 8 │ │ │ ├── 9 │ │ │ ├── 10 │ │ │ ├── 11 │ │ │ ├── 12 │ │ │ ├── 13 │ │ │ ├── 14 │ │ │ ├── 15 │ │ │ ├── 16 │ │ │ ├── 17 │ │ │ ├── 18 │ │ │ ├── 19 │ │ │ ├── 20 │ │ │ ├── 21 │ │ │ ├── 22 │ │ │ ├── 23 │ │ │ └── 24 │ │ ├── heartballoon.p │ │ └── waterfall.p │ └── spineboy │ │ ├── spineboy-ess.json │ │ ├── spineboy-ess.skel │ │ ├── spineboy-pma.atlas │ │ ├── spineboy-pma.png │ │ ├── spineboy-pro.json │ │ └── spineboy-pro.skel │ ├── java │ └── alex │ │ └── com │ │ └── gdxdemo │ │ ├── BalloonActivity.java │ │ ├── Box2dActivity.java │ │ ├── FireWorksActivity.java │ │ ├── MainActivity.java │ │ ├── MyApplication.java │ │ ├── SpineActivity.java │ │ ├── awesome │ │ ├── AwesomeActivity.java │ │ ├── AwesomeEffectView.java │ │ └── AwesomeFragment.java │ │ ├── balloon │ │ ├── BalloonParticleContants.java │ │ ├── BalloonParticleEffectView.java │ │ ├── BalloonParticleEvents.java │ │ └── BalloonParticleFragment.java │ │ ├── base │ │ └── InterceptableViewGroup.java │ │ ├── box2d │ │ ├── Beans │ │ │ ├── BallInfo.java │ │ │ └── Box2dConstant.java │ │ ├── Box2DFragment.java │ │ ├── Box2dEffectView.java │ │ ├── Box2dSenserLogic.java │ │ └── Tools │ │ │ ├── GiftParticleContants.java │ │ │ ├── ScreenParamUtil.java │ │ │ └── Transform.java │ │ ├── fireworks │ │ ├── GiftParticleContants.java │ │ ├── GiftParticleEffectView.java │ │ └── GiftParticleFragment.java │ │ ├── spine │ │ ├── LibgdxSpineEffectView.java │ │ └── LibgdxSpineFragment.java │ │ └── testcode │ │ ├── HalfScreenActivity.java │ │ ├── NormalActivity.java │ │ ├── SpringEffect.java │ │ └── utils.java │ └── res │ ├── drawable │ ├── bg_edittext.xml │ ├── bg_edittext_focused.xml │ ├── bg_edittext_normal.xml │ ├── checkbox.xml │ ├── interuptdashsharp.xml │ ├── particledashsharp.xml │ ├── particlestylescrazymodebtnsharp.xml │ ├── paticlestylebtnsharp.xml │ ├── paticlestyleredbtnsharp.xml │ └── testbtnsharp.xml │ ├── layout │ ├── awesome_activity.xml │ ├── balloon_activity.xml │ ├── box2d_activity.xml │ ├── gift_activity.xml │ ├── layout_activity_dialogstyle.xml │ ├── layout_activity_normalscreen.xml │ ├── lf_layout_giftparticle.xml │ ├── main_activity.xml │ └── spine_activity.xml │ ├── menu │ └── menu_main.xml │ ├── mipmap-hdpi │ ├── checkbox_checked.png │ ├── checkbox_unchecked.png │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── color.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── cover1.gif ├── cover2.gif ├── cover3.gif ├── cover4.gif ├── gdxdemo.iml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── libGDX-Android-AppEffect.iml ├── libGDX-particle-Demo.iml └── settings.gradle /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | 3 | jdk: 4 | - oraclejdk8 5 | 6 | android: 7 | components: 8 | # Uncomment the lines below if you want to 9 | # use the latest revision of Android SDK Tools 10 | # - tools 11 | # - platform-tools 12 | 13 | - chmod +x gradlew 14 | 15 | # The BuildTools version used by your project 16 | - build-tools-26.0.2 17 | 18 | # The SDK version used to compile your project 19 | - android-22 20 | 21 | # Additional components 22 | - extra-google-google_play_services 23 | - extra-google-m2repository 24 | - extra-android-m2repository 25 | - addon-google_apis-google-19 26 | 27 | # Specify at least one system image, 28 | # if you need to run emulator(s) during your tests 29 | - sys-img-armeabi-v7a-android-22 30 | - sys-img-armeabi-v7a-android-17 -------------------------------------------------------------------------------- /LibGDXonNative.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **by AlexQ ([email](alexq_andr@163.com) alexq_andr@163.com)** 2 | 3 | ![image](http://7xox5k.com1.z0.glb.clouddn.com/15-12-5/13896084.jpg) 4 | 5 | [![Build Status](https://travis-ci.org/qjoy/libGDX-Android-AppEffect.svg?branch=master)](https://travis-ci.org/qjoy/libGDX-Android-AppEffect) 6 | 7 | 8 | ##[libGDX游戏引擎官网地址](http://libgdx.badlogicgames.com) 9 | 10 | `What's libGDX? 11 | libGDX is a cross-platform Java game development framework based on OpenGL (ES) that works on Windows, Linux, Mac OS X, Android, your WebGL enabled browser and iOS.` 12 | 13 | 用什么方式能够实现**高效的流畅的(拒绝卡顿)**烟花、物体碰撞、下雪效果。如何将游戏中常用的场景引入到原生App开发中呢?相信一定有人试图思考并尝试自己制作一些初级的游戏引擎,但绘制效率、框架等等都很难解决和完善,那么这篇文章可能会帮到你。如果你还想了解更多细节原理以及整体思想,下面还有几篇文章或许能够给你一些启发。 14 | **我们关注如何结合Android原生APP开发,使用libGDX帮助我们实现高效的特效动画。** 15 | 16 | ![](./cover1.gif)![](./cover2.gif)![](./cover3.gif)![](./cover4.gif) 17 | 18 | [particle Demo video](http://v.youku.com/v_show/id_XMTQwOTIyMjIyOA==.html) 19 | 20 | [box2d Demo video](http://v.youku.com/v_show/id_XMTY1MDE4NzM4OA==.html) 21 | 22 | 23 | libGDX几篇文章总结一下: 24 | 25 | 1. [《libGDX系列-Android FrameWork 基于libGDX实现高性能动画特效(粒子特效/烟花效果篇)》](http://alexq.farbox.com/post/2015-12-11) 26 | 2. [《libGDX系列-libGDX 入门精要》](http://alexq.farbox.com/post/libgdx) 27 | 3. [《libGDX系列-Box2D 入门简要》](http://alexq.farbox.com/post/box2d-ru-men-jian-yao) 28 | 4. [《libGDX系列-Android FrameWork 基于libGDX实现高性能动画特效(Box2D/物理碰撞 篇)》](http://alexq.farbox.com/post/android-framework-ji-yu-libgdxshi-xian-gao-xing-neng-dong-hua-te-xiao-box2d/wu-li-peng-zhuang-pian) 29 | 5. [《libGDX系列-结合APP开发综合笔记》](http://alexq.farbox.com/post/libgdxxi-lie-ji-yu-appzong-he-bi-ji) 30 | 31 | 32 | **另**:为了减少包大小以及降低方法数,我将gdx.jar进行了裁剪。[gdx-lite.jar](http://7xox5k.com1.z0.glb.clouddn.com/gdx-lite.jar)版本基于1.6.1版本gdx.jar裁剪掉部分方法,使用存在风险请悉知。主要裁剪掉功能包括:maps、xml支持、scene2d中除去ui、utils的部分。包大小从1.8M到1.3M,方法数从到13716到10697。 33 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /app.iml 3 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion '26.0.2' 6 | 7 | defaultConfig { 8 | applicationId "alex.com.gdxdemo" 9 | minSdkVersion 11 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | 15 | sourceSets { 16 | main { 17 | jniLibs.srcDirs = ['libs'] 18 | } 19 | } 20 | 21 | buildTypes { 22 | release { 23 | minifyEnabled false 24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 25 | } 26 | } 27 | 28 | lintOptions { 29 | abortOnError false 30 | } 31 | 32 | } 33 | 34 | dependencies { 35 | 36 | configurations { natives } 37 | 38 | compile fileTree(dir: 'libs', include: ['*.jar']) 39 | compile 'com.android.support:appcompat-v7:22.1.1' 40 | compile 'com.badoo.mobile:android-weak-handler:1.0' 41 | compile 'de.greenrobot:eventbus:2.4.0' 42 | compile 'com.facebook.rebound:rebound:0.3.6' 43 | 44 | compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" 45 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi" 46 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a" 47 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a" 48 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" 49 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64" 50 | compile "com.badlogicgames.gdx:gdx-box2d:$box2dVersion" 51 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$box2dVersion:natives-armeabi" 52 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$box2dVersion:natives-armeabi-v7a" 53 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$box2dVersion:natives-arm64-v8a" 54 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$box2dVersion:natives-x86" 55 | natives "com.badlogicgames.gdx:gdx-box2d-platform:$box2dVersion:natives-x86_64" 56 | 57 | compile "com.esotericsoftware.spine:spine-libgdx:3.5.51.1" 58 | } 59 | 60 | task copyAndroidNatives() { 61 | file("libs/armeabi/").mkdirs(); 62 | file("libs/armeabi-v7a/").mkdirs(); 63 | file("libs/arm64-v8a/").mkdirs(); 64 | file("libs/x86_64/").mkdirs(); 65 | file("libs/x86/").mkdirs(); 66 | 67 | configurations.natives.files.each { jar -> 68 | def outputDir = null 69 | if(jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a") 70 | if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a") 71 | if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi") 72 | if(jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64") 73 | if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86") 74 | if(outputDir != null) { 75 | copy { 76 | from zipTree(jar) 77 | into outputDir 78 | include "*.so" 79 | } 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /System/Library/adt-bundle-mac-x86_64-20140702/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 32 | 33 | 34 | 40 | 41 | 42 | 48 | 49 | 50 | 56 | 57 | 58 | 64 | 65 | 66 | 69 | 70 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /app/src/main/assets/audio/waterpop/waterpop.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/audio/waterpop/waterpop.wav -------------------------------------------------------------------------------- /app/src/main/assets/audio/waterpop/waterpop2.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/audio/waterpop/waterpop2.wav -------------------------------------------------------------------------------- /app/src/main/assets/box2d/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/box2d/star.png -------------------------------------------------------------------------------- /app/src/main/assets/box2d/star_self.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/box2d/star_self.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/1.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/10.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/11.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/12.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/13.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/14.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/15.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/16.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/2.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/3.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/4.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/5.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/6.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/7.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/8.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/9.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/balloon/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/balloon/heart.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxfour/frame0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxfour/frame0.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxfour/frame1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxfour/frame1.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxfour/frame10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxfour/frame10.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxfour/frame2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxfour/frame2.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxfour/frame3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxfour/frame3.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxfour/frame4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxfour/frame4.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxfour/frame5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxfour/frame5.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxfour/frame6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxfour/frame6.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxfour/frame7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxfour/frame7.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxfour/frame8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxfour/frame8.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxfour/frame9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxfour/frame9.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxone/frame0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxone/frame0.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxone/frame1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxone/frame1.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxone/frame10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxone/frame10.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxone/frame11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxone/frame11.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxone/frame12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxone/frame12.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxone/frame2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxone/frame2.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxone/frame3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxone/frame3.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxone/frame4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxone/frame4.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxone/frame5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxone/frame5.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxone/frame6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxone/frame6.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxone/frame7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxone/frame7.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxone/frame8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxone/frame8.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxone/frame9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxone/frame9.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxthree/frame0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxthree/frame0.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxthree/frame1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxthree/frame1.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxthree/frame10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxthree/frame10.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxthree/frame11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxthree/frame11.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxthree/frame12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxthree/frame12.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxthree/frame2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxthree/frame2.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxthree/frame3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxthree/frame3.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxthree/frame4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxthree/frame4.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxthree/frame5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxthree/frame5.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxthree/frame6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxthree/frame6.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxthree/frame7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxthree/frame7.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxthree/frame8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxthree/frame8.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxthree/frame9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxthree/frame9.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxtwo/frame0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxtwo/frame0.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxtwo/frame1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxtwo/frame1.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxtwo/frame10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxtwo/frame10.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxtwo/frame11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxtwo/frame11.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxtwo/frame12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxtwo/frame12.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxtwo/frame2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxtwo/frame2.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxtwo/frame3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxtwo/frame3.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxtwo/frame4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxtwo/frame4.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxtwo/frame5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxtwo/frame5.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxtwo/frame6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxtwo/frame6.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxtwo/frame7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxtwo/frame7.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxtwo/frame8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxtwo/frame8.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/boxtwo/frame9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/boxtwo/frame9.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/firebomb.p: -------------------------------------------------------------------------------- 1 | right 2 | - Delay - 3 | active: false 4 | - Duration - 5 | lowMin: 300.0 6 | lowMax: 300.0 7 | - Count - 8 | min: 1 9 | max: 300 10 | - Emission - 11 | lowMin: 30.0 12 | lowMax: 30.0 13 | highMin: 32.0 14 | highMax: 42.0 15 | relative: true 16 | scalingCount: 2 17 | scaling0: 1.0 18 | scaling1: 0.0 19 | timelineCount: 2 20 | timeline0: 0.0 21 | timeline1: 0.98630136 22 | - Life - 23 | lowMin: 1000.0 24 | lowMax: 1000.0 25 | highMin: 1500.0 26 | highMax: 1800.0 27 | relative: false 28 | scalingCount: 2 29 | scaling0: 1.0 30 | scaling1: 0.6363636 31 | timelineCount: 2 32 | timeline0: 0.0 33 | timeline1: 1.0 34 | - Life Offset - 35 | active: false 36 | - X Offset - 37 | active: false 38 | - Y Offset - 39 | active: false 40 | - Spawn Shape - 41 | shape: point 42 | - Spawn Width - 43 | lowMin: 50.0 44 | lowMax: 50.0 45 | highMin: 60.0 46 | highMax: 65.0 47 | relative: true 48 | scalingCount: 2 49 | scaling0: 1.0 50 | scaling1: 0.07272727 51 | timelineCount: 2 52 | timeline0: 0.0 53 | timeline1: 1.0 54 | - Spawn Height - 55 | lowMin: 0.0 56 | lowMax: 0.0 57 | highMin: 0.0 58 | highMax: 0.0 59 | relative: false 60 | scalingCount: 1 61 | scaling0: 1.0 62 | timelineCount: 1 63 | timeline0: 0.0 64 | - Scale - 65 | lowMin: 10.0 66 | lowMax: 20.0 67 | highMin: 80.0 68 | highMax: 85.0 69 | relative: true 70 | scalingCount: 2 71 | scaling0: 1.0 72 | scaling1: 0.0 73 | timelineCount: 2 74 | timeline0: 0.0 75 | timeline1: 1.0 76 | - Velocity - 77 | active: true 78 | lowMin: 0.0 79 | lowMax: 0.0 80 | highMin: 300.0 81 | highMax: 600.0 82 | relative: true 83 | scalingCount: 2 84 | scaling0: 1.0 85 | scaling1: 1.0 86 | timelineCount: 2 87 | timeline0: 0.0 88 | timeline1: 1.0 89 | - Angle - 90 | active: true 91 | lowMin: 0.0 92 | lowMax: 0.0 93 | highMin: -50.0 94 | highMax: 200.0 95 | relative: false 96 | scalingCount: 2 97 | scaling0: 1.0 98 | scaling1: 1.0 99 | timelineCount: 2 100 | timeline0: 0.0 101 | timeline1: 1.0 102 | - Rotation - 103 | active: true 104 | lowMin: 0.0 105 | lowMax: 0.0 106 | highMin: 0.0 107 | highMax: 360.0 108 | relative: true 109 | scalingCount: 2 110 | scaling0: 1.0 111 | scaling1: 1.0 112 | timelineCount: 2 113 | timeline0: 0.0 114 | timeline1: 1.0 115 | - Wind - 116 | active: false 117 | - Gravity - 118 | active: true 119 | lowMin: -1500.0 120 | lowMax: -1450.0 121 | highMin: 0.0 122 | highMax: 250.0 123 | relative: false 124 | scalingCount: 2 125 | scaling0: 1.0 126 | scaling1: 0.0 127 | timelineCount: 2 128 | timeline0: 0.0 129 | timeline1: 1.0 130 | - Tint - 131 | colorsCount: 3 132 | colors0: 1.0 133 | colors1: 1.0 134 | colors2: 1.0 135 | timelineCount: 1 136 | timeline0: 0.0 137 | - Transparency - 138 | lowMin: 0.0 139 | lowMax: 0.0 140 | highMin: 1.0 141 | highMax: 1.0 142 | relative: false 143 | scalingCount: 3 144 | scaling0: 0.877193 145 | scaling1: 0.98245615 146 | scaling2: 0.0 147 | timelineCount: 3 148 | timeline0: 0.0 149 | timeline1: 0.38356164 150 | timeline2: 1.0 151 | - Options - 152 | attached: true 153 | continuous: false 154 | aligned: false 155 | additive: false 156 | behind: false 157 | - Image Path - 158 | 159 | 160 | -------------------------------------------------------------------------------- /app/src/main/assets/particle/firew/frame0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/firew/frame0.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/firew/frame1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/firew/frame1.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/firew/frame10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/firew/frame10.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/firew/frame11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/firew/frame11.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/firew/frame12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/firew/frame12.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/firew/frame2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/firew/frame2.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/firew/frame3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/firew/frame3.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/firew/frame4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/firew/frame4.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/firew/frame5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/firew/frame5.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/firew/frame6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/firew/frame6.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/firew/frame7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/firew/frame7.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/firew/frame8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/firew/frame8.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/firew/frame9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/firew/frame9.png -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/1 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/10: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/10 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/11: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/11 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/12 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/13: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/13 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/14: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/14 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/15: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/15 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/16 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/17: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/17 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/18: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/18 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/19: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/19 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/2 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/20: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/20 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/21: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/21 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/22: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/22 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/23: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/23 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/24: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/24 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/3 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/4 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/5 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/6 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/7 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/8 -------------------------------------------------------------------------------- /app/src/main/assets/particle/gifts/9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/particle/gifts/9 -------------------------------------------------------------------------------- /app/src/main/assets/particle/heartballoon.p: -------------------------------------------------------------------------------- 1 | heart 2 | - Delay - 3 | active: false 4 | - Duration - 5 | lowMin: 3500.0 6 | lowMax: 5000.0 7 | - Count - 8 | min: 1 9 | max: 1 10 | - Emission - 11 | lowMin: 60.0 12 | lowMax: 70.0 13 | highMin: 90.0 14 | highMax: 120.0 15 | relative: false 16 | scalingCount: 1 17 | scaling0: 1.0 18 | timelineCount: 1 19 | timeline0: 0.0 20 | - Life - 21 | lowMin: 0.0 22 | lowMax: 0.0 23 | highMin: 2300.0 24 | highMax: 4100.0 25 | relative: false 26 | scalingCount: 1 27 | scaling0: 1.0 28 | timelineCount: 1 29 | timeline0: 0.0 30 | - Life Offset - 31 | active: false 32 | - X Offset - 33 | active: false 34 | - Y Offset - 35 | active: false 36 | - Spawn Shape - 37 | shape: point 38 | - Spawn Width - 39 | lowMin: 0.0 40 | lowMax: 0.0 41 | highMin: 0.0 42 | highMax: 0.0 43 | relative: false 44 | scalingCount: 1 45 | scaling0: 1.0 46 | timelineCount: 1 47 | timeline0: 0.0 48 | - Spawn Height - 49 | lowMin: 0.0 50 | lowMax: 0.0 51 | highMin: 0.0 52 | highMax: 0.0 53 | relative: false 54 | scalingCount: 1 55 | scaling0: 1.0 56 | timelineCount: 1 57 | timeline0: 0.0 58 | - Scale - 59 | lowMin: 40.0 60 | lowMax: 45.0 61 | highMin: 55.0 62 | highMax: 57.0 63 | relative: false 64 | scalingCount: 4 65 | scaling0: 0.0 66 | scaling1: 1.0 67 | scaling2: 1.0 68 | scaling3: 0.71428573 69 | timelineCount: 4 70 | timeline0: 0.0 71 | timeline1: 0.17123288 72 | timeline2: 0.89726025 73 | timeline3: 1.0 74 | - Velocity - 75 | active: true 76 | lowMin: 70.0 77 | lowMax: 150.0 78 | highMin: 200.0 79 | highMax: 400.0 80 | relative: false 81 | scalingCount: 6 82 | scaling0: 0.8367347 83 | scaling1: 1.0 84 | scaling2: 1.0 85 | scaling3: 0.3469388 86 | scaling4: 0.3469388 87 | scaling5: 0.0 88 | timelineCount: 6 89 | timeline0: 0.0 90 | timeline1: 0.11643836 91 | timeline2: 0.53424656 92 | timeline3: 0.72602737 93 | timeline4: 0.89726025 94 | timeline5: 1.0 95 | - Angle - 96 | active: true 97 | lowMin: 90.0 98 | lowMax: 90.0 99 | highMin: -20.0 100 | highMax: 20.0 101 | relative: true 102 | scalingCount: 4 103 | scaling0: 1.0 104 | scaling1: 0.24489796 105 | scaling2: 0.24489796 106 | scaling3: 0.0 107 | timelineCount: 4 108 | timeline0: 0.0 109 | timeline1: 0.21917808 110 | timeline2: 0.7671233 111 | timeline3: 1.0 112 | - Rotation - 113 | active: true 114 | lowMin: -30.0 115 | lowMax: 30.0 116 | highMin: -60.0 117 | highMax: 60.0 118 | relative: false 119 | scalingCount: 5 120 | scaling0: 1.0 121 | scaling1: 0.6938776 122 | scaling2: 0.97959185 123 | scaling3: 0.42857143 124 | scaling4: 0.97959185 125 | timelineCount: 5 126 | timeline0: 0.0 127 | timeline1: 0.23972602 128 | timeline2: 0.49315068 129 | timeline3: 0.7671233 130 | timeline4: 1.0 131 | - Wind - 132 | active: false 133 | - Gravity - 134 | active: false 135 | - Tint - 136 | colorsCount: 3 137 | colors0: 0.9137255 138 | colors1: 0.9137255 139 | colors2: 0.9137255 140 | timelineCount: 1 141 | timeline0: 0.0 142 | - Transparency - 143 | lowMin: 0.0 144 | lowMax: 0.0 145 | highMin: 0.5 146 | highMax: 0.65 147 | relative: false 148 | scalingCount: 4 149 | scaling0: 0.1754386 150 | scaling1: 1.0 151 | scaling2: 0.5263158 152 | scaling3: 0.0 153 | timelineCount: 4 154 | timeline0: 0.0 155 | timeline1: 0.34246576 156 | timeline2: 0.91780823 157 | timeline3: 1.0 158 | - Options - 159 | attached: false 160 | continuous: true 161 | aligned: false 162 | additive: false 163 | behind: false 164 | premultipliedAlpha: false 165 | - Image Path - 166 | 167 | -------------------------------------------------------------------------------- /app/src/main/assets/particle/waterfall.p: -------------------------------------------------------------------------------- 1 | right 2 | - Delay - 3 | active: false 4 | - Duration - 5 | lowMin: 2000.0 6 | lowMax: 2000.0 7 | - Count - 8 | min: 1 9 | max: 1000 10 | - Emission - 11 | lowMin: 1.0 12 | lowMax: 1.0 13 | highMin: 80.0 14 | highMax: 85.0 15 | relative: false 16 | scalingCount: 2 17 | scaling0: 1.0 18 | scaling1: 1.0 19 | timelineCount: 2 20 | timeline0: 0.0 21 | timeline1: 1.0 22 | - Life - 23 | lowMin: 0.0 24 | lowMax: 0.0 25 | highMin: 2800.0 26 | highMax: 2900.0 27 | relative: false 28 | scalingCount: 3 29 | scaling0: 1.0 30 | scaling1: 1.0 31 | scaling2: 1.0 32 | timelineCount: 3 33 | timeline0: 0.0 34 | timeline1: 0.6232877 35 | timeline2: 1.0 36 | - Life Offset - 37 | active: false 38 | - X Offset - 39 | active: false 40 | - Y Offset - 41 | active: false 42 | - Spawn Shape - 43 | shape: line 44 | - Spawn Width - 45 | lowMin: 0.0 46 | lowMax: 0.0 47 | highMin: 140.0 48 | highMax: 145.0 49 | relative: true 50 | scalingCount: 2 51 | scaling0: 1.0 52 | scaling1: 0.9818182 53 | timelineCount: 2 54 | timeline0: 0.0 55 | timeline1: 1.0 56 | - Spawn Height - 57 | lowMin: 0.0 58 | lowMax: 0.0 59 | highMin: 0.0 60 | highMax: 0.0 61 | relative: false 62 | scalingCount: 1 63 | scaling0: 1.0 64 | timelineCount: 1 65 | timeline0: 0.0 66 | - Scale - 67 | lowMin: 25.0 68 | lowMax: 30.0 69 | highMin: 50.0 70 | highMax: 55.0 71 | relative: true 72 | scalingCount: 3 73 | scaling0: 0.25454545 74 | scaling1: 1.0 75 | scaling2: 0.0 76 | timelineCount: 3 77 | timeline0: 0.0 78 | timeline1: 0.30821916 79 | timeline2: 1.0 80 | - Velocity - 81 | active: true 82 | lowMin: 0.0 83 | lowMax: 0.0 84 | highMin: 650.0 85 | highMax: 700.0 86 | relative: true 87 | scalingCount: 2 88 | scaling0: 1.0 89 | scaling1: 1.0 90 | timelineCount: 2 91 | timeline0: 0.0 92 | timeline1: 1.0 93 | - Angle - 94 | active: true 95 | lowMin: 0.0 96 | lowMax: 0.0 97 | highMin: 45.0 98 | highMax: 135.0 99 | relative: true 100 | scalingCount: 2 101 | scaling0: 1.0 102 | scaling1: 1.0 103 | timelineCount: 2 104 | timeline0: 0.0 105 | timeline1: 1.0 106 | - Rotation - 107 | active: true 108 | lowMin: 0.0 109 | lowMax: 0.0 110 | highMin: 0.0 111 | highMax: 360.0 112 | relative: true 113 | scalingCount: 2 114 | scaling0: 1.0 115 | scaling1: 1.0 116 | timelineCount: 2 117 | timeline0: 0.0 118 | timeline1: 1.0 119 | - Wind - 120 | active: false 121 | - Gravity - 122 | active: true 123 | lowMin: -3800.0 124 | lowMax: -2300.0 125 | highMin: 550.0 126 | highMax: 800.0 127 | relative: false 128 | scalingCount: 2 129 | scaling0: 1.0 130 | scaling1: 0.0 131 | timelineCount: 2 132 | timeline0: 0.0 133 | timeline1: 1.0 134 | - Tint - 135 | colorsCount: 3 136 | colors0: 1.0 137 | colors1: 1.0 138 | colors2: 1.0 139 | timelineCount: 1 140 | timeline0: 0.0 141 | - Transparency - 142 | lowMin: 0.0 143 | lowMax: 0.0 144 | highMin: 1.0 145 | highMax: 1.0 146 | relative: false 147 | scalingCount: 3 148 | scaling0: 0.7719298 149 | scaling1: 1.0 150 | scaling2: 0.40350878 151 | timelineCount: 3 152 | timeline0: 0.0 153 | timeline1: 0.6917808 154 | timeline2: 1.0 155 | - Options - 156 | attached: true 157 | continuous: false 158 | aligned: false 159 | additive: false 160 | behind: false 161 | - Image Path - 162 | 163 | -------------------------------------------------------------------------------- /app/src/main/assets/spineboy/spineboy-ess.skel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/spineboy/spineboy-ess.skel -------------------------------------------------------------------------------- /app/src/main/assets/spineboy/spineboy-pma.atlas: -------------------------------------------------------------------------------- 1 | 2 | spineboy-pma.png 3 | size: 1024,512 4 | format: RGBA8888 5 | filter: Linear,Linear 6 | repeat: none 7 | crosshair 8 | rotate: false 9 | xy: 794, 167 10 | size: 45, 45 11 | orig: 45, 45 12 | offset: 0, 0 13 | index: -1 14 | dust01 15 | rotate: false 16 | xy: 960, 190 17 | size: 48, 37 18 | orig: 48, 37 19 | offset: 0, 0 20 | index: -1 21 | dust02 22 | rotate: false 23 | xy: 392, 2 24 | size: 43, 44 25 | orig: 43, 44 26 | offset: 0, 0 27 | index: -1 28 | dust03 29 | rotate: false 30 | xy: 841, 163 31 | size: 31, 26 32 | orig: 31, 26 33 | offset: 0, 0 34 | index: -1 35 | eye-indifferent 36 | rotate: false 37 | xy: 960, 229 38 | size: 47, 45 39 | orig: 47, 45 40 | offset: 0, 0 41 | index: -1 42 | eye-surprised 43 | rotate: false 44 | xy: 745, 167 45 | size: 47, 45 46 | orig: 47, 45 47 | offset: 0, 0 48 | index: -1 49 | front-bracer 50 | rotate: false 51 | xy: 547, 2 52 | size: 29, 40 53 | orig: 29, 40 54 | offset: 0, 0 55 | index: -1 56 | front-fist-closed 57 | rotate: false 58 | xy: 920, 190 59 | size: 38, 41 60 | orig: 38, 41 61 | offset: 0, 0 62 | index: -1 63 | front-fist-open 64 | rotate: false 65 | xy: 437, 2 66 | size: 43, 44 67 | orig: 43, 44 68 | offset: 0, 0 69 | index: -1 70 | front-foot 71 | rotate: false 72 | xy: 482, 11 73 | size: 63, 35 74 | orig: 63, 35 75 | offset: 0, 0 76 | index: -1 77 | front-shin 78 | rotate: true 79 | xy: 866, 233 80 | size: 41, 92 81 | orig: 41, 92 82 | offset: 0, 0 83 | index: -1 84 | front-thigh 85 | rotate: false 86 | xy: 719, 155 87 | size: 24, 56 88 | orig: 24, 56 89 | offset: 0, 0 90 | index: -1 91 | front-upper-arm 92 | rotate: false 93 | xy: 719, 104 94 | size: 27, 49 95 | orig: 27, 49 96 | offset: 0, 0 97 | index: -1 98 | goggles 99 | rotate: false 100 | xy: 881, 276 101 | size: 131, 83 102 | orig: 131, 83 103 | offset: 0, 0 104 | index: -1 105 | gun 106 | rotate: false 107 | xy: 612, 109 108 | size: 105, 102 109 | orig: 105, 102 110 | offset: 0, 0 111 | index: -1 112 | head 113 | rotate: false 114 | xy: 881, 361 115 | size: 136, 149 116 | orig: 136, 149 117 | offset: 0, 0 118 | index: -1 119 | hoverboard-board 120 | rotate: false 121 | xy: 2, 38 122 | size: 246, 76 123 | orig: 246, 76 124 | offset: 0, 0 125 | index: -1 126 | hoverboard-thruster 127 | rotate: true 128 | xy: 578, 12 129 | size: 30, 32 130 | orig: 30, 32 131 | offset: 0, 0 132 | index: -1 133 | hoverglow-small 134 | rotate: true 135 | xy: 572, 44 136 | size: 137, 38 137 | orig: 137, 38 138 | offset: 0, 0 139 | index: -1 140 | mouth-grind 141 | rotate: true 142 | xy: 713, 55 143 | size: 47, 30 144 | orig: 47, 30 145 | offset: 0, 0 146 | index: -1 147 | mouth-oooo 148 | rotate: true 149 | xy: 713, 6 150 | size: 47, 30 151 | orig: 47, 30 152 | offset: 0, 0 153 | index: -1 154 | mouth-smile 155 | rotate: false 156 | xy: 748, 135 157 | size: 47, 30 158 | orig: 47, 30 159 | offset: 0, 0 160 | index: -1 161 | muzzle-glow 162 | rotate: false 163 | xy: 612, 8 164 | size: 99, 99 165 | orig: 99, 99 166 | offset: 0, 0 167 | index: -1 168 | muzzle-ring 169 | rotate: false 170 | xy: 302, 190 171 | size: 25, 105 172 | orig: 25, 105 173 | offset: 0, 0 174 | index: -1 175 | muzzle01 176 | rotate: false 177 | xy: 336, 335 178 | size: 271, 175 179 | orig: 271, 175 180 | offset: 0, 0 181 | index: -1 182 | muzzle02 183 | rotate: false 184 | xy: 609, 341 185 | size: 270, 169 186 | orig: 270, 169 187 | offset: 0, 0 188 | index: -1 189 | muzzle03 190 | rotate: false 191 | xy: 2, 297 192 | size: 332, 213 193 | orig: 332, 213 194 | offset: 0, 0 195 | index: -1 196 | muzzle04 197 | rotate: false 198 | xy: 2, 116 199 | size: 298, 179 200 | orig: 298, 179 201 | offset: 0, 0 202 | index: -1 203 | muzzle05 204 | rotate: false 205 | xy: 336, 183 206 | size: 269, 150 207 | orig: 269, 150 208 | offset: 0, 0 209 | index: -1 210 | neck 211 | rotate: false 212 | xy: 841, 191 213 | size: 18, 21 214 | orig: 18, 21 215 | offset: 0, 0 216 | index: -1 217 | portal-bg 218 | rotate: false 219 | xy: 302, 48 220 | size: 133, 133 221 | orig: 133, 133 222 | offset: 0, 0 223 | index: -1 224 | portal-flare1 225 | rotate: false 226 | xy: 180, 6 227 | size: 56, 30 228 | orig: 56, 30 229 | offset: 0, 0 230 | index: -1 231 | portal-flare2 232 | rotate: false 233 | xy: 2, 5 234 | size: 57, 31 235 | orig: 57, 31 236 | offset: 0, 0 237 | index: -1 238 | portal-flare3 239 | rotate: false 240 | xy: 61, 6 241 | size: 58, 30 242 | orig: 58, 30 243 | offset: 0, 0 244 | index: -1 245 | portal-shade 246 | rotate: false 247 | xy: 437, 48 248 | size: 133, 133 249 | orig: 133, 133 250 | offset: 0, 0 251 | index: -1 252 | portal-streaks1 253 | rotate: true 254 | xy: 609, 213 255 | size: 126, 128 256 | orig: 126, 128 257 | offset: 0, 0 258 | index: -1 259 | portsl-streaks2 260 | rotate: false 261 | xy: 739, 214 262 | size: 125, 125 263 | orig: 125, 125 264 | offset: 0, 0 265 | index: -1 266 | rear-bracer 267 | rotate: true 268 | xy: 797, 137 269 | size: 28, 36 270 | orig: 28, 36 271 | offset: 0, 0 272 | index: -1 273 | rear-foot 274 | rotate: false 275 | xy: 121, 6 276 | size: 57, 30 277 | orig: 57, 30 278 | offset: 0, 0 279 | index: -1 280 | rear-shin 281 | rotate: true 282 | xy: 301, 8 283 | size: 38, 89 284 | orig: 38, 89 285 | offset: 0, 0 286 | index: -1 287 | rear-thigh 288 | rotate: true 289 | xy: 866, 198 290 | size: 33, 52 291 | orig: 33, 52 292 | offset: 0, 0 293 | index: -1 294 | rear-upper-arm 295 | rotate: true 296 | xy: 748, 109 297 | size: 24, 44 298 | orig: 24, 44 299 | offset: 0, 0 300 | index: -1 301 | torso 302 | rotate: false 303 | xy: 250, 24 304 | size: 49, 90 305 | orig: 49, 90 306 | offset: 0, 0 307 | index: -1 308 | -------------------------------------------------------------------------------- /app/src/main/assets/spineboy/spineboy-pma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/spineboy/spineboy-pma.png -------------------------------------------------------------------------------- /app/src/main/assets/spineboy/spineboy-pro.skel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qjoy/libGDX-Android-AppEffect/0acafbef99921676df036e2fdf20ca3f24aaa277/app/src/main/assets/spineboy/spineboy-pro.skel -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/BalloonActivity.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo; 2 | 3 | import android.app.AlertDialog; 4 | import android.content.BroadcastReceiver; 5 | import android.content.Context; 6 | import android.content.DialogInterface; 7 | import android.content.Intent; 8 | import android.content.IntentFilter; 9 | import android.os.Bundle; 10 | import android.support.v4.app.FragmentActivity; 11 | import android.support.v7.widget.SwitchCompat; 12 | import android.util.Log; 13 | import android.widget.Button; 14 | import android.widget.CompoundButton; 15 | import android.widget.RelativeLayout; 16 | import android.widget.ScrollView; 17 | import android.widget.TextView; 18 | import android.widget.Toast; 19 | 20 | import com.badlogic.gdx.backends.android.AndroidFragmentApplication; 21 | import com.badoo.mobile.util.WeakHandler; 22 | 23 | import java.util.ArrayList; 24 | 25 | import alex.com.gdxdemo.balloon.BalloonParticleContants; 26 | import alex.com.gdxdemo.balloon.BalloonParticleEvents; 27 | import alex.com.gdxdemo.balloon.BalloonParticleFragment; 28 | import alex.com.gdxdemo.fireworks.GiftParticleContants; 29 | import alex.com.gdxdemo.testcode.SpringEffect; 30 | import de.greenrobot.event.EventBus; 31 | 32 | 33 | public class BalloonActivity extends FragmentActivity implements AndroidFragmentApplication.Callbacks{ 34 | 35 | private BalloonParticleFragment m_libgdxFgm; 36 | private TextView m_tvLog; 37 | private WeakHandler m_weakHandler = new WeakHandler(); 38 | private ScrollView m_scrollv; 39 | private boolean isdestoryed = false; 40 | private boolean m_bOpenCrazyMode = false; 41 | private RelativeLayout mContainer; 42 | private Button mLikeBtn; 43 | private Button mRandomBtn; 44 | private SwitchCompat mSoundSwitch; 45 | private BigRunnable m_bigRunnable = new BigRunnable(); 46 | 47 | private SystemReceiveBroadCast m_systemreceiveBroadCast; 48 | 49 | ArrayList mRandomColors = new ArrayList<>(); 50 | 51 | 52 | ArrayList mRandomPng = new ArrayList<>(); 53 | 54 | public static void launch(Context context) { 55 | Intent intent = new Intent(); 56 | intent.setClass(context, BalloonActivity.class); 57 | intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 58 | context.startActivity(intent); 59 | } 60 | 61 | @Override 62 | protected void onCreate(Bundle savedInstanceState) { 63 | super.onCreate(savedInstanceState); 64 | setContentView(R.layout.balloon_activity); 65 | 66 | m_systemreceiveBroadCast = new SystemReceiveBroadCast(); 67 | IntentFilter filter1 = new IntentFilter(); 68 | filter1.setPriority(800); 69 | filter1.addAction(GiftParticleContants.BROADCAST_GIFTPARTICLE_BACKKEY); 70 | registerReceiver(m_systemreceiveBroadCast, filter1); 71 | 72 | initRandomColors(); 73 | 74 | // setAssetes(); 75 | 76 | mContainer = (RelativeLayout) findViewById(R.id.container); 77 | 78 | m_libgdxFgm = (BalloonParticleFragment) getSupportFragmentManager().findFragmentById(R.id.libgdxFrag); 79 | 80 | m_scrollv = (ScrollView) findViewById(R.id.scrollv); 81 | m_tvLog = (TextView) findViewById(R.id.log); 82 | 83 | mLikeBtn = (Button) findViewById(R.id.addballoon); 84 | final float[] no = {-1f,-1f,-1f}; 85 | 86 | SpringEffect.doEffectSticky(findViewById(R.id.addballoon), new Runnable() { 87 | @Override 88 | public void run() { 89 | m_libgdxFgm.PlayAdd(BalloonParticleContants.BALLOON_PATHTYPE_EXTEND, "particle/balloon/1.png", 1000, no, true); 90 | } 91 | }); 92 | 93 | mRandomBtn = (Button) findViewById(R.id.random); 94 | SpringEffect.doEffectSticky(findViewById(R.id.random), new Runnable() { 95 | @Override 96 | public void run() { 97 | if (m_bOpenCrazyMode == false) { 98 | m_weakHandler.postDelayed(m_bigRunnable, 1); 99 | 100 | mRandomBtn.setText("close CrazyMode"); 101 | } else { 102 | m_weakHandler.removeCallbacks(m_bigRunnable); 103 | mRandomBtn.setText("open CrazyMode"); 104 | } 105 | 106 | m_bOpenCrazyMode = !m_bOpenCrazyMode; 107 | } 108 | }); 109 | 110 | EventBus.getDefault().register(this); 111 | 112 | mSoundSwitch = (SwitchCompat) findViewById(R.id.swichSound); 113 | mSoundSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { 114 | @Override 115 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 116 | switch (buttonView.getId()) { 117 | case R.id.swichSound: { 118 | Log.i("swichSound", isChecked + ""); 119 | if (m_libgdxFgm != null){ 120 | m_libgdxFgm.switchSound(isChecked); 121 | } 122 | break; 123 | } 124 | } 125 | } 126 | }); 127 | 128 | // int randomTime = (int)(Math.random()*600+100); 129 | // 130 | // m_weakHandler.postDelayed(new Runnable() { 131 | // @Override 132 | // public void run() { 133 | // if (m_bOpenCrazyMode == false) { 134 | // m_weakHandler.postDelayed(m_bigRunnable, 1); 135 | // 136 | // mRandomBtn.setText("close CrazyMode"); 137 | // } else { 138 | // m_weakHandler.removeCallbacks(m_bigRunnable); 139 | // mRandomBtn.setText("open CrazyMode"); 140 | // } 141 | // 142 | // m_bOpenCrazyMode = !m_bOpenCrazyMode; 143 | // } 144 | // }, randomTime); 145 | 146 | } 147 | 148 | private class BigRunnable implements Runnable{ 149 | 150 | @Override 151 | public void run() { 152 | if (isdestoryed) 153 | return; 154 | 155 | // float[] randomColor = mRandomColors.get( (int)(Math.random()*(mRandomColors.size()) ) ); 156 | float[] no = {-1f,-1f,-1f}; 157 | m_libgdxFgm.PlayAdd(BalloonParticleContants.BALLOON_PATHTYPE_EXTEND, getHeartBalloon(), 1000, no, false); 158 | int dif = (int) ((float)Math.random()*100f+50f); 159 | m_weakHandler.postDelayed(m_bigRunnable, dif); 160 | } 161 | } 162 | 163 | @Override 164 | protected void onDestroy() { 165 | super.onDestroy(); 166 | 167 | EventBus.getDefault().unregister(this); 168 | 169 | unregisterReceiver(m_systemreceiveBroadCast); 170 | } 171 | 172 | @Override 173 | public void exit() { 174 | 175 | } 176 | 177 | public class SystemReceiveBroadCast extends BroadcastReceiver { 178 | 179 | @Override 180 | public void onReceive(Context context, Intent intent) { 181 | 182 | Log.d(BalloonActivity.class.getSimpleName(), "SystemReceiveBroadCast[^^^^^^^]play Particle Receive: " + intent.getAction()); 183 | if (intent.getAction().equals(GiftParticleContants.BROADCAST_GIFTPARTICLE_BACKKEY)) { 184 | checkquit(); 185 | } 186 | } 187 | } 188 | 189 | private long m_exitTime; 190 | private boolean checkquit() { 191 | 192 | if ((System.currentTimeMillis() - m_exitTime) > 2000) { 193 | Toast.makeText(this, "再次点击退出", Toast.LENGTH_SHORT).show(); 194 | m_exitTime = System.currentTimeMillis(); 195 | } else { 196 | finish(); 197 | } 198 | return true; 199 | } 200 | 201 | @Override 202 | public void finish() { 203 | isdestoryed = true; 204 | m_libgdxFgm.preDestory(); 205 | super.finish(); 206 | } 207 | 208 | protected void dialog(String tip) { 209 | AlertDialog.Builder builder = new AlertDialog.Builder(this); 210 | builder.setMessage(tip); 211 | 212 | builder.setTitle("提示"); 213 | 214 | builder.setPositiveButton("退出", new DialogInterface.OnClickListener() { 215 | 216 | @Override 217 | public void onClick(DialogInterface dialog, int which) { 218 | dialog.dismiss(); 219 | 220 | BalloonActivity.this.finish(); 221 | } 222 | }); 223 | 224 | builder.create().show(); 225 | } 226 | 227 | // private void setAssetes(){ 228 | // File sd= Environment.getExternalStorageDirectory(); 229 | // String path=sd.getPath()+"/libgdxDemo"; 230 | // File file=new File(path); 231 | // if(!file.exists()) { 232 | // file.mkdir(); 233 | // } 234 | // } 235 | 236 | private String getHeartBalloon(){ 237 | 238 | 239 | int index = (int)(Math.random() * 15 + 2); 240 | // Log.d("test", "index:"+index ); 241 | 242 | final String externalPath = "particle/balloon/" +index+".png"; 243 | 244 | // if (!GiftParticleEffectView.fileIsExist(externalPath)) 245 | // { 246 | // dialog("图片资源文件不存在或者路径不正确,请查看测试代码:" + utils.getLineInfo()); 247 | // } 248 | 249 | return externalPath; 250 | } 251 | 252 | private void initRandomColors(){ 253 | float[] colorForestGreen = {108/255f, 225/255f, 249/255f}; 254 | mRandomColors.add(colorForestGreen); 255 | 256 | float[] colorGoldenrod = {224/255f, 253/255f, 96/255f}; 257 | mRandomColors.add(colorGoldenrod); 258 | 259 | float[] colorDarkGoldenrod = {163/255f, 146/255f, 247/255f}; 260 | mRandomColors.add(colorDarkGoldenrod); 261 | 262 | float[] colorSteelBlue1 = {254/255f, 210/255f, 112/255f}; 263 | mRandomColors.add(colorSteelBlue1); 264 | 265 | float[] colorBlueViolet = {253/255f, 157/255f, 247/255f}; 266 | mRandomColors.add(colorBlueViolet); 267 | 268 | } 269 | 270 | 271 | private int mOtherLikeCounter = 0; 272 | public void onEventMainThread(BalloonParticleEvents.BalloonParticleLifeCircleBegin event) { 273 | if (!event.isSelf()){ 274 | mOtherLikeCounter++; 275 | Log.d("likecount", "mOtherLikeCounter:"+mOtherLikeCounter); 276 | } 277 | } 278 | 279 | public void onEventMainThread(BalloonParticleEvents.BalloonParticleLifeCircleEnd event) { 280 | if (!event.isSelf()){ 281 | mOtherLikeCounter--; 282 | Log.d("likecount", "mOtherLikeCounter:"+mOtherLikeCounter); 283 | } 284 | } 285 | 286 | 287 | } 288 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/Box2dActivity.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.IntentFilter; 7 | import android.content.res.Configuration; 8 | import android.os.Bundle; 9 | import android.support.v4.app.FragmentActivity; 10 | import android.util.Log; 11 | import android.view.WindowManager; 12 | import android.widget.FrameLayout; 13 | import android.widget.RelativeLayout; 14 | import android.widget.Toast; 15 | 16 | import com.badlogic.gdx.backends.android.AndroidFragmentApplication; 17 | import com.badoo.mobile.util.WeakHandler; 18 | 19 | import alex.com.gdxdemo.box2d.Box2DFragment; 20 | import alex.com.gdxdemo.box2d.Tools.GiftParticleContants; 21 | import alex.com.gdxdemo.testcode.SpringEffect; 22 | 23 | public class Box2dActivity extends FragmentActivity implements AndroidFragmentApplication.Callbacks{ 24 | 25 | private Box2DFragment m_box2dFgm; 26 | private WeakHandler m_weakHandler = new WeakHandler(); 27 | private SystemReceiveBroadCast m_systemreceiveBroadCast; 28 | private boolean m_bCrazyMode = false; 29 | 30 | private int m_giftIndex = 1; 31 | private int m_giftCounter = 0; 32 | 33 | public FrameLayout m_container; 34 | 35 | public static void launch(Context context) { 36 | Intent intent = new Intent(); 37 | intent.setClass(context, Box2dActivity.class); 38 | intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 39 | context.startActivity(intent); 40 | } 41 | 42 | @Override 43 | protected void onCreate(Bundle savedInstanceState) { 44 | super.onCreate(savedInstanceState); 45 | setContentView(R.layout.box2d_activity); 46 | 47 | m_container = (FrameLayout) findViewById(R.id.lyt_container); 48 | 49 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 50 | 51 | m_systemreceiveBroadCast = new SystemReceiveBroadCast(); 52 | IntentFilter filter1 = new IntentFilter(); 53 | filter1.setPriority(800); 54 | filter1.addAction(GiftParticleContants.BROADCAST_GIFTPARTICLE_BACKKEY); 55 | registerReceiver(m_systemreceiveBroadCast, filter1); 56 | 57 | m_box2dFgm = new Box2DFragment(); 58 | getSupportFragmentManager().beginTransaction().add(R.id.lyt_container, m_box2dFgm).commit(); 59 | showBox2dFgmFullScreen(); 60 | 61 | SpringEffect.doEffectSticky(findViewById(R.id.sendStarBtn), new Runnable() { 62 | @Override 63 | public void run() { 64 | m_weakHandler.postDelayed(m_runnableSendStar, 50); 65 | } 66 | }); 67 | 68 | SpringEffect.doEffectSticky(findViewById(R.id.crazyModeBtn), new Runnable() { 69 | @Override 70 | public void run() { 71 | new Thread(new Runnable() { 72 | @Override 73 | public void run() { 74 | for (int i=0; i<1000; i++) { 75 | try { 76 | Thread.sleep(50); 77 | } catch (InterruptedException e) { 78 | e.printStackTrace(); 79 | } 80 | m_weakHandler.postDelayed(m_runnableSendStar, 50); 81 | 82 | } 83 | } 84 | }).start(); 85 | 86 | } 87 | }); 88 | } 89 | 90 | private boolean m_testleft = false; 91 | private Runnable m_runnableCrazyMode = new Runnable() { 92 | @Override 93 | public void run() { 94 | m_box2dFgm.addGift(15); 95 | m_testleft = !m_testleft; 96 | m_weakHandler.postDelayed(m_runnableCrazyMode, 50); 97 | } 98 | }; 99 | 100 | private boolean m_testleft1 = false; 101 | private int counter = 0; 102 | private Runnable m_runnableSendGift = new Runnable() { 103 | @Override 104 | public void run() { 105 | if (counter == m_giftCounter) 106 | { 107 | counter = 0; 108 | return; 109 | } 110 | counter++; 111 | m_box2dFgm.addGift(m_giftIndex); 112 | m_testleft1 = !m_testleft1; 113 | m_weakHandler.postDelayed(m_runnableSendGift, 50); 114 | } 115 | }; 116 | 117 | private boolean m_testleft2 = false; 118 | private Runnable m_runnableSendStar = new Runnable() { 119 | @Override 120 | public void run() { 121 | counter++; 122 | m_box2dFgm.addStar(m_testleft2, true); 123 | m_testleft2 = !m_testleft2; 124 | } 125 | }; 126 | 127 | @Override 128 | protected void onDestroy() { 129 | super.onDestroy(); 130 | unregisterReceiver(m_systemreceiveBroadCast); 131 | m_weakHandler.removeCallbacks(m_runnableCrazyMode); 132 | } 133 | 134 | @Override 135 | public void exit() { 136 | 137 | } 138 | 139 | private long m_exitTime; 140 | private boolean checkquit() { 141 | 142 | if ((System.currentTimeMillis() - m_exitTime) > 2000) { 143 | Toast.makeText(this, "再次点击退出", Toast.LENGTH_SHORT).show(); 144 | m_exitTime = System.currentTimeMillis(); 145 | } else { 146 | finish(); 147 | } 148 | return true; 149 | } 150 | 151 | public class SystemReceiveBroadCast extends BroadcastReceiver { 152 | 153 | @Override 154 | public void onReceive(Context context, Intent intent) { 155 | 156 | Log.d(MainActivity.class.getSimpleName(), "SystemReceiveBroadCast[^^^^^^^]play Particle Receive: " + intent.getAction()); 157 | if (intent.getAction().equals(GiftParticleContants.BROADCAST_GIFTPARTICLE_BACKKEY)) { 158 | checkquit(); 159 | } 160 | } 161 | } 162 | 163 | @Override 164 | public void onConfigurationChanged(Configuration newConfig) { 165 | super.onConfigurationChanged(newConfig); 166 | 167 | showBox2dFgmFullScreen(); 168 | } 169 | 170 | private void showBox2dFgmFullScreen(){ 171 | RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)m_container.getLayoutParams(); 172 | params.width = RelativeLayout.LayoutParams.MATCH_PARENT; 173 | params.height = RelativeLayout.LayoutParams.MATCH_PARENT; 174 | m_container.setLayoutParams(params); 175 | } 176 | 177 | @Override 178 | public void finish() { 179 | m_box2dFgm.preDestory(); 180 | super.finish(); 181 | } 182 | } 183 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | import alex.com.gdxdemo.testcode.SpringEffect; 7 | 8 | /** 9 | * @author AleXQ 10 | * @Date 16/2/27 11 | * @Description: 主界面选择demo 12 | */ 13 | 14 | public class MainActivity extends Activity { 15 | 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | setContentView(R.layout.main_activity); 20 | 21 | SpringEffect.doEffectSticky(findViewById(R.id.gift), new Runnable() { 22 | @Override 23 | public void run() { 24 | FireWorksActivity.launch(MainActivity.this); 25 | } 26 | }); 27 | 28 | SpringEffect.doEffectSticky(findViewById(R.id.balloon), new Runnable() { 29 | @Override 30 | public void run() { 31 | BalloonActivity.launch(MainActivity.this); 32 | } 33 | }); 34 | 35 | SpringEffect.doEffectSticky(findViewById(R.id.box2d), new Runnable() { 36 | @Override 37 | public void run() { 38 | Box2dActivity.launch(MainActivity.this); 39 | } 40 | }); 41 | 42 | SpringEffect.doEffectSticky(findViewById(R.id.spine), new Runnable() { 43 | @Override 44 | public void run() { 45 | SpineActivity.launch(MainActivity.this); 46 | } 47 | }); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/MyApplication.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import android.hardware.SensorManager; 6 | import android.util.DisplayMetrics; 7 | import android.util.Log; 8 | 9 | /** 10 | * Created by alex_xq on 15/6/18. 11 | */ 12 | public class MyApplication extends Application{ 13 | 14 | static final private String TAG = "MyApplication"; 15 | 16 | static public SensorManager sm; 17 | 18 | private static MyApplication m_myApplication; 19 | 20 | private static int sDens = 0; 21 | 22 | public static MyApplication getInstance(){ 23 | return m_myApplication; 24 | } 25 | 26 | @Override 27 | public void onCreate() { 28 | super.onCreate(); 29 | 30 | m_myApplication = this; 31 | 32 | sm = (SensorManager)getSystemService(Context.SENSOR_SERVICE); 33 | 34 | DisplayMetrics dm = getResources().getDisplayMetrics(); 35 | sDens = dm.densityDpi; 36 | Log.d(TAG, "dens:" + sDens); 37 | } 38 | 39 | public static int getDens(){ 40 | return sDens; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/SpineActivity.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.IntentFilter; 7 | import android.os.Bundle; 8 | import android.support.v4.app.FragmentActivity; 9 | import android.util.Log; 10 | import android.widget.Toast; 11 | 12 | import com.badlogic.gdx.backends.android.AndroidFragmentApplication; 13 | 14 | import alex.com.gdxdemo.fireworks.GiftParticleContants; 15 | import alex.com.gdxdemo.spine.LibgdxSpineFragment; 16 | import alex.com.gdxdemo.testcode.SpringEffect; 17 | 18 | /** 19 | * Created by QJoy on 2017.12.25. 20 | */ 21 | 22 | public class SpineActivity extends FragmentActivity implements AndroidFragmentApplication.Callbacks 23 | { 24 | 25 | private LibgdxSpineFragment m_libgdxFgm; 26 | 27 | private SystemReceiveBroadCast m_systemreceiveBroadCast; 28 | 29 | public static void launch(Context context) { 30 | Intent intent = new Intent(); 31 | intent.setClass(context, SpineActivity.class); 32 | intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 33 | context.startActivity(intent); 34 | } 35 | 36 | @Override 37 | protected void onCreate(Bundle savedInstanceState) { 38 | super.onCreate(savedInstanceState); 39 | setContentView(R.layout.spine_activity); 40 | 41 | m_systemreceiveBroadCast = new SystemReceiveBroadCast(); 42 | IntentFilter filter1 = new IntentFilter(); 43 | filter1.setPriority(800); 44 | filter1.addAction(GiftParticleContants.BROADCAST_GIFTPARTICLE_BACKKEY); 45 | registerReceiver(m_systemreceiveBroadCast, filter1); 46 | 47 | m_libgdxFgm = (LibgdxSpineFragment) getSupportFragmentManager().findFragmentById(R.id.libgdxFrag); 48 | 49 | SpringEffect.doEffectSticky(findViewById(R.id.jump), new Runnable() { 50 | @Override 51 | public void run() { 52 | m_libgdxFgm.setAction("jump"); 53 | } 54 | }); 55 | 56 | SpringEffect.doEffectSticky(findViewById(R.id.walk), new Runnable() { 57 | @Override 58 | public void run() { 59 | m_libgdxFgm.setAction("walk"); 60 | } 61 | }); 62 | 63 | SpringEffect.doEffectSticky(findViewById(R.id.run), new Runnable() { 64 | @Override 65 | public void run() { 66 | m_libgdxFgm.setAction("run"); 67 | } 68 | }); 69 | } 70 | 71 | @Override 72 | protected void onDestroy() { 73 | super.onDestroy(); 74 | 75 | unregisterReceiver(m_systemreceiveBroadCast); 76 | } 77 | 78 | @Override 79 | public void exit() { 80 | 81 | } 82 | 83 | public class SystemReceiveBroadCast extends BroadcastReceiver { 84 | 85 | @Override 86 | public void onReceive(Context context, Intent intent) { 87 | 88 | Log.d(SpineActivity.class.getSimpleName(), "SystemReceiveBroadCast[^^^^^^^]play Particle Receive: " + intent.getAction()); 89 | if (intent.getAction().equals(GiftParticleContants.BROADCAST_GIFTPARTICLE_BACKKEY)) { 90 | checkquit(); 91 | } 92 | } 93 | } 94 | 95 | private long m_exitTime; 96 | private boolean checkquit() { 97 | 98 | if ((System.currentTimeMillis() - m_exitTime) > 2000) { 99 | Toast.makeText(this, "再次点击退出", Toast.LENGTH_SHORT).show(); 100 | m_exitTime = System.currentTimeMillis(); 101 | } else { 102 | finish(); 103 | } 104 | return true; 105 | } 106 | 107 | @Override 108 | public void finish() { 109 | m_libgdxFgm.preDestory(); 110 | super.finish(); 111 | } 112 | 113 | } 114 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/awesome/AwesomeActivity.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.awesome; 2 | 3 | import android.content.BroadcastReceiver; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.IntentFilter; 7 | import android.os.Bundle; 8 | import android.support.v4.app.FragmentActivity; 9 | import android.util.Log; 10 | import android.widget.Toast; 11 | 12 | import com.badlogic.gdx.backends.android.AndroidFragmentApplication; 13 | 14 | import alex.com.gdxdemo.R; 15 | import alex.com.gdxdemo.fireworks.GiftParticleContants; 16 | 17 | /** 18 | * Created by QJoy on 2017.12.25. 19 | */ 20 | 21 | public class AwesomeActivity extends FragmentActivity implements AndroidFragmentApplication.Callbacks{ 22 | 23 | private AwesomeFragment m_libgdxFgm; 24 | 25 | private SystemReceiveBroadCast m_systemreceiveBroadCast; 26 | 27 | public static void launch(Context context) { 28 | Intent intent = new Intent(); 29 | intent.setClass(context, AwesomeActivity.class); 30 | intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 31 | context.startActivity(intent); 32 | } 33 | 34 | @Override 35 | protected void onCreate(Bundle savedInstanceState) { 36 | super.onCreate(savedInstanceState); 37 | setContentView(R.layout.awesome_activity); 38 | 39 | m_systemreceiveBroadCast = new SystemReceiveBroadCast(); 40 | IntentFilter filter1 = new IntentFilter(); 41 | filter1.setPriority(800); 42 | filter1.addAction(GiftParticleContants.BROADCAST_GIFTPARTICLE_BACKKEY); 43 | registerReceiver(m_systemreceiveBroadCast, filter1); 44 | 45 | m_libgdxFgm = (AwesomeFragment) getSupportFragmentManager().findFragmentById(R.id.libgdxFrag); 46 | 47 | 48 | } 49 | 50 | @Override 51 | protected void onDestroy() { 52 | super.onDestroy(); 53 | 54 | unregisterReceiver(m_systemreceiveBroadCast); 55 | } 56 | 57 | @Override 58 | public void exit() { 59 | 60 | } 61 | 62 | public class SystemReceiveBroadCast extends BroadcastReceiver { 63 | 64 | @Override 65 | public void onReceive(Context context, Intent intent) { 66 | 67 | Log.d(AwesomeActivity.class.getSimpleName(), "SystemReceiveBroadCast[^^^^^^^]play Particle Receive: " + intent.getAction()); 68 | if (intent.getAction().equals(GiftParticleContants.BROADCAST_GIFTPARTICLE_BACKKEY)) { 69 | checkquit(); 70 | } 71 | } 72 | } 73 | 74 | private long m_exitTime; 75 | private boolean checkquit() { 76 | 77 | if ((System.currentTimeMillis() - m_exitTime) > 2000) { 78 | Toast.makeText(this, "再次点击退出", Toast.LENGTH_SHORT).show(); 79 | m_exitTime = System.currentTimeMillis(); 80 | } else { 81 | finish(); 82 | } 83 | return true; 84 | } 85 | 86 | @Override 87 | public void finish() { 88 | m_libgdxFgm.preDestory(); 89 | super.finish(); 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/awesome/AwesomeEffectView.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.awesome; 2 | 3 | import android.util.Log; 4 | 5 | import com.badlogic.gdx.ApplicationListener; 6 | import com.badlogic.gdx.Gdx; 7 | import com.badlogic.gdx.assets.AssetManager; 8 | import com.badlogic.gdx.graphics.GL20; 9 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 10 | 11 | /** 12 | * Created by QJoy on 2017.12.25. 13 | */ 14 | @SuppressWarnings("All") 15 | public class AwesomeEffectView implements ApplicationListener { 16 | 17 | public static boolean openDEBUGLog = false; 18 | private static final String TAG = AwesomeEffectView.class.getSimpleName(); 19 | 20 | //基础绘制资源 21 | SpriteBatch mBatch; 22 | 23 | // Asset资源加载管理 24 | AssetManager mAssetManager = new AssetManager(); 25 | 26 | int mWidth = 0; 27 | 28 | private boolean forceOver = false; 29 | 30 | private boolean mIsLand = false; 31 | 32 | private boolean m_candraw = true; 33 | 34 | 35 | public interface OnStateListener { 36 | public void OnBegin(boolean isSelf); 37 | 38 | public void OnFinish(boolean isSelf); 39 | } 40 | 41 | 42 | 43 | public void forceOver() { 44 | 45 | if (openDEBUGLog) 46 | Log.d(TAG, "forceOver"); 47 | 48 | forceOver = true; 49 | 50 | // 缓冲50ms,解决退出时绘制闪动的问题 51 | try { 52 | Thread.sleep(50); 53 | } catch (InterruptedException e) { 54 | e.printStackTrace(); 55 | } 56 | } 57 | 58 | public void closeforceOver() { 59 | 60 | if (openDEBUGLog) 61 | Log.d(TAG, "closeforceOver"); 62 | 63 | forceOver = false; 64 | 65 | try { 66 | Thread.sleep(50); 67 | } catch (InterruptedException e) { 68 | e.printStackTrace(); 69 | } 70 | } 71 | 72 | 73 | @Override 74 | public void create() { 75 | 76 | if (openDEBUGLog) 77 | Log.d(TAG, "create"); 78 | 79 | mBatch = new SpriteBatch(); 80 | 81 | mWidth = Gdx.graphics.getWidth() > Gdx.graphics.getHeight() ? Gdx.graphics.getHeight() : Gdx.graphics.getWidth(); 82 | 83 | //放置 init 方法 84 | } 85 | 86 | @Override 87 | public void resize(int i, int i2) { 88 | 89 | } 90 | 91 | public void setCanDraw(boolean candraw) { 92 | 93 | if (openDEBUGLog) 94 | Log.d(TAG, "setCanDraw:"+candraw); 95 | 96 | m_candraw = candraw; 97 | 98 | if (!m_candraw) { 99 | // 放置不可见时手动销毁的内容 100 | return; 101 | } 102 | } 103 | 104 | @Override 105 | public void render() { 106 | 107 | Gdx.gl.glClearColor(0, 0, 0, 0); 108 | Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); 109 | 110 | if (forceOver) 111 | return; 112 | 113 | if (!m_candraw) { 114 | // 放置不可见时手动销毁的内容 115 | return; 116 | } 117 | 118 | // 防止动画逻辑 119 | 120 | mBatch.begin(); 121 | // 效果绘制 122 | mBatch.end(); 123 | 124 | } 125 | 126 | @Override 127 | public void pause() { 128 | 129 | } 130 | 131 | @Override 132 | public void resume() { 133 | 134 | } 135 | 136 | @Override 137 | public void dispose() { 138 | 139 | if (openDEBUGLog) 140 | Log.d(TAG, "dispose"); 141 | 142 | mBatch.dispose(); 143 | 144 | //遍历释放所有资源 145 | 146 | } 147 | 148 | } 149 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/awesome/AwesomeFragment.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.awesome; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.res.Configuration; 7 | import android.graphics.PixelFormat; 8 | import android.opengl.GLSurfaceView; 9 | import android.os.Build; 10 | import android.os.Bundle; 11 | import android.os.PowerManager; 12 | import android.support.annotation.Nullable; 13 | import android.util.Log; 14 | import android.view.LayoutInflater; 15 | import android.view.SurfaceView; 16 | import android.view.View; 17 | import android.view.ViewGroup; 18 | 19 | import com.badlogic.gdx.ApplicationListener; 20 | import com.badlogic.gdx.Gdx; 21 | import com.badlogic.gdx.Input; 22 | import com.badlogic.gdx.InputProcessor; 23 | import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; 24 | import com.badlogic.gdx.backends.android.AndroidFragmentApplication; 25 | import com.badoo.mobile.util.WeakHandler; 26 | 27 | import alex.com.gdxdemo.R; 28 | import alex.com.gdxdemo.balloon.BalloonParticleEffectView; 29 | import alex.com.gdxdemo.base.InterceptableViewGroup; 30 | import alex.com.gdxdemo.fireworks.GiftParticleContants; 31 | 32 | 33 | /** 34 | * Created by QJoy on 2017.12.25. 35 | */ 36 | @SuppressWarnings("All") 37 | public class AwesomeFragment extends AndroidFragmentApplication implements InputProcessor { 38 | 39 | public static boolean openDEBUGLog = false; 40 | private static final String TAG = AwesomeFragment.class.getSimpleName(); 41 | private View m_viewRooter = null; 42 | //粒子效果UI容器层 43 | private InterceptableViewGroup mContainer; 44 | //粒子效果绘制层 45 | private BalloonParticleEffectView particleEffectView; 46 | //Fragment 处于销毁过程中标志位 47 | private boolean m_isDestorying = false; 48 | //Fragment 处于OnStop标志位 49 | private boolean m_isStoping = false; 50 | //Screen 是否需要重建播放 51 | private boolean m_isNeedBuild =true; 52 | 53 | private boolean m_hasBuilt = false; 54 | 55 | private WeakHandler m_WeakHandler = new WeakHandler(); 56 | 57 | public void preDestory(){ 58 | 59 | if (openDEBUGLog) 60 | Log.d(TAG, "preDestory"); 61 | 62 | if (!m_hasBuilt) 63 | return; 64 | 65 | particleEffectView.forceOver(); 66 | particleEffectView.setCanDraw(false); 67 | 68 | m_isDestorying = true; 69 | m_isStoping = true; 70 | } 71 | 72 | @Nullable 73 | @Override 74 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 75 | 76 | if (openDEBUGLog) 77 | Log.d(TAG, "onCreateView"); 78 | 79 | m_viewRooter = inflater.inflate(R.layout.lf_layout_giftparticle, null); 80 | return m_viewRooter; 81 | } 82 | 83 | @Override 84 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 85 | 86 | if (openDEBUGLog) 87 | Log.d(TAG, "onViewCreated"); 88 | 89 | super.onViewCreated(view, savedInstanceState); 90 | buildGDX(); 91 | } 92 | 93 | public void buildGDX(){ 94 | 95 | if (openDEBUGLog) 96 | Log.d(TAG, "buildGDX"); 97 | 98 | particleEffectView = new BalloonParticleEffectView(); 99 | View effectview = CreateGLAlpha(particleEffectView); 100 | mContainer = (InterceptableViewGroup) m_viewRooter.findViewById(R.id.container); 101 | mContainer.addView(effectview); 102 | mContainer.setIntercept(true); 103 | Gdx.input.setInputProcessor(this); 104 | Gdx.input.setCatchBackKey(true); 105 | m_hasBuilt = true; 106 | } 107 | 108 | @Override 109 | public void onStart() { 110 | 111 | if (openDEBUGLog) 112 | Log.d(TAG, "onStart"); 113 | 114 | m_isStoping = false; 115 | super.onStart(); 116 | 117 | if (particleEffectView != null) 118 | particleEffectView.setCanDraw(true); 119 | } 120 | 121 | @Override 122 | public void onStop() { 123 | 124 | if (openDEBUGLog) 125 | Log.d(TAG, "onStop"); 126 | 127 | m_isStoping = true; 128 | particleEffectView.setCanDraw(false); 129 | super.onStop(); 130 | } 131 | 132 | @Override 133 | public void onResume() { 134 | 135 | if (openDEBUGLog) 136 | Log.d(TAG, "onResume"); 137 | 138 | super.onResume(); 139 | 140 | if (particleEffectView != null) { 141 | particleEffectView.closeforceOver(); 142 | } 143 | } 144 | 145 | @Override 146 | public void onPause() { 147 | 148 | if (openDEBUGLog) 149 | Log.d(TAG, "onPause"); 150 | 151 | if (particleEffectView != null) { 152 | particleEffectView.forceOver(); 153 | } 154 | 155 | super.onPause(); 156 | } 157 | 158 | @Override 159 | public void onConfigurationChanged(Configuration config) { 160 | 161 | if (openDEBUGLog) 162 | Log.d(TAG, "onConfigurationChanged"); 163 | 164 | super.onConfigurationChanged(config); 165 | 166 | mContainer.removeAllViews(); 167 | buildGDX(); 168 | } 169 | 170 | @TargetApi(Build.VERSION_CODES.HONEYCOMB) 171 | private View CreateGLAlpha(ApplicationListener application) { 172 | 173 | if (openDEBUGLog) 174 | Log.d(TAG, "CreateGLAlpha"); 175 | 176 | // GLSurfaceView透明相关 177 | AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); 178 | cfg.r = cfg.g = cfg.b = cfg.a = 8; 179 | 180 | View view = initializeForView(application, cfg); 181 | 182 | if (view instanceof SurfaceView) { 183 | GLSurfaceView glView = (GLSurfaceView) graphics.getView(); 184 | glView.getHolder().setFormat(PixelFormat.TRANSLUCENT); 185 | glView.setZOrderMediaOverlay(true); 186 | glView.setZOrderOnTop(true); 187 | } 188 | 189 | return view; 190 | } 191 | 192 | @Override 193 | public boolean keyDown(int i) { 194 | 195 | if (openDEBUGLog) 196 | Log.d(TAG, "CreateGLAlpha"); 197 | 198 | if (i == Input.Keys.BACK) { 199 | Intent intent = new Intent(); 200 | intent.setAction(GiftParticleContants.BROADCAST_GIFTPARTICLE_BACKKEY); 201 | if (getActivity() != null) 202 | getActivity().sendBroadcast(intent); 203 | return true; 204 | } 205 | return false; 206 | } 207 | 208 | @Override 209 | public boolean keyUp(int i) { 210 | return false; 211 | } 212 | 213 | @Override 214 | public boolean keyTyped(char c) { 215 | return false; 216 | } 217 | 218 | @Override 219 | public boolean touchDown(int i, int i1, int i2, int i3) { 220 | return false; 221 | } 222 | 223 | @Override 224 | public boolean touchUp(int i, int i1, int i2, int i3) { 225 | return false; 226 | } 227 | 228 | @Override 229 | public boolean touchDragged(int i, int i1, int i2) { 230 | return false; 231 | } 232 | 233 | @Override 234 | public boolean mouseMoved(int i, int i1) { 235 | return false; 236 | } 237 | 238 | @Override 239 | public boolean scrolled(int i) { 240 | return false; 241 | } 242 | 243 | private boolean isScreenLock(){ 244 | try { 245 | PowerManager pm = (PowerManager) getActivity().getSystemService(Context.POWER_SERVICE); 246 | boolean isScreenOn = pm.isScreenOn();//如果为true,则表示屏幕“亮”了,否则屏幕“暗”了。 247 | return !isScreenOn; 248 | }catch (Exception e){ 249 | e.printStackTrace(); 250 | return false; 251 | } 252 | } 253 | } 254 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/balloon/BalloonParticleContants.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.balloon; 2 | 3 | /** 4 | * @author AleXQ 5 | * @Date 15/11/19 6 | * @Description: 气球效果粒子特效相关常量 7 | */ 8 | 9 | public class BalloonParticleContants { 10 | 11 | public static final int BALLOON_PATHTYPE_EXTEND = 0;//外部存储器 12 | public static final int BALLOON_PATHTYPE_INTER = 1;//assets 13 | 14 | 15 | public static final String BROADCAST_BALLOON_PARTICLE_OVER = "youku.laifeng.broadcast.balloonparticleover";//单个粒子效果播放完成 16 | public static final String BROADCAST_BALLOON_PARTICLE_BEGIN = "youku.laifeng.broadcast.balloonparticlebegin";//粒子效果播放begin 17 | 18 | public static final String BROADCAST_BALLOONPARTICLE_BACKKEY = "youku.laifeng.broadcast.balloonparticle.backkey"; 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/balloon/BalloonParticleEvents.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.balloon; 2 | 3 | /** 4 | * @author AleXQ 5 | * @Date 16/2/27 6 | * @Description: BalloonParticle 相关事件通知 7 | */ 8 | 9 | public class BalloonParticleEvents { 10 | 11 | public static class BalloonParticleLifeCircleBegin{ 12 | public boolean mIsSelf; 13 | 14 | public BalloonParticleLifeCircleBegin(boolean isSelf) { 15 | this.mIsSelf = isSelf; 16 | } 17 | 18 | public boolean isSelf() { 19 | return mIsSelf; 20 | } 21 | } 22 | 23 | public static class BalloonParticleLifeCircleEnd{ 24 | public boolean mIsSelf; 25 | 26 | public BalloonParticleLifeCircleEnd(boolean isSelf) { 27 | this.mIsSelf = isSelf; 28 | } 29 | 30 | public boolean isSelf() { 31 | return mIsSelf; 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/balloon/BalloonParticleFragment.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.balloon; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.res.Configuration; 7 | import android.graphics.PixelFormat; 8 | import android.opengl.GLSurfaceView; 9 | import android.os.Build; 10 | import android.os.Bundle; 11 | import android.os.PowerManager; 12 | import android.support.annotation.Nullable; 13 | import android.util.Log; 14 | import android.view.LayoutInflater; 15 | import android.view.SurfaceView; 16 | import android.view.View; 17 | import android.view.ViewGroup; 18 | 19 | import com.badlogic.gdx.ApplicationListener; 20 | import com.badlogic.gdx.Gdx; 21 | import com.badlogic.gdx.Input; 22 | import com.badlogic.gdx.InputProcessor; 23 | import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; 24 | import com.badlogic.gdx.backends.android.AndroidFragmentApplication; 25 | import com.badoo.mobile.util.WeakHandler; 26 | 27 | import alex.com.gdxdemo.R; 28 | import alex.com.gdxdemo.base.InterceptableViewGroup; 29 | import alex.com.gdxdemo.fireworks.GiftParticleContants; 30 | import de.greenrobot.event.EventBus; 31 | 32 | 33 | /** 34 | * Created by alex_xq on 15/6/11. 35 | */ 36 | @SuppressWarnings("All") 37 | public class BalloonParticleFragment extends AndroidFragmentApplication implements InputProcessor { 38 | 39 | public static boolean openDEBUGLog = false; 40 | private static final String TAG = "LIBGDX-BalloonParticleFragment"; 41 | private View m_viewRooter = null; 42 | //粒子效果UI容器层 43 | private InterceptableViewGroup mContainer; 44 | //粒子效果绘制层 45 | private BalloonParticleEffectView particleEffectView; 46 | //Fragment 处于销毁过程中标志位 47 | private boolean m_isDestorying = false; 48 | //Fragment 处于OnStop标志位 49 | private boolean m_isStoping = false; 50 | //Screen 是否需要重建播放 51 | private boolean m_isNeedBuild =true; 52 | 53 | private boolean m_hasBuilt = false; 54 | 55 | private WeakHandler m_WeakHandler = new WeakHandler(); 56 | 57 | public void PlayAdd(int pathtype, String pathstring, int dur, float[] rgb, final boolean isSelf) { 58 | 59 | if (openDEBUGLog) 60 | Log.d(TAG, "PlayAdd"); 61 | 62 | if (m_isStoping || isScreenLock()) 63 | return; 64 | 65 | if (pathstring == null) 66 | return; 67 | if (pathstring.equals("")) 68 | return; 69 | 70 | boolean isLand = (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) ? true : false; 71 | 72 | particleEffectView.Add(pathstring, 73 | dur, 74 | isLand, 75 | rgb, 76 | isSelf); 77 | 78 | 79 | particleEffectView.setOnStateListener(new BalloonParticleEffectView.OnStateListener() { 80 | @Override 81 | public void OnBegin(boolean isself) { 82 | 83 | EventBus.getDefault().post(new BalloonParticleEvents.BalloonParticleLifeCircleBegin(isself)); 84 | 85 | } 86 | 87 | @Override 88 | public void OnFinish(boolean isself) { 89 | 90 | EventBus.getDefault().post(new BalloonParticleEvents.BalloonParticleLifeCircleEnd(isself)); 91 | 92 | } 93 | }); 94 | 95 | } 96 | 97 | public void switchSound(boolean open) 98 | { 99 | if (openDEBUGLog) 100 | Log.d(TAG, "switchSound"); 101 | 102 | if (particleEffectView != null) 103 | { 104 | particleEffectView.switchSound(open); 105 | } 106 | } 107 | 108 | public void preDestory(){ 109 | 110 | if (openDEBUGLog) 111 | Log.d(TAG, "preDestory"); 112 | 113 | if (!m_hasBuilt) 114 | return; 115 | 116 | particleEffectView.forceOver(); 117 | particleEffectView.setCanDraw(false); 118 | 119 | m_isDestorying = true; 120 | m_isStoping = true; 121 | } 122 | 123 | @Nullable 124 | @Override 125 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 126 | 127 | if (openDEBUGLog) 128 | Log.d(TAG, "onCreateView"); 129 | 130 | m_viewRooter = inflater.inflate(R.layout.lf_layout_giftparticle, null); 131 | return m_viewRooter; 132 | } 133 | 134 | @Override 135 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 136 | 137 | if (openDEBUGLog) 138 | Log.d(TAG, "onViewCreated"); 139 | 140 | super.onViewCreated(view, savedInstanceState); 141 | buildGDX(); 142 | } 143 | 144 | public void buildGDX(){ 145 | 146 | if (openDEBUGLog) 147 | Log.d(TAG, "buildGDX"); 148 | 149 | particleEffectView = new BalloonParticleEffectView(); 150 | View effectview = CreateGLAlpha(particleEffectView); 151 | mContainer = (InterceptableViewGroup) m_viewRooter.findViewById(R.id.container); 152 | mContainer.addView(effectview); 153 | mContainer.setIntercept(true); 154 | Gdx.input.setInputProcessor(this); 155 | Gdx.input.setCatchBackKey(true); 156 | m_hasBuilt = true; 157 | } 158 | 159 | @Override 160 | public void onStart() { 161 | 162 | if (openDEBUGLog) 163 | Log.d(TAG, "onStart"); 164 | 165 | m_isStoping = false; 166 | super.onStart(); 167 | 168 | if (particleEffectView != null) 169 | particleEffectView.setCanDraw(true); 170 | } 171 | 172 | @Override 173 | public void onStop() { 174 | 175 | if (openDEBUGLog) 176 | Log.d(TAG, "onStop"); 177 | 178 | m_isStoping = true; 179 | particleEffectView.setCanDraw(false); 180 | super.onStop(); 181 | } 182 | 183 | @Override 184 | public void onResume() { 185 | 186 | if (openDEBUGLog) 187 | Log.d(TAG, "onResume"); 188 | 189 | super.onResume(); 190 | 191 | if (particleEffectView != null) { 192 | particleEffectView.closeforceOver(); 193 | } 194 | } 195 | 196 | @Override 197 | public void onPause() { 198 | 199 | if (openDEBUGLog) 200 | Log.d(TAG, "onPause"); 201 | 202 | if (particleEffectView != null) { 203 | particleEffectView.forceOver(); 204 | } 205 | 206 | super.onPause(); 207 | } 208 | 209 | @Override 210 | public void onConfigurationChanged(Configuration config) { 211 | 212 | if (openDEBUGLog) 213 | Log.d(TAG, "onConfigurationChanged"); 214 | 215 | super.onConfigurationChanged(config); 216 | 217 | mContainer.removeAllViews(); 218 | buildGDX(); 219 | } 220 | 221 | @TargetApi(Build.VERSION_CODES.HONEYCOMB) 222 | private View CreateGLAlpha(ApplicationListener application) { 223 | 224 | if (openDEBUGLog) 225 | Log.d(TAG, "CreateGLAlpha"); 226 | 227 | // GLSurfaceView透明相关 228 | AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); 229 | cfg.r = cfg.g = cfg.b = cfg.a = 8; 230 | 231 | View view = initializeForView(application, cfg); 232 | 233 | if (view instanceof SurfaceView) { 234 | GLSurfaceView glView = (GLSurfaceView) graphics.getView(); 235 | glView.getHolder().setFormat(PixelFormat.TRANSLUCENT); 236 | glView.setZOrderMediaOverlay(true); 237 | glView.setZOrderOnTop(true); 238 | } 239 | 240 | return view; 241 | } 242 | 243 | @Override 244 | public boolean keyDown(int i) { 245 | 246 | if (openDEBUGLog) 247 | Log.d(TAG, "CreateGLAlpha"); 248 | 249 | if (i == Input.Keys.BACK) { 250 | Intent intent = new Intent(); 251 | intent.setAction(GiftParticleContants.BROADCAST_GIFTPARTICLE_BACKKEY); 252 | if (getActivity() != null) 253 | getActivity().sendBroadcast(intent); 254 | return true; 255 | } 256 | return false; 257 | } 258 | 259 | @Override 260 | public boolean keyUp(int i) { 261 | return false; 262 | } 263 | 264 | @Override 265 | public boolean keyTyped(char c) { 266 | return false; 267 | } 268 | 269 | @Override 270 | public boolean touchDown(int i, int i1, int i2, int i3) { 271 | return false; 272 | } 273 | 274 | @Override 275 | public boolean touchUp(int i, int i1, int i2, int i3) { 276 | return false; 277 | } 278 | 279 | @Override 280 | public boolean touchDragged(int i, int i1, int i2) { 281 | return false; 282 | } 283 | 284 | @Override 285 | public boolean mouseMoved(int i, int i1) { 286 | return false; 287 | } 288 | 289 | @Override 290 | public boolean scrolled(int i) { 291 | return false; 292 | } 293 | 294 | private boolean isScreenLock(){ 295 | try { 296 | PowerManager pm = (PowerManager) getActivity().getSystemService(Context.POWER_SERVICE); 297 | boolean isScreenOn = pm.isScreenOn();//如果为true,则表示屏幕“亮”了,否则屏幕“暗”了。 298 | return !isScreenOn; 299 | }catch (Exception e){ 300 | e.printStackTrace(); 301 | return false; 302 | } 303 | } 304 | } 305 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/base/InterceptableViewGroup.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.base; 2 | 3 | 4 | import android.content.Context; 5 | import android.util.AttributeSet; 6 | import android.view.MotionEvent; 7 | import android.widget.RelativeLayout; 8 | 9 | /** 10 | * @author Jerry 11 | * @description 拦截触摸事件的View 12 | * @since 10/11/2015 13 | */ 14 | public class InterceptableViewGroup extends RelativeLayout { 15 | 16 | private boolean intercept = false; 17 | 18 | public InterceptableViewGroup(Context context) { 19 | super(context); 20 | } 21 | 22 | public InterceptableViewGroup(Context context, AttributeSet attrs) { 23 | super(context, attrs); 24 | } 25 | 26 | public InterceptableViewGroup(Context context, AttributeSet attrs, int defStyleAttr) { 27 | super(context, attrs, defStyleAttr); 28 | } 29 | 30 | @Override 31 | public boolean onInterceptTouchEvent(MotionEvent ev) { 32 | if (intercept) 33 | return true; 34 | return super.onInterceptTouchEvent(ev); 35 | } 36 | 37 | public void setIntercept(boolean intercept) { 38 | this.intercept = intercept; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/box2d/Beans/BallInfo.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.box2d.Beans; 2 | 3 | /** 4 | * @author AleXQ 5 | * @Date 15/12/26 6 | * @Description: 小球信息 7 | */ 8 | 9 | public class BallInfo { 10 | 11 | private float m_runtimes = 0; 12 | private float m_aplhascale = 1f; 13 | private int m_ballIndex = 0; 14 | private float m_randomScale = 1.0f; 15 | 16 | // private Texture m_ballTexture; 17 | // 18 | // public BallInfo() { 19 | // 20 | // m_ballTexture = new Texture(Gdx.files.internal("star.png")); 21 | // 22 | // } 23 | 24 | // public Texture getBallTexture() { 25 | // return m_ballTexture; 26 | // } 27 | 28 | public float getRuntimes() { 29 | synchronized (BallInfo.class) { 30 | return m_runtimes; 31 | } 32 | } 33 | 34 | public void setRuntimes(float runtimes) { 35 | synchronized (BallInfo.class) { 36 | m_runtimes = runtimes; 37 | } 38 | } 39 | 40 | public float getAplhascale() { 41 | return m_aplhascale; 42 | } 43 | 44 | public void setAplhascale(float aplhascale) { 45 | m_aplhascale = aplhascale; 46 | } 47 | 48 | public void setBallIndex(int ballIndex) { 49 | m_ballIndex = ballIndex; 50 | } 51 | 52 | public int getBallIndex() { 53 | return m_ballIndex; 54 | } 55 | 56 | public float getRandomScale() { 57 | return m_randomScale; 58 | } 59 | 60 | public void setRandomScale(float randomScale) { 61 | m_randomScale = randomScale; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/box2d/Beans/Box2dConstant.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.box2d.Beans; 2 | 3 | /** 4 | * @author AleXQ 5 | * @Date 15/12/26 6 | * @Description: Box2d功能常量定义 7 | */ 8 | 9 | public class Box2dConstant { 10 | 11 | public static final int MaxBallCounter = 80; 12 | public static final float MaxBallLifer = 3f; 13 | public static final float MaxBallLiferSP = MaxBallLifer - 0.4f; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/box2d/Box2DFragment.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.box2d; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.res.Configuration; 7 | import android.graphics.PixelFormat; 8 | import android.opengl.GLSurfaceView; 9 | import android.os.Build; 10 | import android.os.Bundle; 11 | import android.os.PowerManager; 12 | import android.support.annotation.Nullable; 13 | import android.util.DisplayMetrics; 14 | import android.util.Log; 15 | import android.view.LayoutInflater; 16 | import android.view.SurfaceView; 17 | import android.view.View; 18 | import android.view.ViewGroup; 19 | 20 | import com.badlogic.gdx.ApplicationListener; 21 | import com.badlogic.gdx.Gdx; 22 | import com.badlogic.gdx.Input; 23 | import com.badlogic.gdx.InputProcessor; 24 | import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; 25 | import com.badlogic.gdx.backends.android.AndroidFragmentApplication; 26 | import com.badoo.mobile.util.WeakHandler; 27 | 28 | import alex.com.gdxdemo.R; 29 | import alex.com.gdxdemo.base.InterceptableViewGroup; 30 | import alex.com.gdxdemo.box2d.Tools.GiftParticleContants; 31 | 32 | 33 | /** 34 | * Created by alex_xq on 15/6/11. 35 | */ 36 | @SuppressWarnings("All") 37 | public class Box2DFragment extends AndroidFragmentApplication implements InputProcessor { 38 | 39 | private static final String TAG = "Box2DFragment"; 40 | 41 | public static float s_scale = 1.0f; 42 | 43 | private View m_viewRooter = null; 44 | //粒子效果UI容器层 45 | private InterceptableViewGroup mContainer; 46 | //粒子效果绘制层 47 | private Box2dEffectView box2dEffectView; 48 | //Fragment 处于销毁过程中标志位 49 | private boolean m_isDestorying = false; 50 | //Fragment 处于OnStop标志位 51 | private boolean m_isStoping = false; 52 | //Screen 是否需要重建播放 53 | private boolean m_isNeedBuild = true; 54 | 55 | private WeakHandler mHandler = new WeakHandler(); 56 | //是否已被清除 57 | private boolean m_cleaned = false; 58 | 59 | PowerManager pm; 60 | 61 | public void preDestory() { 62 | m_isDestorying = true; 63 | box2dEffectView.setCanDraw(false); 64 | } 65 | 66 | @Nullable 67 | @Override 68 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 69 | 70 | m_viewRooter = inflater.inflate(R.layout.lf_layout_giftparticle, null); 71 | pm = (PowerManager) getActivity().getSystemService(Context.POWER_SERVICE); 72 | 73 | DisplayMetrics dm = getActivity().getApplicationContext().getResources().getDisplayMetrics(); 74 | s_scale = dm.density/4.0f; 75 | 76 | return m_viewRooter; 77 | } 78 | 79 | @Override 80 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 81 | super.onViewCreated(view, savedInstanceState); 82 | buildGDX(); 83 | } 84 | 85 | @Override 86 | public void onDestroyView() { 87 | super.onDestroyView(); 88 | box2dEffectView.release(); 89 | } 90 | 91 | @Override 92 | public void onConfigurationChanged(Configuration config) { 93 | super.onConfigurationChanged(config); 94 | 95 | cleanGDX(); 96 | buildGDX(); 97 | } 98 | 99 | public void addStar(boolean isLeft, boolean isSelf) { 100 | try { 101 | box2dEffectView.addStar(isLeft, isSelf); 102 | } catch (Exception e) { 103 | e.printStackTrace(); 104 | } 105 | } 106 | 107 | public void addGift(int index) { 108 | try { 109 | box2dEffectView.addGift(index); 110 | } catch (Exception e) { 111 | e.printStackTrace(); 112 | } 113 | } 114 | 115 | public void cleanGDX() { 116 | try { 117 | box2dEffectView.dispose(); 118 | }catch (Exception e){} 119 | mContainer.removeAllViews(); 120 | box2dEffectView = null; 121 | } 122 | 123 | public void buildGDX() { 124 | box2dEffectView = new Box2dEffectView(getActivity()); 125 | View effectview = CreateGLAlpha(box2dEffectView); 126 | mContainer = (InterceptableViewGroup) m_viewRooter.findViewById(R.id.container); 127 | mContainer.addView(effectview); 128 | Gdx.input.setInputProcessor(this); 129 | Gdx.input.setCatchBackKey(true); 130 | } 131 | 132 | public void openDebugRenderer(boolean open) { 133 | box2dEffectView.openDebugRenderer(open); 134 | } 135 | 136 | @Override 137 | public void onStart() { 138 | Log.d(TAG, "onStart"); 139 | 140 | box2dEffectView.setCanDraw(true); 141 | super.onStart(); 142 | 143 | } 144 | 145 | @Override 146 | public void onStop() { 147 | Log.d(TAG, "onStop"); 148 | 149 | box2dEffectView.setCanDraw(false); 150 | super.onStop(); 151 | } 152 | 153 | @Override 154 | public void onResume() { 155 | Log.d(TAG, "onResume"); 156 | try { 157 | super.onResume(); 158 | } catch (Exception e) { 159 | e.printStackTrace(); 160 | } 161 | } 162 | 163 | @Override 164 | public void onPause() { 165 | Log.d(TAG, "onPause"); 166 | 167 | try { 168 | super.onPause(); 169 | } catch (Exception e) { 170 | e.printStackTrace(); 171 | } 172 | 173 | if (mContainer != null && mContainer.getChildCount() <= 0) 174 | return; 175 | 176 | if (!m_isDestorying && !isScreenLock()) 177 | super.onResume(); 178 | } 179 | 180 | @TargetApi(Build.VERSION_CODES.HONEYCOMB) 181 | private View CreateGLAlpha(ApplicationListener application) { 182 | // GLSurfaceView透明相关 183 | AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); 184 | cfg.r = cfg.g = cfg.b = cfg.a = 8; 185 | 186 | View view = initializeForView(application, cfg); 187 | 188 | if (view instanceof SurfaceView) { 189 | GLSurfaceView glView = (GLSurfaceView) graphics.getView(); 190 | glView.getHolder().setFormat(PixelFormat.TRANSLUCENT); 191 | glView.setZOrderMediaOverlay(true); 192 | glView.setZOrderOnTop(true); 193 | } 194 | 195 | return view; 196 | } 197 | 198 | @Override 199 | public boolean keyDown(int i) { 200 | if (i == Input.Keys.BACK) { 201 | Intent intent = new Intent(); 202 | intent.setAction(GiftParticleContants.BROADCAST_GIFTPARTICLE_BACKKEY); 203 | getActivity().sendBroadcast(intent); 204 | return true; 205 | } 206 | return false; 207 | } 208 | 209 | @Override 210 | public boolean keyUp(int i) { 211 | return false; 212 | } 213 | 214 | @Override 215 | public boolean keyTyped(char c) { 216 | return false; 217 | } 218 | 219 | @Override 220 | public boolean touchDown(int i, int i1, int i2, int i3) { 221 | return false; 222 | } 223 | 224 | @Override 225 | public boolean touchUp(int i, int i1, int i2, int i3) { 226 | return false; 227 | } 228 | 229 | @Override 230 | public boolean touchDragged(int i, int i1, int i2) { 231 | return false; 232 | } 233 | 234 | @Override 235 | public boolean mouseMoved(int i, int i1) { 236 | return false; 237 | } 238 | 239 | @Override 240 | public boolean scrolled(int i) { 241 | return false; 242 | } 243 | 244 | private boolean isScreenLock() { 245 | boolean isScreenOn = pm.isScreenOn();//如果为true,则表示屏幕“亮”了,否则屏幕“暗”了。 246 | // Log.d(TAG, "isScreenLock:" + !isScreenOn); 247 | return !isScreenOn; 248 | } 249 | } 250 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/box2d/Box2dSenserLogic.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.box2d; 2 | 3 | import android.content.Context; 4 | import android.hardware.Sensor; 5 | import android.hardware.SensorEvent; 6 | import android.hardware.SensorEventListener; 7 | import android.hardware.SensorManager; 8 | 9 | import com.badlogic.gdx.math.Vector2; 10 | import com.badlogic.gdx.physics.box2d.World; 11 | 12 | /** 13 | * @author AleXQ 14 | * @Date 15/12/26 15 | * @Description: 控制box2d 重力感应逻辑 16 | */ 17 | 18 | public class Box2dSenserLogic { 19 | private SensorEventListener sel; 20 | private SensorManager sm; 21 | private Sensor sensor; 22 | private boolean m_isPortrait = true; 23 | private final static String TAG = Box2dSenserLogic.class.getSimpleName(); 24 | private World m_world; 25 | 26 | 27 | public Box2dSenserLogic(final World world, Context context) { 28 | m_world = world; 29 | //获得重力感应硬件控制器 30 | sm = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE); 31 | sensor = sm.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); 32 | //添加重力感应侦听,并实现其方法, 33 | sel = new SensorEventListener() { 34 | public void onSensorChanged(SensorEvent se) { 35 | 36 | float x = se.values[SensorManager.DATA_X]; 37 | float y = se.values[SensorManager.DATA_Y]; 38 | // Log.d(TAG, "x:" + x + ",y:" + y); 39 | // float m = x*90f/9.8f; 40 | // Log.d(TAG, "m:" + m); 41 | 42 | float xSenser, ySenser; 43 | if (m_isPortrait) { 44 | xSenser = -5.0f * x; 45 | ySenser = (y >= -1) ? -30 : -y * 5.0f; 46 | 47 | if (y<-1){ 48 | xSenser = -1 * xSenser; 49 | ySenser = -1 * ySenser; 50 | } 51 | 52 | } 53 | else{ 54 | xSenser = 5.0f * y; 55 | ySenser = (x >= -1) ? -30 : -x * 5.0f; 56 | 57 | if (x<-1) { 58 | xSenser = -1 * xSenser; 59 | ySenser = -1 * ySenser; 60 | } 61 | } 62 | 63 | 64 | 65 | Vector2 vec2 = m_isPortrait ? new Vector2(xSenser, ySenser) : new Vector2(xSenser, ySenser); 66 | if (world != null) 67 | world.setGravity(vec2); 68 | } 69 | 70 | public void onAccuracyChanged(Sensor arg0, int arg1) { 71 | } 72 | }; 73 | 74 | } 75 | 76 | public void setIsPortrait(boolean isPortrait) { 77 | m_isPortrait = isPortrait; 78 | } 79 | 80 | public void release() { 81 | sm.unregisterListener(sel); 82 | } 83 | 84 | public void startListener() { 85 | sm.registerListener(sel, sensor, SensorManager.SENSOR_DELAY_NORMAL); 86 | } 87 | 88 | public void stopListener() { 89 | sm.unregisterListener(sel); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/box2d/Tools/GiftParticleContants.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.box2d.Tools; 2 | 3 | /** 4 | * @author AleXQ 5 | * @Date 15/11/19 6 | * @Description: 粒子特效相关常量 7 | */ 8 | 9 | public class GiftParticleContants { 10 | 11 | public static final int GIFT_PATHTYPE_EXTEND = 0;//外部存储器 12 | public static final int GIFT_PATHTYPE_INTER = 1;//assets 13 | 14 | public static final int GIFT_PARTICLETYPE_FIRE = 0;//爆炸 15 | public static final int GIFT_PARTICLETYPE_WATER_BOX1 = 1;//喷射 16 | public static final int GIFT_PARTICLETYPE_WATER_BOX2 = 2;//喷射 17 | public static final int GIFT_PARTICLETYPE_WATER_BOX3 = 3;//喷射 18 | public static final int GIFT_PARTICLETYPE_WATER_BOX4 = 4;//喷射 19 | 20 | public static final String BROADCAST_PARTICLE_OVER = "youku.laifeng.broadcast.particleover";//单个粒子效果播放完成 21 | public static final String BROADCAST_PARTICLE_BEGIN = "youku.laifeng.broadcast.particlebegin";//粒子效果播放begin 22 | 23 | public static final String BROADCAST_GIFTPARTICLE_BACKKEY = "youku.laifeng.broadcast.giftparticle.backkey"; 24 | 25 | public static final String GIFT_BASE = "xingmeng_gift_"; 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/box2d/Tools/ScreenParamUtil.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.box2d.Tools; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.util.DisplayMetrics; 6 | 7 | public class ScreenParamUtil { 8 | 9 | //Get pixels according to screen density 10 | public static int GetAdaptivePixels(final Context context, int orgPixels) { 11 | DisplayMetrics dm = new DisplayMetrics(); 12 | ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(dm); 13 | return (int)(orgPixels * dm.density + 0.5f); 14 | } 15 | 16 | //Get width of screen in px 17 | public static int GetScreenWidthPx(final Context context) { 18 | DisplayMetrics dm = new DisplayMetrics(); 19 | ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(dm); 20 | return dm.widthPixels; 21 | } 22 | 23 | //Get height of screen in px 24 | public static int GetScreenHeightPx(final Context context) { 25 | DisplayMetrics dm = new DisplayMetrics(); 26 | ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(dm); 27 | return dm.heightPixels; 28 | } 29 | 30 | public static int GetScreenWidthDp(final Context context){ 31 | return px2dip(context, GetScreenWidthPx(context)); 32 | } 33 | 34 | public static int GetScreenHeightDp(final Context context){ 35 | return px2dip(context, GetScreenHeightPx(context)); 36 | } 37 | 38 | 39 | public static int getItemCountPerline(final Context context, int itemWidth) { 40 | if(null == context) { 41 | return 1; 42 | } 43 | int screenWidth = ScreenParamUtil.GetScreenWidthPx(context); 44 | int itemWidth1 = itemWidth; 45 | return screenWidth / itemWidth1; 46 | } 47 | 48 | /** 49 | * 根据手机分辨率从dp转成px 50 | * @param context 51 | * @param dpValue 52 | * @return 53 | */ 54 | public static int dip2px(Context context, float dpValue) { 55 | final float scale = context.getResources().getDisplayMetrics().density; 56 | return (int) (dpValue * scale + 0.5f); 57 | } 58 | 59 | /** 60 | * 根据手机的分辨率从 px(像素) 的单位 转成为 dp 61 | */ 62 | public static int px2dip(Context context, float pxValue) { 63 | final float scale = context.getResources().getDisplayMetrics().density; 64 | return (int) (pxValue / scale + 0.5f)-15; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/box2d/Tools/Transform.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.box2d.Tools; 2 | 3 | /** 4 | * @author AleXQ 5 | * @Date 15/12/26 6 | * @Description: 7 | */ 8 | 9 | 10 | import com.badlogic.gdx.Gdx; 11 | import com.badlogic.gdx.math.Vector2; 12 | 13 | /** 14 | * Created by alex_xq on 15/6/19. 15 | */ 16 | public class Transform { 17 | /** 18 | * @param x_px 图片所在x坐标 19 | * @param y_px 图片所在y坐标 20 | * @param width_px 图片宽度 21 | * @param height_px 图片高度 22 | * @param scale 缩放比例 23 | * @return (x,y)直接设置为body的position可使body与图片重合 24 | */ 25 | public static Vector2 ptm(float x_px, float y_px, float width_px, float height_px, float scale){ 26 | float screenWidth = Gdx.graphics.getWidth(); 27 | float screenHeight = Gdx.graphics.getHeight(); 28 | Vector2 vector2 = new Vector2(); 29 | vector2.x = -(screenWidth - x_px * 2 - width_px) / scale / 2; 30 | vector2.y = -(screenHeight - y_px * 2 - height_px) / scale / 2; 31 | return vector2; 32 | } 33 | 34 | /** 35 | * @param x_m body所在x坐标 36 | * @param y_m body所在y坐标 37 | * @param wh (x,y)body的宽高 38 | * @param scale 缩放比例 39 | * @return (x,y)直接设置为图片的position可使图片与body重合 40 | */ 41 | public static Vector2 mtp(float x_m, float y_m, Vector2 wh, float scale){ 42 | float screenWidth = Gdx.graphics.getWidth(); 43 | float screenHeight = Gdx.graphics.getHeight(); 44 | Vector2 vector2 = new Vector2(); 45 | vector2.x = x_m * scale + screenWidth / 2 - wh.x * scale; 46 | vector2.y = y_m * scale + screenHeight / 2 - wh.y * scale; 47 | return vector2; 48 | } 49 | } -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/fireworks/GiftParticleContants.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.fireworks; 2 | 3 | /** 4 | * @author AleXQ 5 | * @Date 15/11/19 6 | * @Description: 粒子特效相关常量 7 | */ 8 | 9 | public class GiftParticleContants { 10 | 11 | public static final int GIFT_PATHTYPE_EXTEND = 0;//外部存储器 12 | public static final int GIFT_PATHTYPE_INTER = 1;//assets 13 | 14 | public static final int GIFT_PARTICLETYPE_FIRE = 0;//爆炸 15 | public static final int GIFT_PARTICLETYPE_WATER_BOX1 = 1;//喷射 16 | public static final int GIFT_PARTICLETYPE_WATER_BOX2 = 2;//喷射 17 | public static final int GIFT_PARTICLETYPE_WATER_BOX3 = 3;//喷射 18 | public static final int GIFT_PARTICLETYPE_WATER_BOX4 = 4;//喷射 19 | 20 | public static final String BROADCAST_PARTICLE_OVER = "youku.laifeng.broadcast.particleover";//单个粒子效果播放完成 21 | public static final String BROADCAST_PARTICLE_BEGIN = "youku.laifeng.broadcast.particlebegin";//粒子效果播放begin 22 | 23 | public static final String BROADCAST_GIFTPARTICLE_BACKKEY = "youku.laifeng.broadcast.giftparticle.backkey"; 24 | 25 | public static final String GIFT_BASE = ""; 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/fireworks/GiftParticleFragment.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.fireworks; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.res.Configuration; 7 | import android.graphics.PixelFormat; 8 | import android.opengl.GLSurfaceView; 9 | import android.os.Build; 10 | import android.os.Bundle; 11 | import android.os.PowerManager; 12 | import android.support.annotation.Nullable; 13 | import android.util.Log; 14 | import android.view.LayoutInflater; 15 | import android.view.SurfaceView; 16 | import android.view.View; 17 | import android.view.ViewGroup; 18 | 19 | import com.badlogic.gdx.ApplicationListener; 20 | import com.badlogic.gdx.Gdx; 21 | import com.badlogic.gdx.Input; 22 | import com.badlogic.gdx.InputProcessor; 23 | import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; 24 | import com.badlogic.gdx.backends.android.AndroidFragmentApplication; 25 | import com.badoo.mobile.util.WeakHandler; 26 | 27 | import alex.com.gdxdemo.R; 28 | import alex.com.gdxdemo.base.InterceptableViewGroup; 29 | 30 | 31 | /** 32 | * Created by alex_xq on 15/6/11. 33 | */ 34 | @SuppressWarnings("All") 35 | public class GiftParticleFragment extends AndroidFragmentApplication implements InputProcessor { 36 | 37 | private static final String TAG = "GiftParticleFragment"; 38 | private View m_viewRooter = null; 39 | //粒子效果UI容器层 40 | private InterceptableViewGroup mContainer; 41 | //粒子效果绘制层 42 | private GiftParticleEffectView particleEffectView; 43 | //Fragment 处于销毁过程中标志位 44 | private boolean m_isDestorying = false; 45 | //Fragment 处于OnStop标志位 46 | private boolean m_isStoping = false; 47 | //Screen 是否需要重建播放 48 | private boolean m_isNeedBuild =true; 49 | 50 | private WeakHandler m_WeakHandler = new WeakHandler(); 51 | 52 | public void PlayAdd(int pathtype, String pathstring, int paticletype, int dur) { 53 | 54 | if (m_isStoping || isScreenLock()) 55 | return; 56 | 57 | if (pathstring == null) 58 | return; 59 | if (pathstring.equals("")) 60 | return; 61 | 62 | boolean isLand = (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) ? true : false; 63 | 64 | switch (paticletype) { 65 | case GiftParticleContants.GIFT_PARTICLETYPE_FIRE: 66 | particleEffectView.Add(pathstring, 67 | dur, 68 | GiftParticleEffectView.ParticleType.PARTICLE_TYPE_FIRE, 69 | GiftParticleEffectView.ParticleAnimationType.ANIMATION_TYPE_NULL, 70 | isLand); 71 | 72 | m_WeakHandler.postDelayed(new Runnable() { 73 | @Override 74 | public void run() { 75 | Intent intent = new Intent(); 76 | intent.setAction(GiftParticleContants.BROADCAST_PARTICLE_OVER); 77 | getActivity().sendBroadcast(intent); 78 | } 79 | }, 400); 80 | 81 | 82 | break; 83 | case GiftParticleContants.GIFT_PARTICLETYPE_WATER_BOX1: 84 | 85 | particleEffectView.Add(pathstring, 86 | dur, 87 | GiftParticleEffectView.ParticleType.PARTICLE_TYPE_WATER, 88 | GiftParticleEffectView.ParticleAnimationType.ANIMATION_TYPE_BOX1, 89 | isLand); 90 | 91 | break; 92 | case GiftParticleContants.GIFT_PARTICLETYPE_WATER_BOX2: 93 | 94 | particleEffectView.Add(pathstring, 95 | dur, 96 | GiftParticleEffectView.ParticleType.PARTICLE_TYPE_WATER, 97 | GiftParticleEffectView.ParticleAnimationType.ANIMATION_TYPE_BOX2, 98 | isLand); 99 | 100 | break; 101 | case GiftParticleContants.GIFT_PARTICLETYPE_WATER_BOX3: 102 | 103 | particleEffectView.Add(pathstring, 104 | dur, 105 | GiftParticleEffectView.ParticleType.PARTICLE_TYPE_WATER, 106 | GiftParticleEffectView.ParticleAnimationType.ANIMATION_TYPE_BOX3, 107 | isLand); 108 | 109 | break; 110 | 111 | case GiftParticleContants.GIFT_PARTICLETYPE_WATER_BOX4: 112 | 113 | particleEffectView.Add(pathstring, 114 | dur, 115 | GiftParticleEffectView.ParticleType.PARTICLE_TYPE_WATER, 116 | GiftParticleEffectView.ParticleAnimationType.ANIMATION_TYPE_BOX4, 117 | isLand); 118 | 119 | break; 120 | } 121 | 122 | particleEffectView.setOnStateListener(new GiftParticleEffectView.OnStateListener() { 123 | @Override 124 | public void OnBegin(GiftParticleEffectView.ParticleAnimationType type) { 125 | 126 | Intent intentbegin = new Intent(); 127 | intentbegin.setAction(GiftParticleContants.BROADCAST_PARTICLE_BEGIN); 128 | getActivity().sendBroadcast(intentbegin); 129 | 130 | } 131 | 132 | @Override 133 | public void OnFinish(GiftParticleEffectView.ParticleAnimationType type) { 134 | 135 | final GiftParticleEffectView.ParticleAnimationType curType = type; 136 | 137 | if (curType != GiftParticleEffectView.ParticleAnimationType.ANIMATION_TYPE_NULL) { 138 | Intent intent = new Intent(); 139 | intent.setAction(GiftParticleContants.BROADCAST_PARTICLE_OVER); 140 | getActivity().sendBroadcast(intent); 141 | } 142 | 143 | 144 | } 145 | }); 146 | } 147 | 148 | public void preDestory(){ 149 | m_isDestorying = true; 150 | m_isStoping = true; 151 | particleEffectView.setCanDraw(false); 152 | } 153 | 154 | @Nullable 155 | @Override 156 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 157 | 158 | m_viewRooter = inflater.inflate(R.layout.lf_layout_giftparticle, null); 159 | return m_viewRooter; 160 | } 161 | 162 | @Override 163 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 164 | super.onViewCreated(view, savedInstanceState); 165 | buildGDX(); 166 | } 167 | 168 | public void cleanGDX(){ 169 | try { 170 | particleEffectView.dispose(); 171 | }catch (Exception e){} 172 | mContainer.removeAllViews(); 173 | particleEffectView = null; 174 | } 175 | 176 | public void buildGDX(){ 177 | 178 | particleEffectView = new GiftParticleEffectView(); 179 | View effectview = CreateGLAlpha(particleEffectView); 180 | mContainer = (InterceptableViewGroup) m_viewRooter.findViewById(R.id.container); 181 | mContainer.setIntercept(true); 182 | mContainer.addView(effectview); 183 | Gdx.input.setInputProcessor(this); 184 | Gdx.input.setCatchBackKey(true); 185 | } 186 | 187 | @Override 188 | public void onStart() { 189 | Log.d(TAG, "onStart"); 190 | m_isStoping = false; 191 | super.onStart(); 192 | 193 | particleEffectView.setCanDraw(true); 194 | // if (m_isNeedBuild) 195 | // buildGDX(); 196 | // isScreenLock(); 197 | } 198 | 199 | @Override 200 | public void onStop() { 201 | Log.d(TAG, "onStop"); 202 | m_isStoping = true; 203 | // if (!isScreenLock()) { 204 | // mContainer.removeAllViews(); 205 | // m_isNeedBuild = true; 206 | // } 207 | // else 208 | // { 209 | // m_isNeedBuild = false; 210 | // } 211 | particleEffectView.setCanDraw(false); 212 | super.onStop(); 213 | } 214 | 215 | @Override 216 | public void onResume() { 217 | Log.d(TAG, "onResume"); 218 | super.onResume(); 219 | } 220 | 221 | @Override 222 | public void onPause() { 223 | Log.d(TAG, "onPause"); 224 | super.onPause(); 225 | if (!m_isDestorying && !isScreenLock()) 226 | super.onResume(); 227 | } 228 | 229 | @Override 230 | public void onConfigurationChanged(Configuration config) { 231 | super.onConfigurationChanged(config); 232 | 233 | mContainer.removeAllViews(); 234 | buildGDX(); 235 | } 236 | 237 | @TargetApi(Build.VERSION_CODES.HONEYCOMB) 238 | private View CreateGLAlpha(ApplicationListener application) { 239 | // GLSurfaceView透明相关 240 | AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); 241 | cfg.r = cfg.g = cfg.b = cfg.a = 8; 242 | 243 | View view = initializeForView(application, cfg); 244 | 245 | if (view instanceof SurfaceView) { 246 | GLSurfaceView glView = (GLSurfaceView) graphics.getView(); 247 | glView.getHolder().setFormat(PixelFormat.TRANSLUCENT); 248 | glView.setZOrderMediaOverlay(true); 249 | glView.setZOrderOnTop(true); 250 | } 251 | 252 | return view; 253 | } 254 | 255 | @Override 256 | public boolean keyDown(int i) { 257 | if (i == Input.Keys.BACK) { 258 | Intent intent = new Intent(); 259 | intent.setAction(GiftParticleContants.BROADCAST_GIFTPARTICLE_BACKKEY); 260 | getActivity().sendBroadcast(intent); 261 | return true; 262 | } 263 | return false; 264 | } 265 | 266 | @Override 267 | public boolean keyUp(int i) { 268 | return false; 269 | } 270 | 271 | @Override 272 | public boolean keyTyped(char c) { 273 | return false; 274 | } 275 | 276 | @Override 277 | public boolean touchDown(int i, int i1, int i2, int i3) { 278 | return false; 279 | } 280 | 281 | @Override 282 | public boolean touchUp(int i, int i1, int i2, int i3) { 283 | return false; 284 | } 285 | 286 | @Override 287 | public boolean touchDragged(int i, int i1, int i2) { 288 | return false; 289 | } 290 | 291 | @Override 292 | public boolean mouseMoved(int i, int i1) { 293 | return false; 294 | } 295 | 296 | @Override 297 | public boolean scrolled(int i) { 298 | return false; 299 | } 300 | 301 | private boolean isScreenLock(){ 302 | try { 303 | PowerManager pm = (PowerManager) getActivity().getSystemService(Context.POWER_SERVICE); 304 | boolean isScreenOn = pm.isScreenOn();//如果为true,则表示屏幕“亮”了,否则屏幕“暗”了。 305 | Log.d(TAG, "isScreenLock:" + !isScreenOn); 306 | return !isScreenOn; 307 | }catch (Exception e){ 308 | e.printStackTrace(); 309 | return false; 310 | } 311 | } 312 | } 313 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/spine/LibgdxSpineEffectView.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.spine; 2 | 3 | import android.util.Log; 4 | 5 | import com.badlogic.gdx.ApplicationListener; 6 | import com.badlogic.gdx.Gdx; 7 | import com.badlogic.gdx.assets.AssetManager; 8 | import com.badlogic.gdx.graphics.GL20; 9 | import com.badlogic.gdx.graphics.OrthographicCamera; 10 | import com.badlogic.gdx.graphics.g2d.SpriteBatch; 11 | import com.badlogic.gdx.graphics.g2d.TextureAtlas; 12 | import com.esotericsoftware.spine.AnimationState; 13 | import com.esotericsoftware.spine.AnimationStateData; 14 | import com.esotericsoftware.spine.Skeleton; 15 | import com.esotericsoftware.spine.SkeletonBounds; 16 | import com.esotericsoftware.spine.SkeletonData; 17 | import com.esotericsoftware.spine.SkeletonJson; 18 | import com.esotericsoftware.spine.SkeletonRenderer; 19 | import com.esotericsoftware.spine.SkeletonRendererDebug; 20 | 21 | /** 22 | * Created by QJoy on 2017.12.25. 23 | */ 24 | @SuppressWarnings("All") 25 | public class LibgdxSpineEffectView implements ApplicationListener { 26 | 27 | public static boolean openDEBUGLog = false; 28 | private static final String TAG = LibgdxSpineEffectView.class.getSimpleName(); 29 | 30 | //基础绘制资源 31 | SpriteBatch mBatch; 32 | 33 | // Asset资源加载管理 34 | AssetManager mAssetManager = new AssetManager(); 35 | 36 | int mWidth = 0; 37 | 38 | private boolean forceOver = false; 39 | 40 | private boolean mIsLand = false; 41 | 42 | private boolean m_candraw = true; 43 | 44 | private volatile boolean loadingAnimate = true; 45 | 46 | OrthographicCamera camera; 47 | SpriteBatch batch; 48 | SkeletonRenderer renderer; 49 | SkeletonRendererDebug debugRenderer; 50 | 51 | TextureAtlas atlas; 52 | Skeleton skeleton; 53 | SkeletonBounds bounds; 54 | AnimationState state; 55 | 56 | 57 | public void forceOver() { 58 | 59 | if (openDEBUGLog) 60 | Log.d(TAG, "forceOver"); 61 | 62 | forceOver = true; 63 | 64 | // 缓冲50ms,解决退出时绘制闪动的问题 65 | try { 66 | Thread.sleep(50); 67 | } catch (InterruptedException e) { 68 | e.printStackTrace(); 69 | } 70 | } 71 | 72 | public void closeforceOver() { 73 | 74 | if (openDEBUGLog) 75 | Log.d(TAG, "closeforceOver"); 76 | 77 | forceOver = false; 78 | 79 | try { 80 | Thread.sleep(50); 81 | } catch (InterruptedException e) { 82 | e.printStackTrace(); 83 | } 84 | } 85 | 86 | public void setAction(String actionName){ 87 | try { 88 | switch (actionName) { 89 | case "run": 90 | state.setAnimation(0, "run", true); 91 | break; 92 | case "walk": 93 | state.setAnimation(0, "walk", true); 94 | break; 95 | case "jump": 96 | state.setAnimation(0, "jump", false); 97 | state.addAnimation(0, "run", true, 0); 98 | break; 99 | } 100 | } 101 | catch (Exception e){ 102 | e.printStackTrace(); 103 | } 104 | } 105 | 106 | @Override 107 | public void create() { 108 | 109 | if (openDEBUGLog) 110 | Log.d(TAG, "create"); 111 | 112 | mBatch = new SpriteBatch(); 113 | 114 | mWidth = Gdx.graphics.getWidth() > Gdx.graphics.getHeight() ? Gdx.graphics.getHeight() : Gdx.graphics.getWidth(); 115 | 116 | //放置 init 方法 117 | 118 | camera = new OrthographicCamera(); 119 | batch = new SpriteBatch(); 120 | renderer = new SkeletonRenderer(); 121 | renderer.setPremultipliedAlpha(true); // PMA results in correct blending without outlines. 122 | debugRenderer = new SkeletonRendererDebug(); 123 | debugRenderer.setBoundingBoxes(false); 124 | debugRenderer.setRegionAttachments(false); 125 | 126 | /* 127 | * libgdx资源加载必须在create所在线程执行,如果此步骤耗时过程可以考虑使用AssetManager的方式加载 128 | * */ 129 | atlas = new TextureAtlas(Gdx.files.internal("spineboy/spineboy-pma.atlas")); 130 | /* 131 | * spine动画加载数据过大,耗时过长,可以移动到子线程中执行 132 | * */ 133 | new Thread(new Runnable() { 134 | @Override 135 | public void run() { 136 | 137 | SkeletonJson json = new SkeletonJson(atlas); // This loads skeleton JSON data, which is stateless. 138 | json.setScale(0.6f); // Load the skeleton at 60% the size it was in Spine. 139 | SkeletonData skeletonData = json.readSkeletonData(Gdx.files.internal("spineboy/spineboy-ess.json")); 140 | skeleton = new Skeleton(skeletonData); // Skeleton holds skeleton state (bone positions, slot attachments, etc). 141 | skeleton.setPosition(mWidth/2, 20); 142 | 143 | AnimationStateData stateData = new AnimationStateData(skeletonData); // Defines mixing (crossfading) between animations. 144 | stateData.setMix("run", "jump", 0.2f); 145 | stateData.setMix("jump", "run", 0.2f); 146 | 147 | stateData.setMix("run","walk",1f); 148 | stateData.setMix("walk","run",1f); 149 | 150 | state = new AnimationState(stateData); // Holds the animation state for a skeleton (current animation, time, etc). 151 | state.setTimeScale(1.0f); // Slow all animations down to 50% speed. 152 | 153 | // Queue animations on track 0. 154 | state.setAnimation(0, "idle", true); 155 | 156 | loadingAnimate = false; 157 | } 158 | }).start(); 159 | 160 | } 161 | 162 | @Override 163 | public void resize(int i, int i2) { 164 | camera.setToOrtho(false); // Update camera with new size. 165 | } 166 | 167 | public void setCanDraw(boolean candraw) { 168 | 169 | if (openDEBUGLog) 170 | Log.d(TAG, "setCanDraw:"+candraw); 171 | 172 | m_candraw = candraw; 173 | 174 | if (!m_candraw) { 175 | // 放置不可见时手动销毁的内容 176 | return; 177 | } 178 | } 179 | 180 | @Override 181 | public void render() { 182 | 183 | Gdx.gl.glClearColor(0, 0, 0, 0); 184 | Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); 185 | 186 | if (forceOver) 187 | return; 188 | 189 | if (!m_candraw) { 190 | // 放置不可见时手动销毁的内容 191 | return; 192 | } 193 | 194 | if (loadingAnimate) 195 | return; 196 | 197 | // 放置动画逻辑 198 | state.update(Gdx.graphics.getDeltaTime()); // Update the animation time. 199 | 200 | Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); 201 | 202 | state.apply(skeleton); // Poses skeleton using current animations. This sets the bones' local SRT. 203 | skeleton.updateWorldTransform(); // Uses the bones' local SRT to compute their world SRT. 204 | 205 | // Configure the camera, SpriteBatch, and SkeletonRendererDebug. 206 | camera.update(); 207 | batch.getProjectionMatrix().set(camera.combined); 208 | debugRenderer.getShapeRenderer().setProjectionMatrix(camera.combined); 209 | 210 | batch.begin(); 211 | renderer.draw(batch, skeleton); // Draw the skeleton images. 212 | batch.end(); 213 | 214 | // debugRenderer.draw(skeleton); // Draw debug lines. 215 | 216 | } 217 | 218 | @Override 219 | public void pause() { 220 | 221 | } 222 | 223 | @Override 224 | public void resume() { 225 | 226 | } 227 | 228 | @Override 229 | public void dispose() { 230 | 231 | if (openDEBUGLog) 232 | Log.d(TAG, "dispose"); 233 | 234 | mBatch.dispose(); 235 | 236 | //遍历释放所有资源 237 | atlas.dispose(); 238 | } 239 | } 240 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/spine/LibgdxSpineFragment.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.spine; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.content.res.Configuration; 7 | import android.graphics.PixelFormat; 8 | import android.opengl.GLSurfaceView; 9 | import android.os.Build; 10 | import android.os.Bundle; 11 | import android.os.PowerManager; 12 | import android.support.annotation.Nullable; 13 | import android.util.Log; 14 | import android.view.LayoutInflater; 15 | import android.view.SurfaceView; 16 | import android.view.View; 17 | import android.view.ViewGroup; 18 | 19 | import com.badlogic.gdx.ApplicationListener; 20 | import com.badlogic.gdx.Gdx; 21 | import com.badlogic.gdx.Input; 22 | import com.badlogic.gdx.InputProcessor; 23 | import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; 24 | import com.badlogic.gdx.backends.android.AndroidFragmentApplication; 25 | import com.badoo.mobile.util.WeakHandler; 26 | 27 | import alex.com.gdxdemo.R; 28 | import alex.com.gdxdemo.base.InterceptableViewGroup; 29 | import alex.com.gdxdemo.fireworks.GiftParticleContants; 30 | 31 | 32 | /** 33 | * Created by QJoy on 2017.12.25. 34 | */ 35 | @SuppressWarnings("All") 36 | public class LibgdxSpineFragment extends AndroidFragmentApplication implements InputProcessor { 37 | 38 | public static boolean openDEBUGLog = false; 39 | private static final String TAG = LibgdxSpineFragment.class.getSimpleName(); 40 | private View m_viewRooter = null; 41 | //粒子效果UI容器层 42 | private InterceptableViewGroup mContainer; 43 | //粒子效果绘制层 44 | private LibgdxSpineEffectView spineEffectView; 45 | //Fragment 处于销毁过程中标志位 46 | private boolean m_isDestorying = false; 47 | //Fragment 处于OnStop标志位 48 | private boolean m_isStoping = false; 49 | //Screen 是否需要重建播放 50 | private boolean m_isNeedBuild =true; 51 | 52 | private boolean m_hasBuilt = false; 53 | 54 | private WeakHandler m_WeakHandler = new WeakHandler(); 55 | 56 | public void setAction(String actionName){ 57 | if (spineEffectView != null) 58 | spineEffectView.setAction(actionName); 59 | } 60 | 61 | public void preDestory(){ 62 | 63 | if (openDEBUGLog) 64 | Log.d(TAG, "preDestory"); 65 | 66 | if (!m_hasBuilt) 67 | return; 68 | 69 | spineEffectView.forceOver(); 70 | spineEffectView.setCanDraw(false); 71 | 72 | m_isDestorying = true; 73 | m_isStoping = true; 74 | } 75 | 76 | @Nullable 77 | @Override 78 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 79 | 80 | if (openDEBUGLog) 81 | Log.d(TAG, "onCreateView"); 82 | 83 | m_viewRooter = inflater.inflate(R.layout.lf_layout_giftparticle, null); 84 | return m_viewRooter; 85 | } 86 | 87 | @Override 88 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { 89 | 90 | if (openDEBUGLog) 91 | Log.d(TAG, "onViewCreated"); 92 | 93 | super.onViewCreated(view, savedInstanceState); 94 | buildGDX(); 95 | } 96 | 97 | public void buildGDX(){ 98 | 99 | if (openDEBUGLog) 100 | Log.d(TAG, "buildGDX"); 101 | 102 | spineEffectView = new LibgdxSpineEffectView(); 103 | View effectview = CreateGLAlpha(spineEffectView); 104 | mContainer = (InterceptableViewGroup) m_viewRooter.findViewById(R.id.container); 105 | mContainer.addView(effectview); 106 | mContainer.setIntercept(true); 107 | Gdx.input.setInputProcessor(this); 108 | Gdx.input.setCatchBackKey(true); 109 | m_hasBuilt = true; 110 | } 111 | 112 | @Override 113 | public void onStart() { 114 | 115 | if (openDEBUGLog) 116 | Log.d(TAG, "onStart"); 117 | 118 | m_isStoping = false; 119 | super.onStart(); 120 | 121 | if (spineEffectView != null) 122 | spineEffectView.setCanDraw(true); 123 | } 124 | 125 | @Override 126 | public void onStop() { 127 | 128 | if (openDEBUGLog) 129 | Log.d(TAG, "onStop"); 130 | 131 | m_isStoping = true; 132 | spineEffectView.setCanDraw(false); 133 | super.onStop(); 134 | } 135 | 136 | @Override 137 | public void onResume() { 138 | 139 | if (openDEBUGLog) 140 | Log.d(TAG, "onResume"); 141 | 142 | super.onResume(); 143 | 144 | if (spineEffectView != null) { 145 | spineEffectView.closeforceOver(); 146 | } 147 | } 148 | 149 | @Override 150 | public void onPause() { 151 | 152 | if (openDEBUGLog) 153 | Log.d(TAG, "onPause"); 154 | 155 | if (spineEffectView != null) { 156 | spineEffectView.forceOver(); 157 | } 158 | 159 | super.onPause(); 160 | } 161 | 162 | @Override 163 | public void onConfigurationChanged(Configuration config) { 164 | 165 | if (openDEBUGLog) 166 | Log.d(TAG, "onConfigurationChanged"); 167 | 168 | super.onConfigurationChanged(config); 169 | 170 | mContainer.removeAllViews(); 171 | buildGDX(); 172 | } 173 | 174 | @TargetApi(Build.VERSION_CODES.HONEYCOMB) 175 | private View CreateGLAlpha(ApplicationListener application) { 176 | 177 | if (openDEBUGLog) 178 | Log.d(TAG, "CreateGLAlpha"); 179 | 180 | // GLSurfaceView透明相关 181 | AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); 182 | cfg.r = cfg.g = cfg.b = cfg.a = 8; 183 | 184 | View view = initializeForView(application, cfg); 185 | 186 | if (view instanceof SurfaceView) { 187 | GLSurfaceView glView = (GLSurfaceView) graphics.getView(); 188 | glView.getHolder().setFormat(PixelFormat.TRANSLUCENT); 189 | glView.setZOrderMediaOverlay(true); 190 | glView.setZOrderOnTop(true); 191 | } 192 | 193 | return view; 194 | } 195 | 196 | @Override 197 | public boolean keyDown(int i) { 198 | 199 | if (openDEBUGLog) 200 | Log.d(TAG, "CreateGLAlpha"); 201 | 202 | if (i == Input.Keys.BACK) { 203 | Intent intent = new Intent(); 204 | intent.setAction(GiftParticleContants.BROADCAST_GIFTPARTICLE_BACKKEY); 205 | if (getActivity() != null) 206 | getActivity().sendBroadcast(intent); 207 | return true; 208 | } 209 | return false; 210 | } 211 | 212 | @Override 213 | public boolean keyUp(int i) { 214 | return false; 215 | } 216 | 217 | @Override 218 | public boolean keyTyped(char c) { 219 | return false; 220 | } 221 | 222 | @Override 223 | public boolean touchDown(int i, int i1, int i2, int i3) { 224 | return false; 225 | } 226 | 227 | @Override 228 | public boolean touchUp(int i, int i1, int i2, int i3) { 229 | return false; 230 | } 231 | 232 | @Override 233 | public boolean touchDragged(int i, int i1, int i2) { 234 | return false; 235 | } 236 | 237 | @Override 238 | public boolean mouseMoved(int i, int i1) { 239 | return false; 240 | } 241 | 242 | @Override 243 | public boolean scrolled(int i) { 244 | return false; 245 | } 246 | 247 | private boolean isScreenLock(){ 248 | try { 249 | PowerManager pm = (PowerManager) getActivity().getSystemService(Context.POWER_SERVICE); 250 | boolean isScreenOn = pm.isScreenOn();//如果为true,则表示屏幕“亮”了,否则屏幕“暗”了。 251 | return !isScreenOn; 252 | }catch (Exception e){ 253 | e.printStackTrace(); 254 | return false; 255 | } 256 | } 257 | } 258 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/testcode/HalfScreenActivity.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.testcode; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | 8 | import alex.com.gdxdemo.R; 9 | 10 | /** 11 | * @author AleXQ 12 | * @Date 15/12/5 13 | */ 14 | 15 | public class HalfScreenActivity extends Activity{ 16 | public static void launch(Context context){ 17 | Intent intent = new Intent(); 18 | intent.setClass(context, HalfScreenActivity.class); 19 | context.startActivity(intent); 20 | } 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(R.layout.layout_activity_dialogstyle); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/testcode/NormalActivity.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.testcode; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | 8 | import alex.com.gdxdemo.R; 9 | 10 | /** 11 | * @author AleXQ 12 | * @Date 15/12/4 13 | */ 14 | 15 | public class NormalActivity extends Activity { 16 | 17 | public static void launch(Context context){ 18 | Intent intent = new Intent(); 19 | intent.setClass(context, NormalActivity.class); 20 | context.startActivity(intent); 21 | } 22 | 23 | @Override 24 | protected void onCreate(Bundle savedInstanceState) { 25 | super.onCreate(savedInstanceState); 26 | setContentView(R.layout.layout_activity_normalscreen); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/testcode/SpringEffect.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.testcode; 2 | 3 | import android.os.Build; 4 | import android.view.MotionEvent; 5 | import android.view.SoundEffectConstants; 6 | import android.view.View; 7 | 8 | import com.facebook.rebound.SimpleSpringListener; 9 | import com.facebook.rebound.Spring; 10 | import com.facebook.rebound.SpringSystem; 11 | 12 | /** 13 | * Created by alex_xq on 14/12/31. 14 | */ 15 | public class SpringEffect { 16 | 17 | private static final String TAG = "SpringEffect"; 18 | 19 | /*** 20 | * down/up时展示spring效果,up成功时出发Runnable操作 21 | * 22 | * @param view 动画view对象 23 | * @param runnable invoke操作 24 | */ 25 | public static void doEffectSticky(final View view, final Runnable runnable) { 26 | 27 | if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { 28 | if (runnable != null) 29 | runnable.run(); 30 | } else { 31 | 32 | // Create a system to run the physics loop for a set of springs. 33 | SpringSystem springSystem = SpringSystem.create(); 34 | 35 | // Add a spring to the system. 36 | final Spring spring = springSystem.createSpring(); 37 | 38 | // Add a listener to observe the motion of the spring. 39 | spring.addListener(new SimpleSpringListener() { 40 | 41 | @Override 42 | public void onSpringUpdate(Spring spring) { 43 | // You can observe the updates in the spring 44 | // state by asking its current value in onSpringUpdate. 45 | float value = (float) spring.getCurrentValue(); 46 | float scale = 1f - (value * 0.2f); 47 | view.setScaleX(scale); 48 | view.setScaleY(scale); 49 | } 50 | 51 | 52 | }); 53 | 54 | view.setOnTouchListener(new View.OnTouchListener() { 55 | 56 | @Override 57 | public boolean onTouch(View v, MotionEvent event) { 58 | 59 | int key = event.getAction(); 60 | 61 | switch (key) { 62 | 63 | case MotionEvent.ACTION_DOWN: 64 | spring.setEndValue(1f); 65 | break; 66 | 67 | case MotionEvent.ACTION_UP: 68 | if (runnable != null) 69 | runnable.run(); 70 | spring.setEndValue(0f); 71 | view.playSoundEffect(SoundEffectConstants.CLICK); 72 | break; 73 | case MotionEvent.ACTION_CANCEL: 74 | spring.setEndValue(0f); 75 | break; 76 | 77 | case MotionEvent.ACTION_OUTSIDE: 78 | spring.setEndValue(0f); 79 | break; 80 | 81 | default: 82 | break; 83 | } 84 | return true; 85 | } 86 | }); 87 | } 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /app/src/main/java/alex/com/gdxdemo/testcode/utils.java: -------------------------------------------------------------------------------- 1 | package alex.com.gdxdemo.testcode; 2 | 3 | import java.io.Closeable; 4 | import java.io.File; 5 | import java.io.FileOutputStream; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.io.OutputStream; 9 | 10 | import alex.com.gdxdemo.MyApplication; 11 | 12 | /** 13 | * @author AleXQ 14 | * @Date 15/12/5 15 | */ 16 | 17 | public class utils { 18 | public static String getLineInfo() 19 | { 20 | StackTraceElement ste = new Throwable().getStackTrace()[1]; 21 | return ste.getFileName() + ": Line " + ste.getLineNumber(); 22 | } 23 | 24 | public static File copy(String asset, String path) { 25 | File destinationFile = null; 26 | InputStream in = null; 27 | OutputStream out = null; 28 | try { 29 | in = MyApplication.getInstance().getAssets().open(new File(asset).getPath()); 30 | destinationFile = new File(path); 31 | if (destinationFile.exists()) { 32 | destinationFile.delete(); 33 | } 34 | destinationFile.getParentFile().mkdirs(); 35 | out = new FileOutputStream(destinationFile); 36 | byte[] buffer = new byte[1024]; 37 | int nread = -1; 38 | while ((nread = in.read(buffer)) != -1) { 39 | out.write(buffer, 0, nread); 40 | } 41 | out.flush(); 42 | } catch (IOException e) { 43 | e.printStackTrace(); 44 | } finally { 45 | closeQuietly(in); 46 | closeQuietly(out); 47 | return destinationFile; 48 | } 49 | } 50 | 51 | private static void closeQuietly(Closeable c) { 52 | if (c != null) { 53 | try { 54 | c.close(); 55 | } catch (IOException e) { 56 | e.printStackTrace(); 57 | } finally { 58 | c = null; 59 | } 60 | } 61 | } 62 | 63 | public static int DpToPx(float x) { 64 | int result = 0; 65 | final float scale = MyApplication.getInstance().getResources().getDisplayMetrics().density; 66 | result = (int) (x * scale + 0.5f); 67 | return result; 68 | } 69 | 70 | public static int PxToDp(int x) { 71 | final float scale = MyApplication.getInstance().getResources().getDisplayMetrics().density; 72 | return (int) (x / scale + 0.5f); 73 | } 74 | } 75 | 76 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_edittext.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_edittext_focused.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_edittext_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/checkbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/interuptdashsharp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/particledashsharp.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/particlestylescrazymodebtnsharp.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/paticlestylebtnsharp.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/paticlestyleredbtnsharp.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/testbtnsharp.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/awesome_activity.xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/balloon_activity.xml: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 20 | 21 | 29 | 30 | 31 | 32 | 42 | 43 | 53 | 54 |