當前位置: 首頁>>代碼示例>>Java>>正文


Java Color.rgba8888ToColor方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.graphics.Color.rgba8888ToColor方法的典型用法代碼示例。如果您正苦於以下問題:Java Color.rgba8888ToColor方法的具體用法?Java Color.rgba8888ToColor怎麽用?Java Color.rgba8888ToColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.graphics.Color的用法示例。


在下文中一共展示了Color.rgba8888ToColor方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: Trajectory

import com.badlogic.gdx.graphics.Color; //導入方法依賴的package包/類
public Trajectory(Orbiter orbiter) {
    this.orbiter = orbiter;
    int degreeIncrement = 10;
    speed = 10;

    Array<Orbiter> pathObjects = new Array<Orbiter>();
    for(int i = 0; i < 360; i += degreeIncrement) {
        Orbiter.OrbiterBlueprint orbiterBlueprint = new Orbiter.OrbiterBlueprint();
        orbiterBlueprint.angle = i;
        orbiterBlueprint.angularVelocity = speed;
        orbiterBlueprint.radius = orbiter.getRadius();
        orbiterBlueprint.xTilt = orbiter.getXTilt();
        orbiterBlueprint.zTilt = orbiter.getZTilt();

        Sprite trajectoryDot = new Sprite(Scene.pixelTexture);
        Color color = new Color();
        Color.rgba8888ToColor(color, orbiter.getColor());
        trajectoryDot.setColor(color);
        trajectoryDot.setSize(2, 2);

        pathObjects.add(new Orbiter(trajectoryDot, orbiterBlueprint));
    }
    path = new Ring(pathObjects);
}
 
開發者ID:ZKasica,項目名稱:Planet-Generator,代碼行數:25,代碼來源:Trajectory.java

示例2: read

import com.badlogic.gdx.graphics.Color; //導入方法依賴的package包/類
@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);
    }

}
 
開發者ID:CypherCove,項目名稱:gdx-cclibs,代碼行數:18,代碼來源:ColorSerializer.java

示例3: createHighlightingGraphic

import com.badlogic.gdx.graphics.Color; //導入方法依賴的package包/類
private Texture createHighlightingGraphic(TextureRegion textureRegion)
{
	TextureData textureData = textureRegion.getTexture().getTextureData();
	textureData.prepare();
	Pixmap sourcePixmap = textureData.consumePixmap();
	Pixmap destinationPixmap = new Pixmap(textureRegion.getRegionWidth(), textureRegion.getRegionHeight(), Format.RGBA8888);
	Color color = new Color();

	for (int x = 0; x < textureRegion.getRegionWidth(); x++)
	{
		for (int y = 0; y < textureRegion.getRegionHeight(); y++)
		{
			int colorInt = sourcePixmap.getPixel(textureRegion.getRegionX() + x, textureRegion.getRegionY() + y);
			Color.rgba8888ToColor(color, colorInt);
			destinationPixmap.setColor(1.0f, 1f, 1.0f, 1);
			if (color.a > 0.004f)
				destinationPixmap.drawPixel(x, y);
		}
	}
	Texture result = new Texture(destinationPixmap);
	textureData.disposePixmap();
	destinationPixmap.dispose();
	return result;
}
 
開發者ID:MMORPG-Prototype,項目名稱:MMORPG_Prototype,代碼行數:25,代碼來源:GameObjectHighlightGraphic.java

示例4: getSourceCellType

import com.badlogic.gdx.graphics.Color; //導入方法依賴的package包/類
private PlanetCell.CellType getSourceCellType(Planet planet, int pixel) {
    for (PlanetData.CellType type : planet.data.types) {
        if (FauxPixMap.sameIsh(pixel, type.intColor)) {
            return type.type;
        }
    }
    Color.rgba8888ToColor(c, pixel);
    if (c.a != 0) {
        return PlanetCell.CellType.STATIC;
    }

    return null;
}
 
開發者ID:DaanVanYperen,項目名稱:odb-little-fortune-planet,代碼行數:14,代碼來源:PlanetStencilSystem.java


注:本文中的com.badlogic.gdx.graphics.Color.rgba8888ToColor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。