當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。