working on it ...

Filters

Explore Public Snippets

Sort by

Found 103 snippets matching: libgdx

    public by ronrihoo modified Sep 27, 2017  1538  4  7  2

    Setting the libGDX Table background color

    A quick and less custom way.
    /*
     * It costs less to use a TextureRegion; however, to simplify the example,
     * a whole separate Texture is used here.
     */
    
    Table table;
    Texture whiteTexture;
    Sprite bgSprite;
    
    public void setBackgroundColor(int red, int green, int blue, int alpha) {
      // keep a reference to the Texture, so that it can be disposed later
    	whiteTexture = new Texture(Gdx.files.internal("white_color_texture.png"));
    	bgSprite = new Sprite(whiteTexture);
    	bgSprite.setColor(red/255f, green/255f, blue/255f, alpha/255f);
    	table.setBackground(new SpriteDrawable(bgSprite));
    }
    
    // ...
    
    public void disposeTexture() {
    	whiteTexture.dispose();
    }
    
    /*
     * An example of what's meant by "white_color_texture.png":
     * https://github.com/ronrihoo/libGDX-Table-Background-Color/blob/master/white_color_texture.png
     */

    public by ronrihoo modified Sep 15, 2017  1510  5  7  1

    Example helper class for GDXFacebook

    This helper class simplifies the usage of GDXFacebook in libGDX games and apps. (This is a backup to https://github.com/ronrihoo/GDX-Facebook-API-Helper and it's used in https://stackoverflow.com/a/46230835/6664817)
    // add package here
    
    import com.badlogic.gdx.Application;
    import com.badlogic.gdx.Gdx;
    import com.badlogic.gdx.utils.Array;
    import de.tomgrill.gdxfacebook.core.*;
    
    public class FacebookApi {
    
        private final static String CLASS_NAME = FacebookApi.class.getSimpleName();
        private final static String ERR_IN = "Error: in " + CLASS_NAME;
        private final static String EXC_IN = "Exception: in " + CLASS_NAME;
    
        private final static boolean VERBOSE_DEFAULT = true;
        private final static boolean DEBUG_DEFAULT = true;
    
        private boolean verbose;
        private boolean debug;
    
        private Array<String> permissions;
    
        private GDXFacebookConfig config;
        private GDXFacebook facebook;
        private GDXFacebookAccessToken token;
    
        /* if there's a class where credentials are stored or retrieved from,
         * then a constructor like this one could be used
         */ /*
        public FacebookApi() {
            this(Credentials.FB_API_ID);
        }
        /**/
    
        public FacebookApi(String appId) {
            this(appId, null, null);
        }
    
        /**
         *
         * @param appId The Facebook API ID is required.
         * @param prefFilename Optional (example: ".facebookSessionData").
         * @param apiVersion Optional. Graph API Version (default: v2.6).
         */
        public FacebookApi(String appId, String prefFilename, String apiVersion) {
            init(appId, prefFilename, apiVersion, DEBUG_DEFAULT);
        }
    
        private void init(String appId, String prefFilename,
                          String apiVersion, boolean debug) {
            setVerbose(VERBOSE_DEFAULT);
            setDebug(debug);
            if (appId != null) {
                setAppId(appId);
            } else {
                try {
                    throw new RuntimeException(EXC_IN +
                            ".init(...): appId is null. Has it been passed correctly?");
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            if (prefFilename != null)
                setPrefFilename(prefFilename);
            if (apiVersion != null)
                setGraphApiVersion(apiVersion);
            initPermissionsArray();
            installGdxFacebookInstance();
            setGdxFacebookInstance();
            addBasicPermissions();
        }
    
        private void setGdxDebug(boolean debug) {
            debugLog("setGdxDebug(boolean debug)");
            if (debug)
                Gdx.app.setLogLevel(Application.LOG_DEBUG);
            // TODO: turn it off when debug == false
        }
    
        private void instantiateConfig() {
            debugLog("instantiateConfig()");
            config = new GDXFacebookConfig();
        }
    
        private boolean verifyConfig() {
            debugLog("verifyConfig()");
            if (config == null) {
                try {
                    instantiateConfig();
                }
                catch (Exception e) {
                    System.out.println(EXC_IN + ".verifyConfig(): \n" + e);
                    return false;
                }
            }
            return true;
        }
    
        private void setAppId(String appId) {
            debugLog("setAppId(String appId)");
            if (verifyConfig())
                config.APP_ID = appId;
        }
    
        private void setPrefFilename(String filename) {
            debugLog("setPrefFilename(String filename)");
            if (verifyConfig())
                config.PREF_FILENAME = filename;
        }
    
        private void setGraphApiVersion(String version) {
            debugLog("setGraphApiVersion(String version)");
            if (verifyConfig())
                config.GRAPH_API_VERSION = version;
        }
    
        private void installGdxFacebookInstance() {
            debugLog("installGdxFacebookInstance()");
            if (verifyConfig())
                facebook = GDXFacebookSystem.install(config);
        }
    
        /**
         * No parameters, as it is handled by GDXFacebookSystem
         */
        public void setGdxFacebookInstance() {
            debugLog("setGdxFacebookInstance()");
            if (facebook != null)
                facebook = GDXFacebookSystem.getFacebook();
        }
    
        /**
         *
         * @return GDXFacebook object.
         */
        public GDXFacebook getGdxFacebookInstance() {
            debugLog("getGdxFacebookInstance()");
            return facebook;
        }
    
        private void initPermissionsArray() {
            debugLog("initPermissionsArray()");
            permissions = new Array<String>();
        }
    
        private void addBasicPermissions() {
            debugLog("addBasicPermissions()");
            permissions.add("email");
            permissions.add("public_profile");
            permissions.add("user_friends");
        }
    
        public void addPermission(String permission) {
            debugLog("addPermission(String)");
            if (permissions != null)
                permissions.add(permission);
            else
                System.out.println(ERR_IN + ": permissions array is null");
        }
    
        /**
         * Basic sign-in with read-mode
         */
        public void signIn() {
            debugLog("signIn()");
            signIn(SignInMode.READ);
        }
    
        public void signIn(SignInMode signInMode) {
            debugLog("signIn(SignInMode)");
            if (facebook != null) {
                if (permissions == null) {
                    addBasicPermissions();
                    debug(CLASS_NAME +
                            ": returned to signIn(SignInMode) from addBasicPermissions()");
                }
                facebook.signIn(signInMode, permissions, new GDXFacebookCallback<SignInResult>() {
    
                    @Override
                    public void onSuccess(SignInResult result) {
                        if (verbose)
                            System.out.println("Successfully signed in Facebook.");
                        token = result.getAccessToken();
                        debug(CLASS_NAME + ".signIn() succeeded.");
                        debug(CLASS_NAME + ": accessToken is " + token);
                    }
    
                    @Override
                    public void onError(GDXFacebookError error) {
                        if (debug)
                            System.out.println(ERR_IN + ".signIn(): " +
                                    error.getErrorMessage());
                        debug("signIn() invoked by GDXFacebook instance, facebook, in " +
                                CLASS_NAME + " faced an error.");
                    }
    
                    @Override
                    public void onCancel() {
                        // When the user cancels the login process
                        debug("signIn() invoked by GDXFacebook instance, facebook, in " +
                                CLASS_NAME + " canceled.");
                    }
    
                    @Override
                    public void onFail(Throwable t) {
                        // When the login fails
                        debug("signIn() invoked by GDXFacebook instance, facebook, in " +
                                CLASS_NAME + " failed.");
                    }
                });
            } else {
                debug(ERR_IN + ".signIn(): " +
                        "GDXFacebook instance, facebook, is null.");
            }
        }
    
        public void signOut() {
            debug(CLASS_NAME + ".signOut()");
            facebook.signOut();
        }
    
        protected void setVerbose(boolean verbose) {
            this.verbose = verbose;
        }
    
        protected void setDebug(boolean debug) {
            this.debug = debug;
            setGdxDebug(debug);
        }
    
        private void debug(String msg) {
            if (debug)
                System.out.println(msg);
        }
    
        private void debugLog(String methodName) {
            if (verbose)
                debug(CLASS_NAME + "." + methodName);
        }
    
    }

    public by ronrihoo modified Sep 15, 2017  1604  1  7  1

    Example usage for the BackgroundColor class

    Companion usage example for the arbitrary libGDX Table BackgroundColor class.
    BackgroundColor backgroundColor = new BackgroundColor("white_color_texture.png");
    backgroundColor.setColor(2, 179, 228, 255); // r, g, b, a
    table.setBackground(backgroundColor);																														

    public by ronrihoo modified Oct 25, 2017  1367  0  6  1

    Getting the screen size with libGDX

    Along with some other screen analysis methods.
    import com.badlogic.gdx.Gdx;
    import java.lang.Math;
    
    
    public class ScreenDetails {
    
        // ...
    
        /**
         *
         * @return Total count of pixels (height * width).
         */
        private double getResolution() {
            return Gdx.graphics.getHeight() * Gdx.graphics.getWidth();
        }
    
        /**
         *
         * @return PPI (Pixels Per Inch).
         */
        private float getDensity() {
            return Gdx.graphics.getPpiX();
        }
    
        /**
         *
         * @return Horizontal pixel count, squared.
         */
        private double getWidthSquared() {
            return Math.pow(Gdx.graphics.getWidth(), 2);
        }
    
        /**
         *
         * @return Vertical pixel count, squared.
         */
        private double getHeightSquared() {
            return Math.pow(Gdx.graphics.getHeight(), 2);
        }
    
        /**
         *
         * @return Approximate screen size or size of app on screen (diameter in inches).
         */
        private double getScreenSize() {
            return (Math.sqrt(getWidthSquared() + getHeightSquared()) / getDensity());
        }
    
    }

    public by ronrihoo modified Sep 9, 2017  1911  40  7  3

    libGDX Table background color

    Create an instance of this class by giving the constructor the filename of a white PNG from your project resources. Then, use one of the instance's setColor(red, green, blue, alpha) methods. Finally, pass the instance to the libGDX Table using the Table's setBackground(Drawable drawable) method. This is not meant to be a perfect solution for all --
    import com.badlogic.gdx.Gdx;
    import com.badlogic.gdx.graphics.Color;
    import com.badlogic.gdx.graphics.Texture;
    import com.badlogic.gdx.graphics.g2d.Batch;
    import com.badlogic.gdx.graphics.g2d.Sprite;
    import com.badlogic.gdx.graphics.g2d.TextureRegion;
    import com.badlogic.gdx.scenes.scene2d.utils.Drawable;
    
    public class BackgroundColor implements Drawable {
    	
    	private Float x;
    	private Float y;
    	private Float width;
    	private Float height;
    	
    	private Boolean fillParent;
    	
    	private String filename;
    	private Texture texture;
    	private TextureRegion textureRegion;
    	private Sprite sprite;
    	private Color color;
    	
    	public BackgroundColor(String filename) {
    		this(filename, 0.0f, 0.0f, 0.0f, 0.0f);
    	}
    	
    	public BackgroundColor(String filename, float x, float y) {
    		this(filename, x, y, 0.0f, 0.0f);
    	}
    	
    	public BackgroundColor(String filename, float x, float y, float width, float height) {
    		this.setPosition(x, y);
    		this.setSize(width, height);
    		initialize(filename);
    	}
    	
    	private void initialize(String filename) {
    		setFilename(filename);
    		if (x == null || y == null)
    			setPosition();	// x = 0.0f; y = 0.0f;
    		if (width == null || height == null || width < 0.0f || height < 0.0f)
    			setSize();		// width = 0.0f; height = 0.0f;
    		if (color == null)
    			setColor(255, 255, 255, 255);
    		if (sprite == null) {
    			try {
    				setSprite();
    			} catch (Exception e) {
    				System.err.println(e);
    			}
    		}
    		if (fillParent == null)
    			fillParent = true;
    	}
    	
    	private void setTexture() {
    		if (texture != null)
    			texture.dispose();
    		texture = new Texture(Gdx.files.internal(getFilename()));
    	}
    	
    	private void setTextureRegion() {
    		textureRegion = new TextureRegion(texture, (int) getWidth(), (int) getHeight());
    	}
    	
    	private void setSprite() {
    		if (texture == null)
    			setTexture();
    		setTextureRegion();
    		sprite = new Sprite(textureRegion);
    		setSpriteColor();
    	}
    	
    	private void setSpriteColor() {
    		sprite.setColor(color.r, color.g, color.b, color.a);
    	}
    	
    	private void setPosition() {
    		this.x = 0.0f;
    		this.y = 0.0f;
    	}
    	
    	private void setPosition(float x, float y) {
    		this.x = x;
    		this.y = y;
    	}
    	
    	private void setSize() {
    		this.width = sprite.getWidth();
    		this.height = sprite.getHeight();
    	}
    	
    	private void setSize(float width, float height) {
    		this.width = width;
    		this.height = height;
    	}
    	
    	public void setColor(int r, int g, int b, int a) {
    		color = new Color(r/255f, g/255f, b/255f, a/255f);
    	}
    
    	public void setColor(float r, float g, float b, float a) {
    		color = new Color(r/255f, g/255f, b/255f, a/255f);
    	}
    	
    	private void setSpritePosition(float x, float y) {
    		sprite.setX(x);
    		sprite.setY(y);
    	}
    	
    	private void updateSprite(float x, float y, float width, float height) {
    		if (fillParent) {
    			setSpritePosition(x, y);
    			if (width != textureRegion.getRegionWidth() || 
    					height != textureRegion.getRegionHeight()) {
    				setSize(width, height);
    				setSprite();
    			}
    		}
    	}
    	
    	@Override
    	public void draw(Batch batch, float x, float y, float width, float height) {
    		updateSprite(x, y, width, height);
    		sprite.draw(batch);
    	}
    
    	@Override
    	public float getLeftWidth() {
    		// TODO Auto-generated method stub
    		return 0;
    	}
    
    	@Override
    	public void setLeftWidth(float leftWidth) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public float getRightWidth() {
    		// TODO Auto-generated method stub
    		return 0;
    	}
    
    	@Override
    	public void setRightWidth(float rightWidth) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public float getTopHeight() {
    		// TODO Auto-generated method stub
    		return 0;
    	}
    
    	@Override
    	public void setTopHeight(float topHeight) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public float getBottomHeight() {
    		// TODO Auto-generated method stub
    		return 0;
    	}
    
    	@Override
    	public void setBottomHeight(float bottomHeight) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public float getMinWidth() {
    		// TODO Auto-generated method stub
    		return 0;
    	}
    
    	@Override
    	public void setMinWidth(float minWidth) {
    		// TODO Auto-generated method stub
    		
    	}
    
    	@Override
    	public float getMinHeight() {
    		// TODO Auto-generated method stub
    		return 0;
    	}
    
    	@Override
    	public void setMinHeight(float minHeight) {
    		// TODO Auto-generated method stub
    		
    	}
    	
    	private void setFilename(String filename) {
    		this.filename = filename;
    	}
    	
    	private String getFilename() {
    		return filename;
    	}
    
    	public float getX() {
    		return x;
    	}
    
    	public void setX(float x) {
    		this.x = x;
    	}
    
    	public float getY() {
    		return y;
    	}
    
    	public void setY(float y) {
    		this.y = y;
    	}
    
    	public float getWidth() {
    		return width;
    	}
    
    	public void setWidth(float width) {
    		this.width = width;
    	}
    
    	public float getHeight() {
    		return height;
    	}
    
    	public void setHeight(float height) {
    		this.height = height;
    	}
    
    	public Boolean getFillParent() {
    		return fillParent;
    	}
    
    	public void setFillParent(Boolean fillParent) {
    		this.fillParent = fillParent;
    	}
    
    }
    																																				

    public by leonardo modified Oct 21, 2014  3713  22  5  -1

    CHEATSHEET - LibGdx

    LIBGDX CHEATSHEET
    
    Batch
    - draw texture regions on screen
    - operate in screen coordinates (x right, y upward, origin lower left corner)
    - you can provide your own transformation and projection matrices
    
    Typical Flow
    
    OrthographicCamera camera;
    SpriteBatch batch;
    Texture texture;
    Sprite sprite;
    
    
    INIT>
    camera = new OrthographicCamera(1280, 720);
    batch = new SpriteBatch();
    texture = new Texture(Gdx.files.internal("data/Toronto2048wide.jpg"));
    texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    sprite = new Sprite(texture);
    sprite.setOrigin(0,0);
    
    RENDER>
    Gdx.gl.glClearColor(1, 1, 1, 1);
    Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
    batch.setProjectionMatrix(camera.combined);
    batch.begin();
    sprite.draw(batch);
    batch.end();
    
    

    public by leonardo modified Oct 16, 2014  2744  1  5  1

    SNIPPET - Box2d_LibGdx_Integration

    /*
    <SNIPPET>
    	<TAGS = "JAVA,LIBGDX,BOX2D" />
    	<NAME="Box2d_LibGdx_Integration" />
    	<DESCR>Codice per integrare una texture region con un oggetto Box2D</DESCR>
    </SNIPPET>
    */
    
    public TextureWrapper{
         TextureRegion region;
         int width;
         int height;
         Vector2 position;
         float scaleX;
         float scaleY;
         float originX;
         float originY;
         float rotation;
         public TextureWrapper(TextureRegion region,Vector2 pos){
              this.position=pos;
              SetTextureRegion(region);
         } 
         public void SetTextureRegion(TextureRegion region){
              this.region=region;
              width=region.getRegionWidth();
              height=region.getRegionHeight();
              originX=width/2;
              originY=height/2;
              scaleX=1;
              scaleY=1;
         }
         public int GetWidth(){
            return width;
         } 
         public int GetHeight(){
              return height;
         } 
    
         public void SetPosition(float x,float y){
              position.set(x,y);
         } 
         public void SetRotation(float r){
              rotation=r;
         } 
    
         public void Draw(SpriteBatch sp){
              sp.draw(region,position.x-width/2, position.y-height/2,
               originX, originY, width, height,
              scaleX, scaleY, rotation);
         }
         ....
    }
    
    
    
    public class BoxUserData{
            int collisionGroup;
            int boxId;
            public BoxUserData(int boxid,int collisiongroup){
                      Set(boxid,collisiongroup);
            }
            public void Set(int boxid,int collisiongroup){
                      this.boxId=boxid;
                      this.collisionGroup=collisiongroup;
            }
            public int GetBoxId(){
                   return this.boxId;
            }
            public int GetCollisionGroup{ 
                    return this.collisionGroup;
            }
    
    }

    public by leonardo modified Oct 16, 2014  2573  2  6  0

    SNIPPET - Box2d_Java

    Codice Box2D per creare una simulazione fisica con oggetti fisici
    /*
    <SNIPPET>
    	<TAGS="JAVA,LIBGDX,BOX2D" />
    	<NAME="Box2d_Java" />
    	<DESCR>Codice Box2D per creare una simulazione fisica con oggetti fisici</DESCR>
    </SNIPPET>
    */
    
    // Codice Generico Box2D (only box2d debug mode is visible)
    
    // 100 pixels <-> 1 meter
    static final float WORLD_TO_BOX=0.01f; 
    static final float BOX_WORLD_TO=100f;
    float ConvertToBox(float x){
        return x*WORLD_TO_BOX;
    }
    
    // Step 1 - Create World
    World world=new World(new Vector2(0,-20),true) // World(Vector2 gravity, boolean doSleep) // com.badlogic.gdx.math
    
    // Step 2 - Create Body
    public void CreateBody(World world,Vector2 pos,float angle){
        BodyDef bodyDef = new BodyDef(); 
        bodyDef.type = bodyType; // The body type: static, kinematic, or dynamic
        bodyDef.position.set(ConvertToBox(pos.x),ConvertToBox(pos.y)); // The world position of the body.
        bodyDef.angle=angle; // The world angle of the body in radians.
        body = world.createBody(bodyDef);
    }
    
    // Step 3 - Create Fixture/Shape
    private void MakeRectFixture(float width,float height,BodyDef.BodyType bodyType,
         float density,float restitution, Vector2 pos,float angle){
         PolygonShape bodyShape = new PolygonShape();
    
         float w=ConvertToBox(width/2f);
         float h=ConvertToBox(height/2f);
         bodyShape.setAsBox(w,h);
    
         FixtureDef fixtureDef=new FixtureDef();
         fixtureDef.density=density; // The density, usually in kg/m^2.
         fixtureDef.restitution=restitution; // The restitution (elasticity) usually in the range [0,1].
         fixtureDef.shape=bodyShape;
         /*
         com.badlogic.gdx.physics.box2d.Shape
    		com.badlogic.gdx.physics.box2d.PolygonShape {ChainShape, CircleShape, EdgeShape, PolygonShape}
    			PolygonShape (->setAsBox(float hx, float hy) Build vertices to represent an axis-aligned box.)
         */
    
         body.createFixture(fixtureDef);
         bodyShape.dispose(); // lo puoi fare perchè la shape è clonata quando viene assegnata alla fixture
     }
    
    private void MakeCircleFixture(float radius,BodyDef.BodyType bodyType,
         float density,float restitution, Vector2 pos,float angle){
    
         FixtureDef fixtureDef=new FixtureDef();
         fixtureDef.density=density;
         fixtureDef.restitution=restitution;
         fixtureDef.shape=new CircleShape();
         fixtureDef.shape.setRadius(BoxObjectManager.ConvertToBox(radius));
    
         body.createFixture(fixtureDef);
         fixtureDef.shape.dispose();
     }
    
    // Step 4 - World Update Fixed TimeStep
    static final float BOX_STEP=1/120f;
    static final int  BOX_VELOCITY_ITERATIONS=8;
    static final int BOX_POSITION_ITERATIONS=3;
    float accumulator;
    
    public void Update(float dt){
       accumulator+=dt;
        while(accumulator>BOX_STEP){
          world.step(BOX_STEP,BOX_VELOCITY_ITERATIONS,BOX_POSITION_ITERATIONS);
          accumulator-=BOX_STEP;
       }
    
    }
    
    

    external by bobabongi modified Oct 12, 2014  125  0  2  0

    LibGDX rendering routine using a TiledMap renderer, the Box2D debug renderer and sprites

    LibGDX rendering routine using a TiledMap renderer, the Box2D debug renderer and sprites: WorldRenderingSystem_extract.java
    @Override
    public void update(float deltaTime) {
        /* glClear etc... */
    
        // mapCamera is an OrthogonalCamera
        mapCamera.position.set(cameraMovable.position.x * mapComponent.pixelsPerMeter,
                cameraMovable.position.y * mapComponent.pixelsPerMeter, 0);
        mapCamera.zoom = 1.0f/cameraComponent.camera_zoom;
        mapCamera.update();
    
        // render the map - mapRenderer is an OrthogonalTiledMapRenderer
        NavigationScreen.spriteBatch.setProjectionMatrix(mapCamera.combined);
        mapRenderer.render();
    
        // render physical bodies and triggers - debugRenderer is a Box2DDebugRenderer
        if(displayDebugRenderer) {
            debugProjectionMatrix = mapCamera.combined.cpy();
            debugProjectionMatrix.scale(mapComponent.pixelsPerMeter, mapComponent.pixelsPerMeter, 1f);
            debugRenderer.render(Managers.physics.world, debugProjectionMatrix);
        }
    
        // render sprites
        NavigationScreen.spriteBatch.begin();
        for(/* ... */) {
            // spritePosition := position in world coordinates
    
            sprite.setCenter(spritePosition.x * mapComponent.pixelsPerMeter,
                    spritePosition.y * mapComponent.pixelsPerMeter);
    
            sprite.draw(NavigationScreen.spriteBatch);
        }
        NavigationScreen.spriteBatch.end();
    }
    
    @Override
    public void resize(int width, int height) {
            float aspectRatio = (float) width / (float) height;
            // in my code this is called howManyTexturePixelsWeSeeInAScreenHeight
            float camHeight = screenHeightInMeters*mapComponent.pixelsPerMeter;
            cameraComponent.mapCamera = new OrthographicCamera(aspectRatio*camHeight, camHeight);
    }
    
    

    external by Metaphore modified Nov 12, 2015  5077  56  4  0

    LibGDX Resize texture on load

    LibGDX Resize texture on load: ResizeTexture.java
    Pixmap pixmap200 = new Pixmap(Gdx.files.internal("200x200.png"));
    Pixmap pixmap100 = new Pixmap(100, 100, pixmap200.getFormat());
    pixmap100.drawPixmap(pixmap200,
            0, 0, pixmap200.getWidth(), pixmap200.getHeight(),
            0, 0, pixmap100.getWidth(), pixmap100.getHeight()
    );
    Texture texture = new Texture(pixmap100);
    pixmap200.dispose();
    pixmap100.dispose();
    
    
    • Public Snippets
    • Channels Snippets