private void setTintAndBlending(Decal decal, Color tint) { int srcFactor = DecalMaterial.NO_BLEND; int destFactor = DecalMaterial.NO_BLEND; if (tint.a > 0.0f && tint.a < 1.0f) { srcFactor = GL20.GL_SRC_ALPHA; destFactor = GL20.GL_ONE_MINUS_SRC_ALPHA; } decal.setColor(tint); decal.setBlending(srcFactor, destFactor); }
/** @see Decal#newDecal(TextureRegion) */ public static AnimatedDecal newAnimatedDecal(Animation animation) { return newAnimatedDecal(animation.getKeyFrame(0).getRegionWidth(), animation.getKeyFrame(0).getRegionHeight(), animation, DecalMaterial.NO_BLEND, DecalMaterial.NO_BLEND); }
/** @see Decal#newDecal(TextureRegion, boolean) */ public static AnimatedDecal newDecal(Animation animation, boolean hasTransparency) { return newAnimatedDecal(animation.getKeyFrame(0).getRegionWidth(), animation.getKeyFrame(0).getRegionHeight(), animation, hasTransparency ? GL20.GL_SRC_ALPHA : DecalMaterial.NO_BLEND, hasTransparency ? GL20.GL_ONE_MINUS_SRC_ALPHA : DecalMaterial.NO_BLEND); }
/** @see Decal#newDecal(float, float, TextureRegion) */ public static AnimatedDecal newAnimatedDecal(float width, float height, Animation animation) { return newAnimatedDecal(width, height, animation, DecalMaterial.NO_BLEND, DecalMaterial.NO_BLEND); }
/** @see Decal#newDecal(float, float, TextureRegion, boolean) */ public static AnimatedDecal newAnimatedDecal(float width, float height, Animation animation, boolean hasTransparency) { return newAnimatedDecal(width, height, animation, hasTransparency ? GL20.GL_SRC_ALPHA : DecalMaterial.NO_BLEND, hasTransparency ? GL20.GL_ONE_MINUS_SRC_ALPHA : DecalMaterial.NO_BLEND); }