package com.mygdx.game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.mygdx.game.utils.GdxTest;
public class BlitTest extends GdxTest {
Texture rgb888;
Texture rgba8888;
Texture psRgb888;
Texture psRgba8888;
SpriteBatch batch;
public void create () {
rgb888 = new Texture("data/bobrgb888-32x32.png");
rgba8888 = new Texture("data/bobargb8888-32x32.png");
psRgb888 = new Texture("data/alpha.png");
psRgba8888 = new Texture("data/rgb.png");
batch = new SpriteBatch();
}
public void render () {
Gdx.gl.glClearColor(0.4f, 0.4f, 0.4f, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
batch.draw(rgb888, 0, 0);// 不透明
batch.draw(rgba8888, 60, 0);// 透明
batch.d
[LIBGDX学习]LibGDX代码详解(二)texture blit
最新推荐文章于 2021-10-18 16:04:55 发布
![](https://img-home.csdnimg.cn/images/20240611030827.png)