Java Code Examples for com.badlogic.gdx.graphics.g2d.Sprite#flip()
The following examples show how to use
com.badlogic.gdx.graphics.g2d.Sprite#flip() .
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: TrackProgress.java From uracer-kotd with Apache License 2.0 | 6 votes |
public TrackProgress () { lblAdvantage = new HudLabel(FontFace.CurseWhiteBig, "", false); lblAdvantageShown = false; lblAdvantage.setAlpha(0); texMask = Art.texCircleProgressMask; shProgress = ShaderLoader.fromFile("progress", "progress"); sprAdvantage = new Sprite(Art.texCircleProgress); sprAdvantage.flip(false, true); flipped = false; sprProgress = new Sprite(Art.texRadLinesProgress); sprProgress.flip(false, true); }
Example 2
Source File: DriftBar.java From uracer-kotd with Apache License 2.0 | 6 votes |
public DriftBar () { seconds = 0; labelSeconds = new HudLabel(FontFace.CurseRedYellowNew, "s", false); labelSeconds.setAlpha(0); // texHalf = Art.texCircleProgressHalf; texHalfMask = Art.texCircleProgressHalfMask; w = texHalf.getWidth(); h = texHalf.getHeight(); offX = w / 2; offY = h / 2; shDriftSecs = ShaderLoader.fromFile("progress", "progress"); // drift seconds sprDriftSecs = new Sprite(texHalf); sprDriftSecs.flip(false, true); // drift strength driftStrength = new WindowedMean((int)(1 / 0.25f)); sprDriftStrength = new Sprite(texHalf); }
Example 3
Source File: TextureUtil.java From seventh with GNU General Public License v2.0 | 6 votes |
public static void setFlips(Sprite sprite, boolean isFlippedHorizontal, boolean isFlippedVert, boolean isFlippedDiagnally) { if(sprite==null) return; if(isFlippedDiagnally) { if(isFlippedHorizontal && isFlippedVert) { sprite.flip(true, false); sprite.rotate(-270f); } else if(isFlippedHorizontal) { sprite.rotate(-270f); } else if(isFlippedVert) { sprite.rotate(-90f); } else { sprite.flip(false, true); sprite.rotate(-270f); } } else { sprite.flip(isFlippedHorizontal, isFlippedVert); } }
Example 4
Source File: WrongWay.java From uracer-kotd with Apache License 2.0 | 5 votes |
public WrongWay () { sign = new Sprite(Art.wrongWay); float scale = 0.4f; w = Art.wrongWay.getWidth() * scale; h = Art.wrongWay.getHeight() * scale; offX = w / 2; offY = h / 2; sign.setSize(w, h); sign.setOrigin(offX, offY); sign.flip(false, true); bfAlpha = new BoxedFloat(0); isShown = false; }
Example 5
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); }
Example 6
Source File: ClientGrenade.java From seventh with GNU General Public License v2.0 | 5 votes |
/** * */ public ClientGrenade(ClientGame game, Vector2f pos, Type grenadeType) { super(game, pos); this.grenadeType = grenadeType; sprite = new Sprite(grenadeType==Type.SMOKE_GRENADE ? Art.smokeGrenadeImage : Art.fragGrenadeImage); sprite.setSize(16, 16); sprite.setOrigin(8, 8); sprite.flip(false, true); }
Example 7
Source File: ClientRocket.java From seventh with GNU General Public License v2.0 | 5 votes |
/** * */ public ClientRocket(ClientGame game, Vector2f pos) { super(game, pos); anim = game.getPools().getMissle().create(); sprite = new Sprite(anim.getCurrentImage()); sprite.flip(false, true); //sprite.setScale(0.5f); bounds.width = 8; bounds.height = 10; this.light = game.getLightSystem().newPointLight(new Vector2f(pos)); this.light.setColor(1, 1, 1); }