Java 类com.badlogic.gdx.graphics.Color 实例源码

项目:Mindustry    文件:Maps.java   
public Maps() {
    json.setOutputType(OutputType.json);
    json.setElementType(ArrayContainer.class, "maps", Map.class);
    json.setSerializer(Color.class, new ColorSerializer());
}
项目:EarthInvadersGDX    文件:MenuScreen.java   
public MenuScreen() {
    camera = new OrthographicCamera();
    viewport = new FitViewport(Game.WIDTH, Game.HEIGHT, camera);
    viewport.apply();
    camera.position.set(Game.WIDTH / 2, Game.HEIGHT / 2, 0);
    camera.update();
    betaText = new BitmapFont(Gdx.files.internal("score.fnt"), Gdx.files.internal("score.png"), false);
    betaText.getData().setScale(0.35f);
    logo = new Sprite(new Texture("logo.png"));
    Random r = new Random();
    background = new Particle[r.nextInt(55 - 45) + 45];
    for (int i = 0; i < background.length; i++) {
        int size = r.nextInt(4) + 1;
        int x = r.nextInt(Game.WIDTH);
        int y = r.nextInt(Game.HEIGHT);
        background[i] = new Particle(x, y, 0, 0, -1, new Color(207 / 255f, 187 / 255f, 20 / 255f, 1f), size);
    }
    musicMuted = new Sprite(new Texture(Gdx.files.internal("buttons/music_muted.png")));
    musicUnmuted = new Sprite(new Texture(Gdx.files.internal("buttons/music_unmuted.png")));
    play = new CenteredButton(500, "buttons/play.png");
    music = new Button(Game.WIDTH - 130, 15, Game.musicMuted() ? musicMuted : musicUnmuted);
    music.setScale(4f);
}
项目:JGame    文件:LoadingScreen.java   
@Override
public void render(float delta) {
    Gdx.gl.glClearColor(0, 1, 1, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
    randomDelta += delta;

    game.batch.begin();
    fontHandler.font90.setColor(Color.BLACK);
    fontHandler.font90.draw(game.batch, "Loading", (game.screenX / 2) - widthLoading / 2, (game.screenY / 2) + 100);
    game.batch.end();
    if (randomDelta >= .1 && settingMap == true) {
        settingMap = false;
        game.setScreen(new GameScreen(game));
    }

}
项目:odb-little-fortune-planet    文件:OdbFeatureScreen.java   
protected World createWorld() {

        final RenderBatchingSystem renderBatchingSystem;

        return new World(new WorldConfigurationBuilder()
                .dependsOn(OperationsPlugin.class)
                .with(WorldConfigurationBuilder.Priority.HIGH,
                        // supportive
                        new SuperMapper(),
                        new TagManager(),
                        new CameraSystem(1),
                        new FeatureScreenAssetSystem(),
                        new OdbFeatureDetectionSystem()
                ).with(WorldConfigurationBuilder.Priority.LOW,
                        // processing
                        new TransitionSystem(GdxArtemisGame.getInstance()),
                        // animation
                        new ClearScreenSystem(Color.valueOf("969291")),
                        renderBatchingSystem = new RenderBatchingSystem(),
                        new AnimRenderSystem(renderBatchingSystem),
                        new FeatureScreenSetupSystem()
                ).build());
    }
项目:ExamensArbeteTD    文件:UIStageController.java   
public void updateUpgradeInfo() {
    if (isOverUpgradeBtn()) {
        if (model.isDamageGreenText())
            uistage.getUiPanel().getRightSection().getTowerSelectDamage().setColor(Assets.greenColor);
        else
            uistage.getUiPanel().getRightSection().getTowerSelectDamage().setColor(Color.WHITE);
        if (model.isIsfireRateGreenText())
            uistage.getUiPanel().getRightSection().getTowerSelectFireRate().setColor(Assets.greenColor);
        else
            uistage.getUiPanel().getRightSection().getTowerSelectFireRate().setColor(Color.WHITE);
        if (model.isRangeGreenText())
            uistage.getUiPanel().getRightSection().getTowerSelectRange().setColor(Assets.greenColor);
        else
            uistage.getUiPanel().getRightSection().getTowerSelectRange().setColor(Color.WHITE);
    } else {
        uistage.getUiPanel().getRightSection().getTowerSelectFireRate().setColor(Color.WHITE);
        uistage.getUiPanel().getRightSection().getTowerSelectRange().setColor(Color.WHITE);
        uistage.getUiPanel().getRightSection().getTowerSelectDamage().setColor(Color.WHITE);
    }
}
项目:alquran-alkarem    文件:GameActor.java   
public GameActor(TextureRegion actor_region,float x_pos,float y_pos,Color color,float width,float height,boolean is_loading) {
actor_texture = actor_region;
xpos = x_pos ;
ypos = y_pos ;
width_ =width ;
height_ = height;
actor_Sprite = new Sprite(actor_texture);
actor_Sprite.setX(xpos);
actor_Sprite.setY(ypos);
if(color != null){
actor_color = color ;
actor_Sprite.setColor(actor_color);}
actor_Sprite.setSize(width_, height_);

}
项目:cocos2d-java    文件:DrawNode.java   
final StructShapeCommand popShapeCommandCell() {
    if(currShapePos >= shapeCommandQueues.size) {
        return null;
    }

    stackCommand.clear();
    stackCommand.drawType = (DrawType) shapeCommandQueues.get(currShapePos++);
    stackCommand.color = (Color) shapeCommandQueues.get(currShapePos++);
    // 如果color是null则使用默认颜色
    if(stackCommand.color == null) {
        stackCommand.color = getDisplayedColor();
    }
    stackCommand.shapeType = (ShapeType) shapeCommandQueues.get(currShapePos++);
    stackCommand.borderWidth = (float) shapeCommandQueues.get(currShapePos++);
    int dataLen = (int) shapeCommandQueues.get(currShapePos++);
    for(int i = 0; i < dataLen; ++i) {
        stackCommand.vertexArray.add((Float) shapeCommandQueues.get(currShapePos++));
    }
    return stackCommand;
}
项目:enklave    文件:ProgressBarEnergy.java   
public void updateVisual(){
    Skin skin = new Skin();
    Pixmap pixmap = new Pixmap(1,(int)(Gdx.graphics.getHeight()*0.0175), Pixmap.Format.RGBA8888);
    switch (infoProfile.getDateUserGame().getFaction()){
        case 1:{
            pixmap.setColor(1, 0f, 0f, 1);
            break;
        }
        case 2:{
            pixmap.setColor(0f, 0.831f, 0.969f,1f);
            break;
        }
        case 3:{
            pixmap.setColor(0.129f, 0.996f, 0.29f,1);
            break;
        }
    }
    pixmap.fill();
    skin.add("blue", new Texture(pixmap));
    ProgressBar.ProgressBarStyle style = new ProgressBar.ProgressBarStyle(bar.getStyle().background,skin.newDrawable("blue",Color.WHITE));
    style.knobBefore = style.knob;
    bar.setStyle(style);
}
项目:enklave    文件:ScreenSetting.java   
private void addChangeFaction(){
    groupChangeFaction = new Group();
    Image background = new Image(new TextureRegion(manager.getAssetsSettings().getTexture(NameFiles.extensionImgBackground)));
    background.setSize(Width - Width * 0.03f, Height * 0.1f);
    background.setPosition(Width / 2 - background.getWidth() / 2, Height * 0.3f);
    groupChangeFaction.addActor(background);
    Label labelFac = new Label("Change Faction",new Label.LabelStyle(Font.getFont((int)(Height*0.025f)),Color.WHITE));
    labelFac.setPosition(background.getX()+background.getWidth()*0.05f,background.getY()+background.getHeight()/2-labelFac.getHeight()/2);
    labelFac.addListener(new ClickListener(){
        @Override
        public void clicked(InputEvent event, float x, float y) {
            manager.loadAssetsChoiceFaction();
            gameManager.setScreen(new ScreenCircleLoading(gameManager,new ScreenChoiceFaction(gameManager),manager.getAssetsChoiceFaction()));
        }
    });
    groupChangeFaction.addActor(labelFac);
}
项目:LD38-Compo    文件:LudumDare38.java   
private void createToolTip()
{
    Skin skin = new Skin();
    Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.RGBA8888);
    pixmap.setColor(Color.WHITE);
    pixmap.fill();
    skin.add("white", new Texture(pixmap));
    skin.add("default", new BitmapFont());

    TextButton.TextButtonStyle textButtonStyle = new TextButton.TextButtonStyle();
    textButtonStyle.up = skin.newDrawable("white", new Color(0, 0, 0, 1));
    textButtonStyle.font = skin.getFont("default");
    skin.add("default", textButtonStyle);

    labelToolTip = new TextButton("TEST", skin);
    labelToolTip.setX(5);
    labelToolTip.setY(5);
    labelToolTip.setWidth(125);
    labelToolTip.setVisible(false);
    labelToolTip.getLabel().setWrap(true);
    labelToolTip.setHeight(labelToolTip.getLabel().getHeight());
    group.addActor(labelToolTip);
}
项目:Mindustry    文件:NuclearReactor.java   
@Override
public void drawSelect(Tile tile){
    super.drawSelect(tile);

    NuclearReactorEntity entity = tile.entity();
    Vector2 offset = getPlaceOffset();

    Vars.renderer.drawBar(Color.GREEN, tile.worldx() + offset.x, tile.worldy() + 6 +
            offset.y + height*Vars.tilesize/2f, (float)entity.getItem(generateItem) / itemCapacity);
    Draw.reset();

    float fract = entity.heat;
    if(fract > 0)
        fract = Mathf.clamp(fract + 0.2f, 0.24f, 1f);

    Vars.renderer.drawBar(Color.ORANGE, tile.worldx() + offset.x, 
            tile.worldy() + Vars.tilesize * height/2f + 10 + offset.y, fract);
}
项目:Mindustry    文件:Turret.java   
@Override
public void drawSelect(Tile tile){
    Vector2 offset = getPlaceOffset();

    Draw.color(Color.GREEN);
    Draw.dashCircle(tile.worldx() + offset.x, tile.worldy() + offset.y, range);
    Draw.reset();

    TurretEntity entity = tile.entity();

    float fract = (float)entity.ammo/maxammo;
    if(fract > 0)
        fract = Mathf.clamp(fract, 0.24f, 1f);

    Vars.renderer.drawBar(Color.GREEN, tile.worldx() + offset.x, 2 + tile.worldy() + height/2f*Vars.tilesize + offset.y, fract);
}
项目:gdx-cclibs    文件:ColorSerializer.java   
@Override
public Color read(Kryo kryo, Input input, Class<Color> type) {
    Boolean compact = GraphHeader.isUseCompactColor(kryo);
    if (compact == null) compact = isCompactDefault;
    if (compact){
        Color color = new Color();
        Color.rgba8888ToColor(color, input.readInt());
        return color;
    } else {
        float r = input.readFloat();
        float g = input.readFloat();
        float b = input.readFloat();
        float a = input.readFloat();
        return new Color(r, g, b, a);
    }

}
项目:NoRiskNoFun    文件:GameScene.java   
/**
 * Creates a new Infantry on the Region specified within the message
 * @param message GUI Message containing position information
 */
private void spawnNewTroop(SpawnTroopGui message) {

    AssetMap.Region region = regionNameMap.get(message.getRegionName());
    Vector2 troopCoordinates = calculatePolygonCentroid(region.getVertices());

    Infantry infantry = new Infantry((troopCoordinates.x * Gdx.graphics.getWidth()) - 50, (troopCoordinates.y * Gdx.graphics.getHeight()) - 50, 100, 100, message.getId());
    infantry.addTouchListener();
    infantry.setFirstMove(false);
    infantry.setCurrentRegion(regionNameMap.get(message.getRegionName()));

    Gdx.app.log("Spawning", "Actor with ID: " + infantry.getId());


    // set color and owner only when the first troop spawns on this region
    if (region.getOwner().equals(Player.NULL_PLAYERNAME)) {
        region.setOwner(data.getCurrentPlayer().getPlayerName());
        setRegionColor(new Color(data.getCurrentPlayer().getColor()), infantry.getCurrentRegion());
    }

    region.updateTroops(1);
    data.setChangedFlag(true);

    figures.add(infantry);
    addSceneObject(infantry);
}
项目:Planet-Generator    文件:ObjectGenerator.java   
public Orbiter createMoon() {
    ColorGroup colors = new ColorGroup()
            .add(Color.rgba8888(176f / 255f, 155f / 255f, 178f / 255f, 1f))
            .add(Color.rgba8888(156f / 255f, 155f / 255f, 190f / 255f, 1f))
            .add(Color.rgba8888(223f / 255f, 233f / 255f, 180f / 255f, 1f))
            .add(Color.rgba8888(75f / 255f, 109f / 255f, 133f / 255f, 1f));

    int moonCount = MathUtils.random(0, 8);

    float zTilt = zDir * MathUtils.random(10, 50);
    float xTilt = -MathUtils.random(15, 55);

    Orbiter.OrbiterBlueprint moonBlueprint = new Orbiter.OrbiterBlueprint();
    moonBlueprint.angularVelocity = velDir * MathUtils.random(15, 60);
    moonBlueprint.zTilt = zTilt + MathUtils.random(-10, 10);
    moonBlueprint.xTilt = xTilt + MathUtils.random(-10, 10);
    moonBlueprint.angle = MathUtils.random(0, 360);
    moonBlueprint.radius = MathUtils.random(100, 250);

    int color = colors.random();
    Orbiter moon = new Orbiter(createMoonSprite(MathUtils.random(16, 20) / (moonCount / 3 + 1)), moonBlueprint, color);

    scene.addMoon(moon);

    return moon;
}
项目:KyperBox    文件:GameObject.java   
public GameObject() {
    controllers = new Array<GameObjectController>();
    sprite = NO_SPRITE;
    velocity = new Vector2();
    setOrigin(Align.center);
    debug_bounds = Color.YELLOW;
    flip_x = false;
    flip_y = false;
    ignore_collision = false;
    group = 1;
    filter = -1;
}
项目:INFSEN01-2    文件:Button.java   
public Button(String text, Point top_left, Integer size, Color color, Float width, Float height, Runnable action) {
this.width = width;
this.height = height;
this.color = color;
       this.top_left = top_left;
       this.label = new Label(text, top_left, size, color);
this.action = action;
   }
项目:cocos2d-java    文件:DrawNode.java   
public void drawRect(float fromX, float fromY, float toX, float toY, Color color) {
    if(!batchCommand) { 
        clear();
    }
    pushShapeCommandCell(DrawType.Rect, color, ShapeType.Line, lineWidth, 
            fromX, fromY, toX, toY);
}
项目:school-game    文件:CreateGameSlot.java   
/**
 * Zeigt den Spielstarten Bildschirm an
 *
 * @param camera die aktuelle Kamera
 */
public void renderStart(OrthographicCamera camera)
{
    fontLayout.setText(font, localeBundle.format("hallo", saveData.getPlayerName(), saveData.isMale() ? "M" : "W"), Color.WHITE, camera.viewportWidth, Align.center, false);
    font.draw(batch, fontLayout, -camera.viewportWidth / 2, 100);

    fontLayout.setText(font, localeBundle.get("fertig1"), Color.WHITE, camera.viewportWidth, Align.center, false);
    font.draw(batch, fontLayout, -camera.viewportWidth / 2, 50);

    fontLayout.setText(font, localeBundle.get("fertig2"), Color.WHITE, camera.viewportWidth, Align.center, false);
    font.draw(batch, fontLayout, -camera.viewportWidth / 2, -50);
}
项目:GDX-Engine    文件:Monster.java   
public Monster(IGameService services, Texture texture, int index) {
super(services);

color = Color.WHITE;

hitPoint = MaxHitPoint = GameSpecs.hitPoint[index];
bonus = GameSpecs.bonus[index];
speed = GameSpecs.speed[index];

this.region = new TextureRegion(texture);
region.setRegion(0, 0, REGION_WIDTH, REGION_HEIGHT);
this.path = new ArrayDeque<Path>(TowerDefenseScene.path);
target = path.pop();
x = target.x;
y = target.y;
direction = target.getDirection();
move(direction);
player = new AnimationPlayer(TowerDefenseScene.monsterAnimation) {

    @Override
    public void onFrameChanged() {
    region.setRegion(frameIndex * REGION_WIDTH, REGION_HEIGHT * direction.getIndex(), REGION_WIDTH,
        REGION_HEIGHT);
    }

    @Override
    public void onAnimationChanged() {
    }

    @Override
    public void onFinishedLooping() {
    // TODO Auto-generated method stub

    }
};
   }
项目:school-game    文件:CreateGameSlot.java   
/**
 * Zeigt den Geschlechtsauswahl Bildschirm an
 *
 * @param camera die aktuelle Kamera
 */
public void renderGender(OrthographicCamera camera)
{
    Color maleColor;
    Color femaleColor;

    if (stateSwitch)
    {
        maleColor = Color.GREEN;
        femaleColor = Color.DARK_GRAY;
    } else {
        maleColor = Color.DARK_GRAY;
        femaleColor = Color.GREEN;
    }

    fontLayout.setText(font, localeBundle.get("geschlecht"), Color.WHITE, camera.viewportWidth, Align.center, false);
    font.draw(batch, fontLayout, -camera.viewportWidth / 2, camera.viewportHeight / 2 - 120);

    fontLayout.setText(font, localeBundle.get("frau"), femaleColor, camera.viewportWidth, Align.center, false);
    font.draw(batch, fontLayout, -camera.viewportWidth / 2, 30);

    fontLayout.setText(font, localeBundle.get("mann"), maleColor, camera.viewportWidth, Align.center, false);
    font.draw(batch, fontLayout, -camera.viewportWidth / 2, -30);

    fontLayout.setText(smallFont, localeBundle.get("enter_bestaetigen"), Color.WHITE, camera.viewportWidth, Align.center, false);
    smallFont.draw(batch, fontLayout, -camera.viewportWidth / 2, -camera.viewportHeight / 2 + 70);
}
项目:summer17-android    文件:PlayScreen.java   
public PlayScreen(NoObjectionGame game) {
    atlas = new TextureAtlas("dudestuff3.pack");

    this.game = game;
    bg = new Texture("main_background.png");
    gameCam = new OrthographicCamera();
    gamePort = new FitViewport(NoObjectionGame.V_WIDTH / NoObjectionGame.PPM, NoObjectionGame.V_HEIGHT / NoObjectionGame.PPM, gameCam);
    hud = new Hud(game.batch);

    maploader = new TmxMapLoader();
    map = maploader.load("map1.tmx");
    renderer = new OrthoCachedTiledMapRenderer(map, 1 / NoObjectionGame.PPM);
    gameCam.position.set(gamePort.getWorldWidth() / 2, gamePort.getWorldHeight() / 2, 0);

    world = new World(new Vector2(0, -10), true);
    b2dr = new Box2DDebugRenderer();

    new B2WorldCreator(world, map);
    hero = new Hero(world, this);
    controller = new Controller();
    worldContactListener = new WorldContactListener();
    world.setContactListener(worldContactListener);

    //timer
    sb = new SpriteBatch();
    viewport = new FitViewport(NoObjectionGame.V_WIDTH, NoObjectionGame.V_HEIGHT, new OrthographicCamera());
    stage = new Stage(viewport, sb);
    table = new Table();
    table.top();
    table.setFillParent(true);
    countDownLabel = new Label(Float.toString(playTime), new Label.LabelStyle(new BitmapFont(), Color.WHITE));
    table.add(countDownLabel).expandX();
    stage.addActor(table);


}
项目:cocos2d-java    文件:DrawNode.java   
public void drawDot(float x, float y, float radius, Color color) {
    if(!batchCommand) { 
        clear();
    }
    pushShapeCommandCell(DrawType.Dot, color, ShapeType.Filled, radius, 
            x, y);
}
项目:MMORPG_Prototype    文件:Monster.java   
public Monster(Texture lookout, long id, PlayState playState, MonsterProperties properties)
{
    super(lookout, id, playState);
    linkedState = playState;
    font.setColor(new Color(1, 0, 0, 1));
    this.properties = properties;
}
项目:Cubes    文件:LogMenu.java   
public LogMenu() {
  label = new Label("", new LabelStyle(Fonts.smallHUD, Color.BLACK));
  label.setWrap(true);
  Drawable background = new TextureRegionDrawable(Assets.getTextureRegion("core:hud/LogBackground.png"));
  scrollPane = new ScrollPane(label, new ScrollPaneStyle(background, null, null, null, null));
  scrollPane.setScrollingDisabled(true, false);
  back = MenuTools.getBackButton(this);

  stage.addActor(scrollPane);
  stage.addActor(back);

  refresh();
}
项目:NoRiskNoFun    文件:GameScene.java   
@Override
public void preload() {

    clickedRegionLabel = new LabelSceneObject(sceneData.createLabel("Region: ", Assets.FONT_36PX_WHITE_WITH_BORDER));
    clickedRegionLabel.setBounds(0, 0, 500, 100);
    addSceneObject(clickedRegionLabel);

    GameObjectMap  gameObjectMap = new GameObjectMap(data.getMapAsset());
    regionMap = gameObjectMap.getRegionMap();
    regionNameMap = gameObjectMap.getRegionNameMap();
    troopIndicators = new HashMap<>();
    ownColor = new Color(data.getMyself().getColor());

    addSceneObject(gameObjectMap);
    addFiguresToStage();
    addInputListener();

    initTurnIndicator();
    initStateIndicator();
    initTroopIndicators();
    initDoneButton();

    for (Player player:data.getPlayers()) {
        Gdx.app.log(getClass().getSimpleName(), "Player Available: " + player.getPlayerName() + " Color: " + player.getColor());
    }

    Gdx.app.log(getClass().getSimpleName(), "Myself: " + data.getMyself().getPlayerName() + " Color: " + data.getMyself().getColor());

}
项目:Catan    文件:FishTradeWindow.java   
private void initButton(Button b, int choiceNumber) {
    b.setColor(Color.BLUE);
    b.pad(5);
    b.pack();
    b.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
            choice = choiceNumber;
            ableall();
            b.setDisabled(true);
        }
    });
}
项目:EarthInvadersGDX    文件:Particle.java   
public Particle(float x, float y, int dir, int speed, long timeInMilliseconds, Color color, int size) {
    super(x, y);
    expireTime = System.currentTimeMillis() + timeInMilliseconds;
    if (timeInMilliseconds < 0)
        expireTime = -1;

    this.color = color;
    this.size = size;
    this.dir = dir;
    this.speed = speed;
}
项目:cocos2d-java    文件:DrawNode.java   
public void drawSolidTriangle(float x0, float y0, float x1, float y1, float x2, float y2, Color color) {
    if(!batchCommand) { 
        clear();
    }
    pushShapeCommandCell(DrawType.Triange, color, ShapeType.Filled,
            lineWidth, x0, y0, x1, y1, x2, y2);
}
项目:FlappySpinner    文件:AssetsManager.java   
private static void generateMediumFont(FreeTypeFontGenerator generator) {
    FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
    parameter.size = Constants.MEDIUM_FONT_SIZE;
    parameter.borderColor = Color.BLACK;
    parameter.color =  Color.GOLD;
    parameter.hinting = FreeTypeFontGenerator.Hinting.None;
    parameter.borderWidth = 1;
    mediumFont = generator.generateFont(parameter);
    mediumFont.setUseIntegerPositions(false);
}
项目:jenjin    文件:Slot.java   
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();
}
项目:cocos2d-java    文件:Node.java   
protected void updateCascadeColor() {
    float r = 1, g = 1, b = 1;
    if(_parent != null && _parent.isCascadeColorEnabled()) {
        Color c = _parent.getDisplayedColor();
        r = c.r; g = c.g; b = c.b;
    }
    updateDisplayedColor(r, g, b);
}
项目:MMORPG_Prototype    文件:UserInterface.java   
public void showTimedErrorMessage(String errorMessage, float timeout)
{
    Label label = new TimedLabel(errorMessage, timeout);
    label.setColor(Color.RED);
    label.setX(960);
    label.setY(55);

    stage.addActor(label);
}
项目:cocos2d-java    文件:Node.java   
/**
* Change the color of node.
* @param color A Color3B color value.
*/
public void setColor(Color color) {
 _displayColor.r = _r = color.r;
 _displayColor.g = _g = color.g;
 _displayColor.b = _b = color.b;

 updateCascadeColor();
}
项目:FlappyChapa    文件:PlayState.java   
public PlayState(GameStateManager gsm) {
        super(gsm);
        score = 0;
        chapa = new Chapa(50, 300);
        camera.setToOrtho(false, FlappyChapa.WIDTH / 2, FlappyChapa.HEIGHT / 2);
        Texture texture = new Texture("bg.png");
        backGround = new org.academiadecodigo.bootcamp.sprites.Background(camera);
        backGround.start();
        ground = new Texture("ground.png");
        /*table = new Table();
        table.setPosition(camera.position.x,camera.position.y);
        //table.setBounds(camera.position.x,camera.position.y,camera.viewportWidth,camera.viewportHeight/10);
        table.setFillParent(true);*/
        scoreLabel = new Label(String.format("%06d", score), new Label.LabelStyle(new BitmapFont(), Color.WHITE));
        scoreLabel.setPosition(camera.position.x,0);
        startTime = TimeUtils.nanoTime();
        anto = new Anto(camera);
//        groundPos1 = new Vector2(camera.position.x - camera.viewportWidth / 2, GROUND_Y_OFFSET);
//        groundPos2 = new Vector2((camera.position.x - camera.viewportWidth / 2) + ground.getWidth(), GROUND_Y_OFFSET);
        tubes = new Array<Tube>();
        for (int i = 0; i < TUBE_COUNT; i++) {
            tubes.add(new Tube(i * (TUBE_SPACING + Tube.TUBE_WIDTH)));
        }

        music = Gdx.audio.newMusic(Gdx.files.internal("bigSmoke_justAudio.mp3"));
        music.setLooping(true);
        music.setVolume(0.5f);
        music.play();
    }
项目:Onyx    文件:CrossFadeColorEffect.java   
/**
 * @param configuration the configuration which drives the effect
 * @param source        the color to be manipulated
 */
public CrossFadeColorEffect(CrossFadeColorEffectConfiguration configuration, Color source) {
    this.source = source;
    this.cycle = CycleList.of(configuration.cycleColors);
    this.crossFadeTime = configuration.crossFadeTime;
    this.crossFadeDeltaTimeStepRequirement = configuration.crossFadeDeltaTimeStepRequirement;
    this.fadeInDeltaMultiplier = configuration.fadeInDeltaMultiplier;
    this.fadeOutDeltaMultiplier = configuration.fadeOutDeltaMultiplier;
}
项目:cocos2d-java    文件:NodeTests.java   
public void onEnter() {
            super.onEnter();

            Node node = Sprite.create("powered.png");
            addChild(node);

            node.setOnTransformCallback((n)->{
//              System.out.println("updateTransform = " + node.getPosition());
            });

            DrawNode dn = new DrawNode();
            addChild(dn);

            node.setContentSize(100, 100);

            DrawNode debugDraw = (DrawNode) DrawNode.create().addTo(this);

            node.setOnUpdateCallback((n, t)->{
                Rect r = node.getBoundingBox();
                debugDraw.drawRect(r.x, r.y, r.x + r.width, r.y + r.height, null);
            });
            node.scheduleUpdate();
            node.setAnchorPoint(0f, 0f);
            node.runAction(MoveTo.create(2, 1000, 500));
            node.runAction(RotateBy.create(2, 1000));


//          node.runAction(Move.create(2, 0, 100));
//          node.runAction(MoveBy.create(0.5f, 500, 100));

            node.setColor(Color.RED);
            node.setOpacity(0.5f);
        }
项目:Catan    文件:SessionScreen.java   
void initFishTable(Table fishTable) {
    oneFishCount = new Table(CatanGame.skin);
    twoFishCount = new Table(CatanGame.skin);
    threeFishCount  = new Table(CatanGame.skin);
    oneFishCountLabel = new Label("0",CatanGame.skin);
    twoFishCountLabel = new Label("0",CatanGame.skin);
    threeFishCountLabel = new Label("0",CatanGame.skin);

    oneFishCount.add(new Label("1 fish", CatanGame.skin)).row();
    twoFishCount.add(new Label("2 fish", CatanGame.skin)).row();
    threeFishCount.add(new Label("3 fish", CatanGame.skin)).row();
    oneFishCount.add(oneFishCountLabel).row();
    twoFishCount.add(twoFishCountLabel).row();
    threeFishCount.add(threeFishCountLabel).row();

    oneFishCount.setBackground(CatanGame.skin.newDrawable("white", Color.BLUE));
    twoFishCount.setBackground(CatanGame.skin.newDrawable("white", Color.BLUE));
    threeFishCount.setBackground(CatanGame.skin.newDrawable("white", Color.BLUE));

    fishTable.add(oneFishCount).width(60).height(60).pad(5);
    fishTable.add(twoFishCount).width(60).height(60).pad(5);
    fishTable.add(threeFishCount).width(60).height(60).pad(5);

    fishTable.setBackground("resTableBackground");
    fishTable.pad(10);
    fishTable.pack();
}
项目:NoRiskNoFun    文件:ChooseTroopAmountScene.java   
public ChooseTroopAmountScene(SceneData sceneData){
    super(SceneNames.TROOP_AMOUNT_SCENE, Color.WHITE);
    this.sceneData = sceneData;
    this.data = sceneData.getGameData();
    this.buttonPressedSound = sceneData.createSound(Assets.BUTTON_PRESSED_SOUND_FILENAME);


}
项目:Mindustry    文件:PowerBooster.java   
@Override
public void drawSelect(Tile tile){
    super.drawSelect(tile);

    Draw.color(Color.YELLOW);
    Draw.dashCircle(tile.worldx(), tile.worldy(), powerRange * Vars.tilesize);
    Draw.reset();
}