本文整理汇总了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;
}
示例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();
}
示例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();
}
示例4: ColorFieldControl
import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
public ColorFieldControl(BaseScreen screen) {
this(screen, ColorRGBA.Black, false);
}
示例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 + "'");
}
}
示例6: getBrushColor
import com.jme3.math.ColorRGBA; //导入方法依赖的package包/类
/**
* Gets brush color.
*
* @return the brush color.
*/
@NotNull
protected ColorRGBA getBrushColor() {
return ColorRGBA.Black;
}