當前位置: 首頁>>代碼示例>>Java>>正文


Java ColorRGBA.White方法代碼示例

本文整理匯總了Java中com.jme3.math.ColorRGBA.White方法的典型用法代碼示例。如果您正苦於以下問題:Java ColorRGBA.White方法的具體用法?Java ColorRGBA.White怎麽用?Java ColorRGBA.White使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.jme3.math.ColorRGBA的用法示例。


在下文中一共展示了ColorRGBA.White方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ColorPaletteTab

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
public ColorPaletteTab(BaseScreen screen) {
	super(screen);

	setLayoutManager(new BorderLayout(8, 8));

	ColorCell cell = new ColorCell(screen, ColorRGBA.White);
	cellSize = cell.calcPreferredSize();

	selectedCell = new Element(screen);
	selectedCell.setStyleClass("cell-selected");

	huePicker = new HuePicker(screen, restrictionType);
	addElement(huePicker, Border.CENTER);
	barPalette = new BrightnessPicker(screen, restrictionType);
	addElement(barPalette, Border.SOUTH);
	rebuild();
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:18,代碼來源:ColorPaletteTab.java

示例2: BrightnessPicker

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
BrightnessPicker(BaseScreen screen, ColorRestrictionType restrictionType) {
	super(screen, restrictionType);
	setLayoutManager(new BrightnessLayout());
	for (int i = 0; i < MAX_BRIGHTNESS_BAR - (restrictionType.getValueBar() * 2); i++) {
		ColorCell cell = new ColorCell(screen, ColorRGBA.White);
		cell.onMousePressed(evt -> {
			barPalette.setSelected(cell);
			mBrightness = ExtrasUtil.toHSB(cell.getDefaultColor())[2];
			updateHuePalette();
			updateBrightnessPalette();
			onChange(cell.getDefaultColor());
		});
		addElement(cell);
	}

}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:17,代碼來源:ColorPaletteTab.java

示例3: genNormalLines

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
public static Mesh genNormalLines(Mesh mesh, float scale) {
    FloatBuffer vertexBuffer = (FloatBuffer) mesh.getBuffer(Type.Position).getData();
    FloatBuffer normalBuffer = (FloatBuffer) mesh.getBuffer(Type.Normal).getData();

    ColorRGBA originColor = ColorRGBA.White;
    ColorRGBA normalColor = ColorRGBA.Blue;

    Mesh lineMesh = new Mesh();
    lineMesh.setMode(Mesh.Mode.Lines);

    Vector3f origin = new Vector3f();
    Vector3f point = new Vector3f();

    FloatBuffer lineVertex = BufferUtils.createFloatBuffer(vertexBuffer.capacity() * 2);
    FloatBuffer lineColor = BufferUtils.createFloatBuffer(vertexBuffer.capacity() / 3 * 4 * 2);

    for (int i = 0; i < vertexBuffer.capacity() / 3; i++) {
        populateFromBuffer(origin, vertexBuffer, i);
        populateFromBuffer(point, normalBuffer, i);

        int index = i * 2;

        setInBuffer(origin, lineVertex, index);
        setInBuffer(originColor, lineColor, index);

        point.multLocal(scale);
        point.addLocal(origin);
        setInBuffer(point, lineVertex, index + 1);
        setInBuffer(normalColor, lineColor, index + 1);
    }

    lineMesh.setBuffer(Type.Position, 3, lineVertex);
    lineMesh.setBuffer(Type.Color, 4, lineColor);

    lineMesh.setStatic();
    lineMesh.setInterleaved();
    return lineMesh;
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:39,代碼來源:TangentBinormalGenerator.java

示例4: calcFontColor

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
public static ColorRGBA calcFontColor(ElementContainer<?, ?> container) {
	ColorRGBA f = container.getFontColor();
	if (f == null) {
		ElementContainer<?, ?> p = container.getParentContainer();
		while (p != null && f == null) {
			f = p.getFontColor();
			p = p.getParentContainer();
		}
		if (f == null)
			f = ColorRGBA.White;
	}
	return f;

}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:15,代碼來源:BaseElement.java

示例5: HuePicker

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
HuePicker(BaseScreen screen, ColorRestrictionType restrictionType) {
	super(screen, restrictionType);
	setLayoutManager(new HueLayout());
	int wheelLevel = restrictionType.getWheelLevel();
	float startY = wheelLevel;
	int endY = 13 - wheelLevel;
	int midY = (int) endY / 2;
	float startX = wheelLevel;
	for (float y = startY; y < endY; y++) {
		int m = midY + 1 + (int) y - wheelLevel;
		if (y > midY) {
			m = endY - ((int) y - midY);
		}
		for (float x = startX; x < m; x++) {
			ColorCell cell = new ColorCell(screen, ColorRGBA.White);
			cell.onMouseReleased(evt -> {
				Vector2f offset = ((HueLayout) getLayoutManager()).getOffset(huePicker);
				huePicker.setSelected(cell);
				float cx = 6 * cellSize.x - 6 * (cellSize.x / 2);
				float cy = 6 * ColorPaletteTab.this.getIndent();
				Vector2f pos = cell.getPosition();
				float[] polar = getPolar(pos.x - cx - offset.x, pos.y - cy - offset.y);
				mHue = polar[1] / (FastMath.PI * 2f);
				mSaturation = polar[0] / (cellSize.x * 5.5f);
				updateBrightnessPalette();
				onChange(cell.getDefaultColor());
			});
			addElement(cell);
		}
	}
	layoutChildren();
}
 
開發者ID:rockfireredmoon,項目名稱:icetone,代碼行數:33,代碼來源:ColorPaletteTab.java

示例6: getColor

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
/**
 * Sets a color at a given index.
 * If that color is null, it searches backwards
 * through the array for a non-null value.
 * 
 * @param index	The index of the color
 * @return		The color
 */
public ColorRGBA getColor(int index) {
	if(colors[index] == null) {
		if(index == 0) {
			colors[index] = ColorRGBA.White;
		} else {
			colors[index] = getColor(index-1);
		}
	}
	return colors[index];
}
 
開發者ID:MisterCavespider,項目名稱:Lina,代碼行數:19,代碼來源:LineArray.java

示例7: genNormalLines

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
public static Mesh genNormalLines(Mesh mesh, float scale) {
	FloatBuffer vertexBuffer = (FloatBuffer) mesh.getBuffer(Type.Position).getData();
	FloatBuffer normalBuffer = (FloatBuffer) mesh.getBuffer(Type.Normal).getData();

	ColorRGBA originColor = ColorRGBA.White;
	ColorRGBA normalColor = ColorRGBA.Blue;

	Mesh lineMesh = new Mesh();
	lineMesh.setMode(Mesh.Mode.Lines);

	Vector3f origin = new Vector3f();
	Vector3f point = new Vector3f();

	FloatBuffer lineVertex = BufferUtils.createFloatBuffer(vertexBuffer.limit() * 2);
	FloatBuffer lineColor = BufferUtils.createFloatBuffer(vertexBuffer.limit() / 3 * 4 * 2);

	for (int i = 0; i < vertexBuffer.limit() / 3; i++) {
		populateFromBuffer(origin, vertexBuffer, i);
		populateFromBuffer(point, normalBuffer, i);

		int index = i * 2;

		setInBuffer(origin, lineVertex, index);
		setInBuffer(originColor, lineColor, index);

		point.multLocal(scale);
		point.addLocal(origin);
		setInBuffer(point, lineVertex, index + 1);
		setInBuffer(normalColor, lineColor, index + 1);
	}

	lineMesh.setBuffer(Type.Position, 3, lineVertex);
	lineMesh.setBuffer(Type.Color, 4, lineColor);

	lineMesh.setStatic();
	// lineMesh.setInterleaved();
	return lineMesh;
}
 
開發者ID:meltzow,項目名稱:supernovae,代碼行數:39,代碼來源:SilentTangentBinormalGenerator.java

示例8: UnshadedColor

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
public UnshadedColor() {
    this(ColorRGBA.White);
}
 
開發者ID:jvpichowski,項目名稱:ZayES-Bullet,代碼行數:4,代碼來源:UnshadedColor.java

示例9: ShadedColor

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
public ShadedColor() {
    this(ColorRGBA.White);
}
 
開發者ID:jvpichowski,項目名稱:ZayES-Bullet,代碼行數:4,代碼來源:ShadedColor.java

示例10: getBrushColor

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
@NotNull
@Override
protected ColorRGBA getBrushColor() {
    return ColorRGBA.White;
}
 
開發者ID:JavaSaBr,項目名稱:jmonkeybuilder,代碼行數:6,代碼來源:SlopeTerrainToolControl.java

示例11: simpleInitApp

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
@Override
    public void simpleInitApp() {
        viewPort.addProcessor(this);
        renderManager.setForcedTechnique("GBuf");

//        flyCam.setEnabled(false);
        cam.setLocation(new Vector3f(4.8037705f, 4.851632f, 10.789033f));
        cam.setRotation(new Quaternion(-0.05143692f, 0.9483723f, -0.21131563f, -0.230846f));

        Node tank = (Node) assetManager.loadModel("Models/HoverTank/Tank2.mesh.xml");
        
        //tankMesh.getMaterial().setColor("Specular", ColorRGBA.Black);
        rootNode.attachChild(tank);

        display1 = new Picture("Picture");
        display1.move(0, 0, -1); // make it appear behind stats view
        display2 = (Picture) display1.clone();
        display3 = (Picture) display1.clone();
        display4 = (Picture) display1.clone();
        display  = (Picture) display1.clone();

        ColorRGBA[] colors = new ColorRGBA[]{
            ColorRGBA.White,
            ColorRGBA.Blue,
            ColorRGBA.Cyan,
            ColorRGBA.DarkGray,
            ColorRGBA.Green,
            ColorRGBA.Magenta,
            ColorRGBA.Orange,
            ColorRGBA.Pink,
            ColorRGBA.Red,
            ColorRGBA.Yellow
        };

        for (int i = 0; i < 3; i++){
            PointLight pl = new PointLight();
            float angle = 0.314159265f * i;
            pl.setPosition( new Vector3f(FastMath.cos(angle)*2f, 0,
                                         FastMath.sin(angle)*2f));
            pl.setColor(colors[i]);
            pl.setRadius(5);
            rootNode.addLight(pl);
            display.addLight(pl);
        }
    }
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:46,代碼來源:TestMultiRenderTarget.java

示例12: genTangentLines

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
private static Mesh genTangentLines(Mesh mesh, float scale) {
    FloatBuffer vertexBuffer = (FloatBuffer) mesh.getBuffer(Type.Position).getData();
    FloatBuffer normalBuffer = (FloatBuffer) mesh.getBuffer(Type.Normal).getData();
    FloatBuffer tangentBuffer = (FloatBuffer) mesh.getBuffer(Type.Tangent).getData();
    
    FloatBuffer binormalBuffer = null;
    if (mesh.getBuffer(Type.Binormal) != null) {
        binormalBuffer = (FloatBuffer) mesh.getBuffer(Type.Binormal).getData();
    }

    ColorRGBA originColor = ColorRGBA.White;
    ColorRGBA tangentColor = ColorRGBA.Red;
    ColorRGBA binormalColor = ColorRGBA.Green;
    ColorRGBA normalColor = ColorRGBA.Blue;

    Mesh lineMesh = new Mesh();
    lineMesh.setMode(Mesh.Mode.Lines);

    Vector3f origin = new Vector3f();
    Vector3f point = new Vector3f();
    Vector3f tangent = new Vector3f();
    Vector3f normal = new Vector3f();
    
    IntBuffer lineIndex = BufferUtils.createIntBuffer(vertexBuffer.capacity() / 3 * 6);
    FloatBuffer lineVertex = BufferUtils.createFloatBuffer(vertexBuffer.capacity() * 4);
    FloatBuffer lineColor = BufferUtils.createFloatBuffer(vertexBuffer.capacity() / 3 * 4 * 4);

    for (int i = 0; i < vertexBuffer.capacity() / 3; i++) {
        populateFromBuffer(origin, vertexBuffer, i);
        populateFromBuffer(normal, normalBuffer, i);
        populateFromBuffer(tangent, tangentBuffer, i);

        int index = i * 4;

        int id = i * 6;
        lineIndex.put(id, index);
        lineIndex.put(id + 1, index + 1);
        lineIndex.put(id + 2, index);
        lineIndex.put(id + 3, index + 2);
        lineIndex.put(id + 4, index);
        lineIndex.put(id + 5, index + 3);

        setInBuffer(origin, lineVertex, index);
        setInBuffer(originColor, lineColor, index);
        
        point.set(tangent);
        point.multLocal(scale);
        point.addLocal(origin);
        setInBuffer(point, lineVertex, index + 1);
        setInBuffer(tangentColor, lineColor, index + 1);

        if (binormalBuffer == null) {
            normal.cross(tangent, point);
            point.normalizeLocal();
        }
        else {
            populateFromBuffer(point, binormalBuffer, i);
        }
        point.multLocal(scale);
        point.addLocal(origin);
        setInBuffer(point, lineVertex, index + 2);
        setInBuffer(binormalColor, lineColor, index + 2);

        point.set(normal);
        point.multLocal(scale);
        point.addLocal(origin);
        setInBuffer(point, lineVertex, index + 3);
        setInBuffer(normalColor, lineColor, index + 3);
    }

    lineMesh.setBuffer(Type.Index, 1, lineIndex);
    lineMesh.setBuffer(Type.Position, 3, lineVertex);
    lineMesh.setBuffer(Type.Color, 4, lineColor);

    lineMesh.setStatic();
    lineMesh.setInterleaved();
    return lineMesh;
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:79,代碼來源:TangentBinormalGenerator.java

示例13: getColor

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
public ColorRGBA getColor() {
	return ColorRGBA.White;
}
 
開發者ID:dwhuang,項目名稱:SMILE,代碼行數:4,代碼來源:Table.java

示例14: 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

示例15: getButtonFontColor

import com.jme3.math.ColorRGBA; //導入方法依賴的package包/類
@Override
public ColorRGBA getButtonFontColor() {
    return ColorRGBA.White;
}
 
開發者ID:huliqing,項目名稱:LuoYing,代碼行數:5,代碼來源:UIConfigImpl.java


注:本文中的com.jme3.math.ColorRGBA.White方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。