Example usage for com.badlogic.gdx.graphics Color Color

List of usage examples for com.badlogic.gdx.graphics Color Color

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics Color Color.

Prototype

public Color() 

Source Link

Document

Constructs a new Color with all components set to 0.

Usage

From source file:com.badlydrawngames.general.Particle.java

License:Apache License

public Particle(float size) {
    this.color = new Color();
    this.size = size;
    this.halfSize = size / 2;
}

From source file:com.bitfire.postprocessing.filters.CrtScreen.java

License:Apache License

public CrtScreen(boolean barrelDistortion) {
    super(ShaderLoader.fromFile("screenspace", "crt-screen",
            barrelDistortion ? "#define ENABLE_BARREL_DISTORTION" : ""));
    dodistortion = barrelDistortion;// ww w  .  j  a  v a 2  s. co m

    vtint = new Vector3();
    tint = new Color();

    rebind();

    setTime(0f);
    setTint(0.8f, 1.0f, 0.7f);
    setDistortion(0.3f);
    setZoom(1f);
    setColorOffset(0.003f);
}

From source file:com.blastedstudios.ledge.ui.postprocessing.filters.CrtScreen.java

License:Apache License

public CrtScreen(boolean barrelDistortion, RgbMode mode, int effectsSupport) {
    // @off//  w ww .  j  av  a  2s . c o m
    super(ShaderLoader.fromFile("screenspace", "crt-screen",
            (barrelDistortion ? "#define ENABLE_BARREL_DISTORTION\n" : "")
                    + (mode == RgbMode.RgbShift ? "#define ENABLE_RGB_SHIFT\n" : "")
                    + (mode == RgbMode.ChromaticAberrations ? "#define ENABLE_CHROMATIC_ABERRATIONS\n" : "")
                    + (isSet(Effect.TweakContrast.v, effectsSupport) ? "#define ENABLE_TWEAK_CONTRAST\n" : "")
                    + (isSet(Effect.Vignette.v, effectsSupport) ? "#define ENABLE_VIGNETTE\n" : "")
                    + (isSet(Effect.Tint.v, effectsSupport) ? "#define ENABLE_TINT\n" : "")
                    + (isSet(Effect.Scanlines.v, effectsSupport) ? "#define ENABLE_SCANLINES\n" : "")
                    + (isSet(Effect.PhosphorVibrance.v, effectsSupport)
                            ? "#define ENABLE_PHOSPHOR_VIBRANCE\n"
                            : "")
                    + (isSet(Effect.ScanDistortion.v, effectsSupport) ? "#define ENABLE_SCAN_DISTORTION\n"
                            : "")));
    // @on

    dodistortion = barrelDistortion;

    vtint = new Vector3();
    tint = new Color();
    chromaticDispersion = new Vector2();

    setTime(0f);
    setTint(1.0f, 1.0f, 0.85f);
    setDistortion(0.3f);
    setZoom(1f);
    setRgbMode(mode);

    // default values
    switch (mode) {
    case ChromaticAberrations:
        setChromaticDispersion(-0.1f, -0.1f);
        break;
    case RgbShift:
        setColorOffset(0.003f);
        break;
    case None:
        break;
    default:
        throw new GdxRuntimeException("Unsupported RGB mode");
    }
}

From source file:com.company.minery.utils.spine.Slot.java

License:Open Source License

public Slot(SlotData data, Bone bone) {
    if (data == null)
        throw new IllegalArgumentException("data cannot be null.");
    if (bone == null)
        throw new IllegalArgumentException("bone cannot be null.");
    this.data = data;
    this.bone = bone;
    color = new Color();
    setToSetupPose();/*w  w w. j av a  2 s  .co  m*/
}

From source file:com.kotcrab.vis.editor.serializer.ColorSerializer.java

License:Apache License

@Override
public Color read(Kryo kryo, Input input, Class<Color> type) {
    Color color = new Color();
    Color.rgba8888ToColor(color, input.readInt());
    return color;
}

From source file:com.lyeeedar.Roguelike3D.Graphics.Materials.ColorAttribute.java

License:Open Source License

protected ColorAttribute() {
    color = new Color();
}

From source file:com.lyeeedar.Roguelike3D.Graphics.Screens.LevelLoadingScreen.java

License:Open Source License

@Override
public void create() {

    lightManager = new LightManager(4, LightQuality.FORWARD_VERTEX);

    renderer = new ForwardRenderer();
    renderer.createShader(lightManager);

    GameObject go = new Enemy(new Color(), "icon", 0, 0, -4, 0.5f, GL20.GL_TRIANGLES, "cube", "2", "2", "2");
    go.create();/*www. j ava 2  s . co  m*/
    go.bakeLights(lightManager, true);

    objects.add(go);

    loading_bar = new Texture(Gdx.files.internal("data/skins/loading_bar.png"));
}

From source file:com.mygdx.Network.Client.Tile.java

public ModelInstance getOrCreateModel(ModelBuilder modelBuilder, PathFinder worldHandler,
        ArrayList<ModelInstance> instances, Player currentPlayer) {
    if (model != null) {
        Color asd = new Color();
        asd.r += (float) x / 48 - ((float) currentPlayer.x - 32) / 32 / 48 + 0.3;
        asd.g += (float) y / 48 - ((float) currentPlayer.y - 32) / 32 / 48 + 0.3;
        asd.b += (float) 0;

        Material Material = model.materials.get(0);
        Material.set(new Material(ColorAttribute.createDiffuse(asd), ColorAttribute.createSpecular(asd),
                FloatAttribute.createShininess(0)));

        return model;
    }//from w ww  . j a  v a 2s .com

    float pz = -y * 32;
    float px = x * 32;
    Color asd = new Color();
    asd.r += (float) ((x - currentPlayer.x / 32) + 10) / 100;
    asd.g += (float) ((y - currentPlayer.y / 32) + 10) / 100;
    asd.b += (float) 0;

    Model floor = modelBuilder.createRect(px, worldHandler.getMap()[x][y].z, pz, px + 32,
            worldHandler.getMap()[x + 1][y].z, pz, px + 32, worldHandler.getMap()[x + 1][y + 1].z, pz - 32, px,
            worldHandler.getMap()[x][y + 1].z, pz - 32, 1f, 1f, -1f,
            new Material(ColorAttribute.createDiffuse(asd), ColorAttribute.createSpecular(asd),
                    FloatAttribute.createShininess(0)),
            VertexAttributes.Usage.Position | VertexAttributes.Usage.Normal);

    model = new ModelInstance(floor);
    return model;

}

From source file:com.quadbits.gdxhelper.actors.BackgroundActor.java

License:Apache License

@Inject
public BackgroundActor() {
    super();/* w ww  . java2 s .  c om*/

    topLeftColor = new Color();
    topRightColor = new Color();
    bottomLeftColor = new Color();
    bottomRightColor = new Color();
}

From source file:com.quadbits.gdxhelper.actors.SkyActor.java

License:Apache License

@Inject
public SkyActor() {
    super();// w  w w  .  j  a  va  2 s . c  o  m

    colorTop = new Color();
    colorMiddle = new Color();
    colorBottom = new Color();
    dstColor = new Color();
    darkColor1 = new Color();
    darkColor2 = new Color();
    lightColor1 = new Color();
    lightColor2 = new Color();
    tmpColor = new Color();

    palettes = new Array<DayPalette>();
    palettes.add(new DayPalette());

    shaderProgram = new ShaderProgram(getVertexShader(), getFragmentShader());
    if (!shaderProgram.isCompiled()) {
        Gdx.app.error("SkyActor", "[Shader program error] " + shaderProgram.getLog());
        Gdx.app.exit();
    }

    init();
}