当前位置: 首页>>代码示例>>Java>>正文


Java ColorRGBA.Black方法代码示例

本文整理汇总了Java中com.jme3.math.ColorRGBA.Black方法的典型用法代码示例。如果您正苦于以下问题:Java ColorRGBA.Black方法的具体用法?Java ColorRGBA.Black怎么用?Java ColorRGBA.Black使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jme3.math.ColorRGBA的用法示例。


在下文中一共展示了ColorRGBA.Black方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: simpleInitApp

import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
@Override
public void simpleInitApp() {
    Quad quadMesh = new Quad(512,512);
    Geometry quad = new Geometry("Quad", quadMesh);
    quad.setQueueBucket(Bucket.Gui);

    mat = new Material(assetManager, "Common/MatDefs/Misc/ColoredTextured.j3md");
    mat.setTexture("ColorMap", assetManager.loadTexture("Textures/ColoredTex/Monkey.png"));
    quad.setMaterial(mat);
    guiNode.attachChildAt(quad, 0);

    nextColor = ColorRGBA.randomColor();
    prevColor = ColorRGBA.Black;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:15,代码来源:TestColoredTexture.java

示例2: doClearAlphaMap

import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
private void doClearAlphaMap(int selectedTextureIndex) {
    Terrain terrain = (Terrain) getTerrain(null);
    if (terrain == null)
        return;
    
    int alphaIdx = selectedTextureIndex/4; // 4 = rgba = 4 textures
    int texIndex = selectedTextureIndex - ((selectedTextureIndex/4)*4); // selectedTextureIndex/4 is an int floor
    //selectedTextureIndex - (alphaIdx * 4)
    Texture tex = doGetAlphaTexture(terrain, alphaIdx);
    Image image = tex.getImage();
    
    PaintTerrainToolAction paint = new PaintTerrainToolAction();
    
    ColorRGBA color = ColorRGBA.Black;
    for (int y=0; y<image.getHeight(); y++) {
        for (int x=0; x<image.getWidth(); x++) {
    
            paint.manipulatePixel(image, x, y, color, false); // gets the color at that location (false means don't write to the buffer)
            switch (texIndex) {
                case 0:
                    color.r = 0; break;
                case 1:
                    color.g = 0; break;
                case 2:
                    color.b = 0; break;
                case 3:
                    color.a = 0; break;
                default:
                    throw new IllegalArgumentException("Invalid texIndex " + texIndex);
            }
            color.clamp();
            paint.manipulatePixel(image, x, y, color, true); // set the new color
        }
    }
    image.getData(0).rewind();
    tex.getImage().setUpdateNeeded();
    setNeedsSave(true);
    alphaLayersChanged();
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:40,代码来源:TerrainEditorController.java

示例3: doClearAlphaMap

import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
public final static void doClearAlphaMap(Terrain terrain, int selectedTextureIndex) {
    int alphaIdx = selectedTextureIndex / 4; // 4 = rgba = 4 textures
    int texIndex = selectedTextureIndex - ((selectedTextureIndex/4)*4); // selectedTextureIndex/4 is an int floor
    //selectedTextureIndex - (alphaIdx * 4)
    Texture tex = doGetAlphaTexture(terrain, alphaIdx);
    Image image = tex.getImage();
    
    PaintTerrainToolAction paint = new PaintTerrainToolAction();
    
    ColorRGBA color = ColorRGBA.Black;
    for (int y=0; y<image.getHeight(); y++) {
        for (int x=0; x<image.getWidth(); x++) {
    
            paint.manipulatePixel(image, x, y, color, false); // gets the color at that location (false means don't write to the buffer)
            switch (texIndex) {
                case 0:
                    color.r = 0; break;
                case 1:
                    color.g = 0; break;
                case 2:
                    color.b = 0; break;
                case 3:
                    color.a = 0; break;
            }
            color.clamp();
            paint.manipulatePixel(image, x, y, color, true); // set the new color
        }
    }
    image.getData(0).rewind();
    tex.getImage().setUpdateNeeded();
}
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:32,代码来源:TerrainUtils.java

示例4: ColorFieldControl

import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
public ColorFieldControl(BaseScreen screen) {
	this(screen, ColorRGBA.Black, false);
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:4,代码来源:ColorFieldControl.java

示例5: parseColor

import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
private ColorRGBA parseColor(String str) {
	if (str.equals("black")) {
		return ColorRGBA.Black;
	} else if (str.equals("blue")) {
		return ColorRGBA.Blue;
	} else if (str.equals("brown")) {
		return ColorRGBA.Brown;
	} else if (str.equals("cyan")) {
		return ColorRGBA.Cyan;
	} else if (str.equals("darkgray")) {
		return ColorRGBA.DarkGray;
	} else if (str.equals("gray")) {
		return ColorRGBA.Gray;
	} else if (str.equals("green")) {
		return ColorRGBA.Green;
	} else if (str.equals("lightgray")) {
		return ColorRGBA.LightGray;
	} else if (str.equals("magenta")) {
		return ColorRGBA.Magenta;
	} else if (str.equals("orange")) {
		return ColorRGBA.Orange;
	} else if (str.equals("pink")) {
		return ColorRGBA.Pink;
	} else if (str.equals("red")) {
		return ColorRGBA.Red;
	} else if (str.equals("white")) {
		return ColorRGBA.White;
	} else if (str.equals("yellow")) {
		return ColorRGBA.Yellow;
	} else {
		Pattern pattern = Pattern.compile("^\\s*#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})\\s*$");
		Matcher m = pattern.matcher(str);
		if (m.find()) {
			int r = Integer.parseInt(m.group(1), 16);
			int g = Integer.parseInt(m.group(2), 16);
			int b = Integer.parseInt(m.group(3), 16);
			ColorRGBA color = new ColorRGBA();
			color.fromIntRGBA((r << 24) + (g << 16) + (b << 8) + 0xff);
			return color;
		}
		throw new IllegalArgumentException("could not parse '" + str + "'");
	}
}
 
开发者ID:dwhuang,项目名称:SMILE,代码行数:44,代码来源:Table.java

示例6: getBrushColor

import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
/**
 * Gets brush color.
 *
 * @return the brush color.
 */
@NotNull
protected ColorRGBA getBrushColor() {
    return ColorRGBA.Black;
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:10,代码来源:TerrainToolControl.java


注:本文中的com.jme3.math.ColorRGBA.Black方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。