libgdx

Implementing AdMob Rewarded Video with LibGDX

£可爱£侵袭症+ 提交于 2019-12-11 04:12:43
问题 I am creating a game with LibGDX and wanted to put rewarded videos on it but I can't figure out how I do that. I have already displayed an admob banner with this tutorial: https://www.youtube.com/watch?v=cwAN4LMXo58 I have already seen this question but don't understand where to put this code: public void showVideoAd(){ runOnUiThread(new Runnable() { public void run() { if (mAd.isLoaded()) { mAd.show(); } else { loadRewardedVideoAd(); } } }); } public boolean hasVideoReward(){ return

LibGDX Generating a png from a model

筅森魡賤 提交于 2019-12-11 04:10:34
问题 The title pretty much say it all, I need to get a image from a Model is this posible? I searched for this and found nothing. Solution thanks to @retodaredevil FrameBuffer fbo = new FrameBuffer(Pixmap.Format.RGBA4444, screenWidth, screenHeight, true); ModelBatch batch = new ModelBatch(); fbo.begin(); // make fbo the current buffer Gdx.gl.glViewport(0, 0,screenWidth, screenHeight); Gdx.gl.glClear(GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT); batch.begin(camera); batch.render(instance,

Lib Gdx json serializationexception and missing no-arg constructor

别说谁变了你拦得住时间么 提交于 2019-12-11 04:06:21
问题 When trying to execute this piece of code: public void load(String filename) { FileHandle file = Gdx.files.external(filename + ".bim"); Json json = new Json(); String text = file.readString(); datamap.clear(); datamap = json.fromJson(HashMap.class, text); I get an error: Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: com.badlogic.gdx.utils.SerializationException: Class cannot be created (missing no-arg constructor): com.bvo.easyBim.Model.Cursor at com

Libgdx Melee Attack Collision Detection

China☆狼群 提交于 2019-12-11 04:03:22
问题 I have a 3D scene with 3D model instances; and I want to do collision detection. I'm currently following this tutorial (http://blog.xoppa.com/using-the-libgdx-3d-physics-bullet-wrapper-part1/). However, what I want is a bit more complicated. There's a character (a knight.g3db model that's part of the sample code from Libgdx basic 3d model class), and it can attack with a sword. I also have another model instance that I want to "attack" with the sword. Checking if the two objects for collision

libgdx/Android: graphics disappearing after the app is destroyed/paused

蓝咒 提交于 2019-12-11 03:57:15
问题 I was doing some tests and I realized that on my Nexus 5, when I hit the back key (or the home) - that is, when there's a change of context - and I go back to my game, the openGL context is lost. There are no textures anymore (they show as black) or skins for the UI (the buttons are white). I thought it was automanaged by libgdx automatically, right? So why is this happening? The way I'm creating the textures is via TextureAtlas , like TextureAtlas atlas; TextureRegion bg; atlas = new

Gdx-Pay check for purchases

前提是你 提交于 2019-12-11 03:49:43
问题 I've finished setting up my IAP system but I can't figure out how to check if the user actually owns/have purchased a certain product. Using Google IAP Billing for android I simply did: Purchase ITEM_1 = inventory.getPurchase(ITEM_1); if(ITEM_1 != null && verifyDeveloperPayload(ITEM_1)){ //Give user the product ITEM_1_BOUGHT = true; } I can't find an equivalent method for this in Gdx-Pay. 回答1: The PurchaseObserver has a method called: handleRestore(Transaction[] transactions) You can iterate

Rotation order for eulers getPitch(), getRoll(), getYaw() from Quaternion in libgdx?

柔情痞子 提交于 2019-12-11 03:41:10
问题 When transforming a quaternion to Euler Angles, usually there has to be a order in which the axes are rotated, like in this visualization. How does it work for libgdx? The Quaternion class has the functions getRoll(): Math.asin(MathUtils.clamp(2f * (w*x - z * y), -1f, 1f)) : (float)pole * MathUtils.PI * 0.5f;` getPitch(): Math.asin(MathUtils.clamp(2f * (w*x - z * y), -1f, 1f)) : (float)pole * MathUtils.PI * 0.5f;` getYaw(): ` MathUtils.atan2(2f * (y * w + x * z), 1f - 2f * (y * y + x * x)) :

how to add a library to the dependencies gradle of LIBGDX project

£可爱£侵袭症+ 提交于 2019-12-11 03:38:13
问题 All is in the question , I've tried all the answers I found in SO and others sites but with no luck , this is what I've tried so far : adding compile fileTree(dir: 'lib', include: '*.jar') to my build.gradle adding compile files('lib/tween-engine-api-sources.jar') to build.gradle the library I want to add is Tween engine . build.gradle file : buildscript { repositories { mavenCentral() maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { } } allprojects {

catchbackkey not working (libgdx) Android

旧巷老猫 提交于 2019-12-11 03:38:04
问题 I'm trying to use the back key on the android device to setscreens for my game..But it does'nt seem to work.. I read few posts online n did this... In the menuscreen if the backkey is pressed the app should exit..But no action is triggered...Even if i press the back key numerous no action is triggered... public class MenuScreen extends AbstractScreen implements InputProcessor { @Override public void show() { Gdx.input.setInputProcessor(this); Gdx.input.setCatchBackKey(true); Gdx.input

iOS app crashes at launch because of distribution profile? (libgdx + robovm)

故事扮演 提交于 2019-12-11 03:34:58
问题 My iOS app was rejected twice for submission for the same reason: crash at start. Given the logs I guess it comes from my provisioning profiles and sign identity. I am using Libgdx 1.5.x with RoboVM beta 4, with Eclipse When I build the app with no profile, it builds and runs fine on any simulator. With a developer profile, the app builds and runs fine on my test device. Everything is fine until I set iosSignIdentity and iosProvisioningProfile to distribution, there I am having the following