by
386 12
-1
5
3,918
22
Top 1% !
Popular
Famous
Tagged
Specified
Popularity: 2939th place
This snippet is Public
LanguageText
LicenseMIT_X11

CHEATSHEET - LibGdx

Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/203276/CHEATSHEET---LibGdx?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
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();
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus