Java Code Examples for com.badlogic.gdx.graphics.g2d.Sprite#setRegion()
The following examples show how to use
com.badlogic.gdx.graphics.g2d.Sprite#setRegion() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CarHighlighter.java From uracer-kotd with Apache License 2.0 | 6 votes |
public CarHighlighter () { sprite = new Sprite(); sprite.setRegion(Art.cars.findRegion("selector")); isBusy = false; isActive = false; followedCar = null; isTracking = false; alpha = 1; bfScale = new BoxedFloat(1); bfRot = new BoxedFloat(0); bfAlpha = new BoxedFloat(0); bfGreen = new BoxedFloat(1); bfRed = new BoxedFloat(1); bfBlue = new BoxedFloat(1); bfRenderState = new BoxedFloat(0); prevState = null; renderState = null; interpolateState = false; }
Example 2
Source File: MapLoader.java From Bomberman_libGdx with MIT License | 5 votes |
protected Sprite createGroundSprite() { TextureRegion textureRegion = tileTextureAtlas.findRegion("ground"); Sprite sprite = new Sprite(); sprite.setRegion(textureRegion); sprite.setBounds(0, 0, 1, 1); return sprite; }
Example 3
Source File: PlayerSprite.java From seventh with GNU General Public License v2.0 | 5 votes |
private void setTextureRegion(Sprite sprite, TextureRegion region) { sprite.setTexture(region.getTexture()); sprite.setRegion(region); sprite.setSize(region.getRegionWidth(), region.getRegionHeight()); sprite.setOrigin(region.getRegionWidth()/2f, region.getRegionHeight()/2f); sprite.flip(false, true); }