Java Code Examples for org.newdawn.slick.Color#multiply()

The following examples show how to use org.newdawn.slick.Color#multiply() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * Draw rectangle.
 *
 * @param x0 the x0
 * @param y0 the y0
 * @param x1 the x1
 * @param y1 the y1
 * @param depth the depth
 * @param c0 the c0
 * @param c1 the c1
 * @param c2 the c2
 * @param c3 the c3
 */
public static void drawRectangle(float x0, float y0, float x1, float y1,
		float depth, Color c0, Color c1, Color c2, Color c3) {
	glDisable(GL_TEXTURE_2D);
	glBegin(GL_QUADS);
	c0 = c0.multiply(color);
	c1 = c1.multiply(color);
	c2 = c2.multiply(color);
	c3 = c3.multiply(color);
	glColor4f(c0.r, c0.g, c0.b, c0.a);
	glVertex3f(x0, y0, depth);
	glColor4f(c1.r, c1.g, c1.b, c1.a);
	glVertex3f(x1, y0, depth);
	glColor4f(c2.r, c2.g, c2.b, c2.a);
	glVertex3f(x1, y1, depth);
	glColor4f(c3.r, c3.g, c3.b, c3.a);
	glVertex3f(x0, y1, depth);
	glEnd();
	glEnable(GL_TEXTURE_2D);
	if(clip != null && !clip.persistent) clip.destroy();
}
 
Example 2
/**
 * Draw line.
 *
 * @param x0 the x0
 * @param y0 the y0
 * @param x the x
 * @param y the y
 * @param width the width
 * @param depth the depth
 * @param c1 the c1
 * @param c2 the c2
 */
public static void drawLine(float x0, float y0, float x, float y,
		float width, float depth, Color c1, Color c2) {
	glDisable(GL_TEXTURE_2D);
	glLineWidth(width);

	// glLoadIdentity();
	glBegin(GL_LINES);
	c1 = c1.multiply(color);
	c2 = c2.multiply(color);
	glColor4f(c1.r, c1.g, c1.b, c1.a);
	glVertex3f(x0, y0, depth);
	glColor4f(c2.r, c2.g, c2.b, c2.a);
	glVertex3f(x, y, depth);
	glEnd();
	glEnable(GL_TEXTURE_2D);
	if(clip != null && !clip.persistent) clip.destroy();
}
 
Example 3
public static void drawRectangle(float x0, float y0, float x1, float y1,
		float depth, Color c0, Color c1, Color c2, Color c3) {
	glDisable(GL_TEXTURE_2D);
	glBegin(GL_QUADS);
	c0 = c0.multiply(color);
	c1 = c1.multiply(color);
	c2 = c2.multiply(color);
	c3 = c3.multiply(color);
	glColor4f(c0.r, c0.g, c0.b, c0.a);
	glVertex3f(x0, y0, depth);
	glColor4f(c1.r, c1.g, c1.b, c1.a);
	glVertex3f(x1, y0, depth);
	glColor4f(c2.r, c2.g, c2.b, c2.a);
	glVertex3f(x1, y1, depth);
	glColor4f(c3.r, c3.g, c3.b, c3.a);
	glVertex3f(x0, y1, depth);
	glEnd();
	glEnable(GL_TEXTURE_2D);
	if(clip != null && !clip.persistent) clip.destroy();
}
 
Example 4
public static void drawLine(float x0, float y0, float x, float y,
		float width, float depth, Color c1, Color c2) {
	glDisable(GL_TEXTURE_2D);
	glLineWidth(width);

	// glLoadIdentity();
	glBegin(GL_LINES);
	c1 = c1.multiply(color);
	c2 = c2.multiply(color);
	glColor4f(c1.r, c1.g, c1.b, c1.a);
	glVertex3f(x0, y0, depth);
	glColor4f(c2.r, c2.g, c2.b, c2.a);
	glVertex3f(x, y, depth);
	glEnd();
	glEnable(GL_TEXTURE_2D);
	if(clip != null && !clip.persistent) clip.destroy();
}
 
Example 5
/**
 * Draw triangle.
 *
 * @param x0 the x0
 * @param y0 the y0
 * @param x the x
 * @param y the y
 * @param x2 the x2
 * @param y2 the y2
 * @param depth the depth
 * @param c the c
 */
public static void drawTriangle(float x0, float y0, float x, float y,
		float x2, float y2, float depth, Color c) {
	c.bind();
	glDisable(GL_TEXTURE_2D);
	c = c.multiply(color);
	glColor4f(c.r, c.g, c.b, c.a);
	glBegin(GL_TRIANGLES);
	glVertex3f(x0, y0, depth);
	glVertex3f(x, y, depth);
	glVertex3f(x2, y2, depth);
	glEnd();
	glEnable(GL_TEXTURE_2D);
	if(clip != null && !clip.persistent) clip.destroy();
}
 
Example 6
public static void drawTriangle(float x0, float y0, float x, float y,
		float x2, float y2, float depth, Color c) {
	c.bind();
	glDisable(GL_TEXTURE_2D);
	c = c.multiply(color);
	glColor4f(c.r, c.g, c.b, c.a);
	glBegin(GL_TRIANGLES);
	glVertex3f(x0, y0, depth);
	glVertex3f(x, y, depth);
	glVertex3f(x2, y2, depth);
	glEnd();
	glEnable(GL_TEXTURE_2D);
	if(clip != null && !clip.persistent) clip.destroy();
}