当前位置: 首页>>代码示例>>Java>>正文


Java Color.CYAN属性代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.Color.CYAN属性的典型用法代码示例。如果您正苦于以下问题:Java Color.CYAN属性的具体用法?Java Color.CYAN怎么用?Java Color.CYAN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.badlogic.gdx.graphics.Color的用法示例。


在下文中一共展示了Color.CYAN属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testRemovedPixmapField

public void testRemovedPixmapField(){
    GraphHeader.currentReadWriteVersion = 0;

    TestClass object = new TestClass();
    object.someInt = randInt();
    object.someFloat = randFloat();
    object.point = new GridPoint2(randInt(), randInt());
    object.color = new Color(Color.CYAN);
    object.smallTestClass = new SmallTestClass();
    object.smallTestClass.someValue = randInt();

    Pixmap pixmap = new Pixmap(20, 24, Pixmap.Format.RGBA8888);
    for (int i = 0; i < pixmap.getWidth(); i++) {
        for (int j = 0; j < pixmap.getHeight(); j++) {
            pixmap.drawPixel(i, j, randInt());
        }
    }
    object.smallTestClass.somePixmap = pixmap;

    kryo.register(SmallTestClass.class);
    kryo.register(TestClass.class);

    GraphHeader<TestClass> graphHeader = new GraphHeader<TestClass>();
    graphHeader.data = object;

    GraphHeader.currentReadWriteVersion = 0;
    byte[] written = write(graphHeader);

    GraphHeader.currentReadWriteVersion = 1;
    GraphHeader<TestClass> returned = read(written, GraphHeader.class);
    assertTrue(equals(graphHeader, returned));
    assertTrue(returned.data.smallTestClass.somePixmap == null);
}
 
开发者ID:CypherCove,项目名称:gdx-cclibs,代码行数:33,代码来源:GraphHeaderTest.java

示例2: PlayScreen

public PlayScreen(DarkDay game, SpriteBatch sb) {
    this.game = game;
    this.spriteBatch = sb;
    gamecam = new OrthographicCamera();
    stage = new Stage();

    Gdx.input.setInputProcessor(stage);
    conf = new ConfFacade();
    conf.initConfs(208, 400, 32, 10);

    touchpad = conf.getTouchPad();

    stage.addActor(touchpad);
    viewport = new ScreenViewport(gamecam);
    debugRenderer = new Box2DDebugRenderer();
    world = new World(new Vector2(0, 0f), true);

    builder = new BodyDirector(new DynamicBodyBuilder(world,viewport.getCamera().viewportWidth / 2 + 3, viewport.getCamera().viewportHeight /2 + 3, 32f , 32f, 1.0f, false ));
    builder.setBuilder();
    entity = new B2dSteeringEntity(builder.getBody(), 10);

    builder = new BodyDirector(new DynamicBodyBuilder(world, viewport.getCamera().viewportWidth / 2, viewport.getCamera().viewportHeight /2, 32f , 32f, 1.0f, true));
    builder.setBuilder();

    player = new Player(builder.getBody(), viewport ,touchpad);

    target = new B2dSteeringEntity(builder.getBody(), 10);


    rayHandler = new RayHandler(world);
    rayHandler.setAmbientLight(.2f);
    rayHandler.setShadows(true);
    rayHandler.setBlurNum(1);

    ptLight = new PointLight(rayHandler, 150, Color.CYAN, 6, 0, 0);
    ptLight.attachToBody(builder.getBody());

    ptLight.setSoftnessLength(0f);


    for (int i = 0; i < 800; i++){
        builder = new BodyDirector(new StaticBodyBuilder(world, (float) Math.random() * 100, (float) Math.random() * 100, (float) Math.random() * 50, 128f, 1.0f, true));
        builder.setBuilder();
    }


    Arrive<Vector2> arriveSB = new Arrive<Vector2>(entity, target)
            .setTimeToTarget(0.01f)
            .setArrivalTolerance(2f)
            .setDecelerationRadius(10);
    entity.setBehavior(arriveSB);








}
 
开发者ID:MSLacerda,项目名称:DarkDay,代码行数:60,代码来源:PlayScreen.java


注:本文中的com.badlogic.gdx.graphics.Color.CYAN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。