当前位置: 首页>>代码示例>>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;未经允许,请勿转载。