public void draw (Batch batch, float x, float y, float width, float height) { Color spriteColor = sprite.getColor(); temp.set(spriteColor); sprite.setColor(spriteColor.mul(batch.getColor())); sprite.setRotation(0); sprite.setScale(1, 1); sprite.setBounds(x, y, width, height); sprite.draw(batch); sprite.setColor(temp); }
public void draw (Batch batch, float x, float y, float width, float height) { Color spriteColor = sprite.getColor(); temp.set(spriteColor); sprite.setColor(spriteColor.mul(batch.getColor())); sprite.setRotation(0); sprite.setScale(1, 1); sprite.setBounds(x, y, width, height); sprite.draw(batch); sprite.setColor(temp); }
public void draw (Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation) { Color spriteColor = sprite.getColor(); temp.set(spriteColor); sprite.setColor(spriteColor.mul(batch.getColor())); sprite.setOrigin(originX, originY); sprite.setRotation(rotation); sprite.setScale(scaleX, scaleY); sprite.setBounds(x, y, width, height); sprite.draw(batch); sprite.setColor(temp); }
public void draw (Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation) { Color spriteColor = sprite.getColor(); temp.set(spriteColor); sprite.setColor(spriteColor.mul(batch.getColor())); sprite.setOrigin(originX, originY); sprite.setRotation(rotation); sprite.setScale(scaleX, scaleY); sprite.setBounds(x, y, width, height); sprite.draw(batch); sprite.setColor(temp); }
sprites3[i].setRotation(angle); sprites3[i].setScale(scale); spriteCache.add(sprites3[i]); sprites3[i].setRotation(angle); sprites3[i].setScale(scale); spriteCache.add(sprites3[i]);
public void setOrientation (float degrees) { front.setRotation(degrees); rear.setRotation(degrees); }
public void setRotation(float degrees) { sprite.setRotation(degrees); }
public void drawSpriteOnHUD(TextureRegion region, float x, float y, float rotation) { Sprite sprite = new Sprite(region); sprite.setPosition(x, y); sprite.setRotation((float) Math.toDegrees(rotation)); sprite.draw(hudBatch); }
public void drawSprite(TextureRegion region, float x, float y, float rotation) { Sprite sprite = new Sprite(region); sprite.setPosition(x, y); sprite.setRotation((float) Math.toDegrees(rotation)); sprite.draw(batch); }
@Override public void render(Screen g) { if (!fighting) { if (!launched) { pokeBA.setRotation(launchPower*-4f); pokeBA.draw(g.batch); g.drawSprite(pokeBod, x, y, 0); pokeFA.setRotation(launchPower*-4f); pokeFA.draw(g.batch); } else if (launched && !bounced && moving) { flyAnimTime += Gdx.graphics.getDeltaTime(); flyFrame = flyAnim.getKeyFrame(flyAnimTime, true); g.drawSprite(flyFrame, x, y, yVel * 0.1f); } else if (launched && bounced && moving) { g.drawSprite(Art.ilpoDuck, x, y, yVel * 0.5f); } else if (launched && !moving) { g.drawSprite(Art.ilpoEnd, x, y, 0); } } }
public void draw (Batch batch, float x, float y, float width, float height) { Color spriteColor = sprite.getColor(); temp.set(spriteColor); sprite.setColor(spriteColor.mul(batch.getColor())); sprite.setRotation(0); sprite.setScale(1, 1); sprite.setBounds(x, y, width, height); sprite.draw(batch); sprite.setColor(temp); }
public void draw (Batch batch, float x, float y, float originX, float originY, float width, float height, float scaleX, float scaleY, float rotation) { Color spriteColor = sprite.getColor(); temp.set(spriteColor); sprite.setColor(spriteColor.mul(batch.getColor())); sprite.setOrigin(originX, originY); sprite.setRotation(rotation); sprite.setScale(scaleX, scaleY); sprite.setBounds(x, y, width, height); sprite.draw(batch); sprite.setColor(temp); }
@Override public void setValues(Sprite target, int tweenType, float[] newValues) { switch (tweenType) { case POSITION_XY: target.setPosition(newValues[0], newValues[1]); break; case SCALE_XY: target.setScale(newValues[0], newValues[1]); break; case ROTATION: target.setRotation(newValues[0]); break; case OPACITY: Color c = target.getColor(); c.set(c.r, c.g, c.b, newValues[0]); target.setColor(c); break; case RGB: Color color = target.getColor(); color.r = newValues[0]; color.g = newValues[1]; color.b = newValues[2]; target.setColor(color); break; default: assert false; } } }
public void drawShape(AssetManager assetManager, Camera camera, GDXShape shape, Body body, Batch batch, float alpha){ if(shape.getResource().isEmpty()){ Log.debug("GDXRenderer.drawShape", "Resource empty string, not drawing"); return; } Texture texture = null; try{ texture = assetManager.get(shape.getResource()); }catch(GdxRuntimeException e){ Log.error("GDXRenderer.drawShape", e.getMessage() + ", loading " + shape.getResource() + " manually"); texture = getTexture(shape.getResource()); } if(!shape.isRepeatable() && texture != null && body != null){ Sprite sprite = new Sprite(texture); sprite.setScale(SHAPE_SCALE); sprite.setRotation((float)Math.toDegrees(body.getAngle())); sprite.setPosition(body.getPosition().x - texture.getWidth()/2f, body.getPosition().y - texture.getHeight()/2f); if(alpha != 1f) sprite.setAlpha(alpha); sprite.draw(batch); } }
private void shadowRender(Batch batch){ if(shadow){ for(int i=shadows.length-1;i>=0;i--){ Sprite shadow = shadows[i]; shadow.setSize(this.getWidth(), this.getHeight()); shadow.setRotation(this.getRotation()); if(catchPoints.size>i){ final Vector2 tmp = catchPoints.get(i); //do not draw the static object if(tmp.dst(vTmp.set(this.getX(), this.getY()))>5){ shadow.setPosition(tmp.x, tmp.y); shadow.draw(batch,(0.64f-0.36f/shadowNumber*(shadowNumber-i))*this.getColor().a ); } } } } } private Vector2 vTmp = new Vector2();
float angle = ballsBodies.get(i).getAngle() * MathUtils.radiansToDegrees; sp.setPosition(pos.x - sp.getWidth() / 2, pos.y - sp.getHeight() / 2); sp.setRotation(angle); sp.draw(canvas.batch);
public void render (SpriteBatch batch, float cameraZoom) { if (isActive && hasCar) { float orient = renderState.orientation; tmp.set(GameRenderer.ScreenUtils.worldPxToScreen(renderState.position)); if (prevState != null && interpolateState) { // modulate values, expects bfRenderState.valuein range [0,1] // modulate position tmp2.set(GameRenderer.ScreenUtils.worldPxToScreen(prevState.position)); tmp.x = AMath.lerp(tmp2.x, tmp.x, bfRenderState.value); tmp.y = AMath.lerp(tmp2.y, tmp.y, bfRenderState.value); // modulate orientation orient = lerpOrient(prevState.orientation, renderState.orientation, bfRenderState.value); } float timeFactor = URacer.Game.getTimeModFactor() * 0.3f; float s = 1f + timeFactor; float rot = bfRot.value - orient; sprite.setScale(bfScale.value * cameraZoom * scale * s); sprite.setPosition(tmp.x - offX, tmp.y - offY); sprite.setRotation(rot); sprite.setColor(bfRed.value, bfGreen.value, bfBlue.value, 1); sprite.draw(batch, bfAlpha.value * alpha); } }
begin1.setRotation(degrees); begin2.setRotation(degrees); mid1.setRotation(degrees); mid2.setRotation(degrees); end1.setRotation(degrees); end2.setRotation(degrees);
bottleSprite.setPosition(bottlePos.x, bottlePos.y); bottleSprite.setOrigin(bottleModelOrigin.x, bottleModelOrigin.y); bottleSprite.setRotation(bottleModel.getAngle() * MathUtils.radiansToDegrees); ballSprites[i].setRotation(ballModels[i].getAngle() * MathUtils.radiansToDegrees);
target.setRotation(newValues[0]); break;