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

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

Introduction

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

Prototype

Color WHITE

To view the source code for com.badlogic.gdx.graphics Color WHITE.

Click Source Link

Usage

From source file:es.eucm.ead.editor.view.builders.scene.groupeditor.SelectionBox.java

License:Open Source License

@Override
protected void drawChildren(Batch batch, float parentAlpha) {
    Color color = null;/*from w  w w. j  ava 2 s  . co m*/
    switch (state) {
    case PRESSED:
        color = style.pressedColor;
        break;
    case SELECTED:
        color = groupEditor.isOnlySelection() ? style.onlySelectionColor
                : groupEditor.isMultipleSelection() ? style.multiSelectedColor : style.selectedColor;
        break;
    case MOVING:
        color = groupEditor.isMultipleSelection() ? style.multiMovingColor : style.movingColor;
        break;
    }
    batch.setColor(color.r, color.g, color.b, style.alpha);
    if (target instanceof EntityGroup) {
        selectedBackground.draw(batch, selectionOrigin.x, selectionOrigin.y, selectionSize.x, selectionSize.y);
    } else {
        selectedBackground.draw(batch, 0, 0, target.getWidth(), target.getHeight());
    }
    batch.setColor(Color.WHITE);
    super.drawChildren(batch, parentAlpha);
}

From source file:es.eucm.ead.editor.view.widgets.groupeditor.Grouper.java

License:Open Source License

@Override
protected void drawChildren(Batch batch, float parentAlpha) {
    batch.end();//from   w w w .j  a  v  a 2s  .  c o m
    Gdx.gl.glEnable(GL20.GL_BLEND);
    Gdx.gl.glBlendFunc(GL20.GL_ONE, GL20.GL_DST_COLOR);
    Gdx.gl.glBlendEquation(GL20.GL_FUNC_SUBTRACT);
    shapeRenderer.setColor(Color.WHITE);
    shapeRenderer.begin(ShapeType.Line);
    super.drawChildren(batch, parentAlpha);
    shapeRenderer.end();
    Gdx.gl.glBlendEquation(GL20.GL_FUNC_ADD);
    Gdx.gl.glDisable(GL20.GL_BLEND);
    batch.begin();
}

From source file:es.eucm.ead.editor.view.widgets.groupeditor.Handles.java

License:Open Source License

@Override
protected void drawChildren(Batch batch, float parentAlpha) {
    batch.end();/*from  ww  w.  j a  v a  2 s.co m*/
    Gdx.gl.glEnable(GL20.GL_BLEND);
    Gdx.gl.glBlendFunc(GL20.GL_ONE, GL20.GL_DST_COLOR);
    Gdx.gl.glBlendEquation(GL20.GL_FUNC_SUBTRACT);
    shapeRenderer.setProjectionMatrix(batch.getProjectionMatrix());
    shapeRenderer.setTransformMatrix(batch.getTransformMatrix());
    shapeRenderer.begin(ShapeType.Line);
    shapeRenderer.setColor(Color.WHITE);
    shapeRenderer.line(handles[0].getX(), handles[0].getY(), handles[2].getX(), handles[2].getY());
    shapeRenderer.line(handles[0].getX(), handles[0].getY(), handles[6].getX(), handles[6].getY());
    shapeRenderer.line(handles[2].getX(), handles[2].getY(), handles[8].getX(), handles[8].getY());
    shapeRenderer.line(handles[8].getX(), handles[8].getY(), handles[6].getX(), handles[6].getY());
    shapeRenderer.end();
    super.drawChildren(batch, parentAlpha);
    Gdx.gl.glBlendEquation(GL20.GL_FUNC_ADD);
    Gdx.gl.glDisable(GL20.GL_BLEND);
    batch.begin();
}

From source file:es.eucm.ead.editor.view.widgets.IconButton.java

License:Open Source License

@Override
public void draw(Batch batch, float parentAlpha) {
    super.draw(batch, parentAlpha);
    // iconImage does not restore the batch color, and its color is
    // transmitted
    batch.setColor(Color.WHITE);
}

From source file:es.eucm.ead.editor.view.widgets.menu.ContextMenuItem.java

License:Open Source License

@Override
public void drawChildren(Batch batch, float parentAlpha) {
    if (style.over != null && clickListener.isOver()) {
        float offset = icon != null ? style.padLeft : 0;
        style.over.draw(batch, style.margin + offset, style.margin, getWidth() - style.margin * 2 - offset,
                getHeight() - style.margin * 2);
    }/*from   ww w .  jav  a  2s.  c  o  m*/

    if (style.arrow != null && childContextMenu != null) {
        float size = getHeight() / 3.5f;
        style.arrow.draw(batch, getWidth() - size, (getHeight() - size) / 2.0f, size, size);
    }
    super.drawChildren(batch, parentAlpha);
    batch.setColor(Color.WHITE);
}

From source file:es.eucm.ead.editor.view.widgets.menu.Menu.java

License:Open Source License

@Override
public void draw(Batch batch, float parentAlpha) {
    batch.setColor(Color.WHITE);
    if (style.background != null) {
        style.background.draw(batch, getX(), getY(), getWidth(), getHeight());
    }/*from w  w w . j a  v a2s  .  c om*/
    super.draw(batch, parentAlpha);
}

From source file:es.eucm.ead.editor.view.widgets.Toast.java

License:Open Source License

@Override
protected void drawChildren(Batch batch, float parentAlpha) {
    super.drawChildren(batch, parentAlpha);
    batch.setColor(Color.WHITE);
}

From source file:es.eucm.ead.engine.debugger.SimpleDebugger.java

License:Open Source License

public SimpleDebugger(Game game, GameLoader gameLoader) {
    this.setTouchable(Touchable.disabled);
    this.history = new Array<String>();
    final CommandInterpreter commandInterpreter = new CommandInterpreter(game, gameLoader);
    BitmapFont font = new BitmapFont(
            Gdx.files.internal("es/eucm/ead/engine/resources/binary/fonts/ubuntu-16-bold.fnt"), true);
    this.setX(0);
    this.setY(580);

    Pixmap p = new Pixmap(10, 10, Pixmap.Format.RGBA8888);
    p.setColor(Color.BLACK);//ww  w  .  ja  v  a2s .  c o m
    p.fill();
    TextureRegionDrawable background = new TextureRegionDrawable(new TextureRegion(new Texture(p)));
    p.dispose();
    p = new Pixmap(2, 30, Pixmap.Format.RGBA8888);
    p.setColor(Color.WHITE);
    p.fill();
    TextureRegionDrawable cursor = new TextureRegionDrawable(new TextureRegion(new Texture(p)));
    p.dispose();

    Label.LabelStyle style = new Label.LabelStyle();
    SpriteDrawable backgroundSprite = new SpriteDrawable(new Sprite(background.getRegion()));
    backgroundSprite.getSprite().setColor(new Color(0, 0, 0, 0.5f));
    style.background = backgroundSprite;
    style.font = font;
    style.fontColor = Color.WHITE;
    result = new Label("", style);
    result.setWrap(true);
    int y = -100;

    result.setBounds(0, y, 800, -y);
    this.addActor(result);

    TextField.TextFieldStyle tfStyle = new TextField.TextFieldStyle();
    tfStyle.font = font;
    tfStyle.background = background;
    tfStyle.selection = cursor;
    tfStyle.fontColor = Color.WHITE;
    tfStyle.cursor = cursor;
    interpreter = new TextField("", tfStyle);
    interpreter.setBounds(10, 0, 800, 20);
    interpreter.getStyle().font = font;
    interpreter.addListener(new InputListener() {
        @Override
        public boolean keyDown(InputEvent event, int keycode) {
            switch (keycode) {
            case Input.Keys.ENTER:
                String command = interpreter.getText();
                if (history.size == 0 || !history.peek().equals(command)) {
                    history.add(command);
                }
                historyPointer = history.size;
                result.setText(commandInterpreter.interpret(command));
                interpreter.setText("");
                break;
            case Input.Keys.ESCAPE:
                setVisible(false);
                break;
            case Input.Keys.UP:
                previousCommand();
                break;
            case Input.Keys.DOWN:
                nextCommand();
                break;
            }
            return true;
        }
    });

    Button.ButtonStyle buttonStyle = new Button.ButtonStyle();
    Label label = new Label(">", style);
    buttonStyle.up = background;
    button = new Button(label, buttonStyle);
    button.setHeight(20);
    button.addListener(new InputListener() {
        @Override
        public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
            setVisible(true);
            return false;
        }
    });

    this.addActor(interpreter);
    setVisible(false);
    this.addActor(button);
    ((EAdEngine) Gdx.app.getApplicationListener()).getStage().addListener(new InputListener() {
        @Override
        public boolean keyDown(InputEvent event, int keycode) {
            switch (keycode) {
            case Input.Keys.F12:
                setVisible(true);
                break;
            }
            return false;
        }
    });
}

From source file:es.eucm.ead.engine.renderers.TextEngineObject.java

License:Open Source License

@Override
public void initialize(Text schemaObject) {
    text = gameLoop.getAssets().getI18N().m(schemaObject.getText());
    scale = schemaObject.getScale();/*w w  w.j a va 2  s .  c  o m*/

    es.eucm.ead.schema.components.Color c = schemaObject.getColor();
    color = c == null ? Color.WHITE : new Color(c.getR(), c.getG(), c.getB(), c.getA());

    String fontFile = schemaObject.getFont();
    if (fontFile == null || !gameLoop.getAssets().resolve(fontFile).exists()) {
        bitmapFont = gameLoop.getAssets().getDefaultFont();
    } else {
        bitmapFont = gameLoop.getAssets().get(schemaObject.getFont(), BitmapFont.class);
    }

    bounds = bitmapFont.getBounds(text);
}

From source file:es.eucm.ead.engine.systems.effects.transitions.LoadingIndicator.java

License:Open Source License

@Override
public void draw(Batch batch, float parentAlpha) {
    super.draw(batch, parentAlpha);
    batch.setColor(Color.WHITE);
}