當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。