本文整理汇总了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;
}