Advertisement
bytejourney

MyGdxGame - Admob Interstitial iOS libGDX Project

Sep 29th, 2022
998
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. package com.bytejourney.ios.interstitial;
  2.  
  3. import com.badlogic.gdx.ApplicationAdapter;
  4. import com.badlogic.gdx.Gdx;
  5. import com.badlogic.gdx.graphics.Texture;
  6. import com.badlogic.gdx.graphics.g2d.SpriteBatch;
  7. import com.badlogic.gdx.utils.ScreenUtils;
  8.  
  9. public class MyGdxGame extends ApplicationAdapter {
  10.     private final AdsController adsController;
  11.     SpriteBatch batch;
  12.     Texture img;
  13.  
  14.  
  15.     public MyGdxGame (AdsController adsController){
  16.         this.adsController = adsController;
  17.     }
  18.    
  19.     @Override
  20.     public void create () {
  21.         batch = new SpriteBatch();
  22.         img = new Texture("badlogic.jpg");
  23.     }
  24.  
  25.     @Override
  26.     public void render () {
  27.         ScreenUtils.clear(1, 0, 0, 1);
  28.         batch.begin();
  29.         batch.draw(img, 0, 0);
  30.         batch.end();
  31.         if(Gdx.input.justTouched()) if(adsController != null) adsController.loadInterstitial();
  32.  
  33.     }
  34.    
  35.     @Override
  36.     public void dispose () {
  37.         batch.dispose();
  38.         img.dispose();
  39.     }
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement