本文整理匯總了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);
}
示例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);
}
}
示例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;
}
示例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;
}