parent
861d007b27
commit
dacb43df3a
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.control.interf; |
||||
package mightypork.gamecore.control.timing; |
||||
|
||||
|
||||
/** |
@ -1,10 +1,10 @@ |
||||
package mightypork.gamecore.gui.constraints; |
||||
package mightypork.gamecore.control.timing; |
||||
|
||||
|
||||
import java.util.LinkedHashSet; |
||||
import java.util.Set; |
||||
|
||||
import mightypork.gamecore.control.interf.Pollable; |
||||
import mightypork.gamecore.gui.constraints.RectCache; |
||||
|
||||
|
||||
/** |
@ -1,4 +1,4 @@ |
||||
package mightypork.gamecore.control.interf; |
||||
package mightypork.gamecore.control.timing; |
||||
|
||||
|
||||
/** |
@ -0,0 +1,56 @@ |
||||
package mightypork.gamecore.gui.components.painters; |
||||
|
||||
|
||||
import mightypork.gamecore.gui.components.PluggableRenderer; |
||||
import mightypork.gamecore.render.Render; |
||||
import mightypork.utils.math.color.RGB; |
||||
|
||||
|
||||
/** |
||||
* Draws image in given rect |
||||
* |
||||
* @author MightyPork |
||||
*/ |
||||
public class QuadPainter extends PluggableRenderer { |
||||
|
||||
private final RGB colorHMinVMin; |
||||
private final RGB colorHMaxVMin; |
||||
private final RGB colorHMaxVMax; |
||||
private final RGB colorHMinVMax; |
||||
|
||||
|
||||
/** |
||||
* Painter with cokloured vertices. |
||||
* |
||||
* @param colorHMinVMin |
||||
* @param colorHMaxVMin |
||||
* @param colorHMaxVMax |
||||
* @param colorHMinVMax |
||||
*/ |
||||
public QuadPainter(RGB colorHMinVMin, RGB colorHMaxVMin, RGB colorHMaxVMax, RGB colorHMinVMax) { |
||||
this.colorHMinVMin = colorHMinVMin; |
||||
this.colorHMaxVMin = colorHMaxVMin; |
||||
this.colorHMaxVMax = colorHMaxVMax; |
||||
this.colorHMinVMax = colorHMinVMax; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public void render() |
||||
{ |
||||
Render.quadColor(getRect(), colorHMinVMin, colorHMaxVMin, colorHMaxVMax, colorHMinVMax); |
||||
} |
||||
|
||||
|
||||
public static QuadPainter gradH(RGB colorLeft, RGB colorRight) |
||||
{ |
||||
return new QuadPainter(colorLeft, colorRight, colorRight, colorLeft); |
||||
} |
||||
|
||||
|
||||
public static QuadPainter gradV(RGB colorTop, RGB colorBottom) |
||||
{ |
||||
return new QuadPainter(colorTop, colorTop, colorBottom, colorBottom); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue