Widget(Dyn)Label should use DrawTarget.drawText

This commit is contained in:
bdew committed 2014-02-27 09:35:43 +02:00
1 parent 26137a88d7
commit 273735a976
3 files changed
+8 -14

No files matched your search

-6
View File
@@ -1,6 +0,0 @@
import net.bdew.lib.gui._
val a = Rect(1, 1, 2, 2)
a.contains(Point(1.5F, 1.5F))
@@ -9,11 +9,11 @@
package net.bdew.lib.gui.widgets
import net.bdew.lib.gui.{Point, Rect}
import net.bdew.lib.gui.{Color, Point, Rect}
class WidgetDynLabel(text: => String, x: Int, y: Int, color: Int) extends Widget {
val rect: Rect = new Rect(x, y, 0, 0)
class WidgetDynLabel(text: => String, x: Int, y: Int, color: Color) extends Widget {
val rect = new Rect(x, y, 0, 0)
override def draw(mouse: Point) {
parent.getFontRenderer.drawString(text, x, y, color)
parent.drawText(text, rect.origin, color, false)
}
}
@@ -9,11 +9,11 @@
package net.bdew.lib.gui.widgets
import net.bdew.lib.gui.{Point, Rect}
import net.bdew.lib.gui.{Color, Point, Rect}
class WidgetLabel(text: String, x: Int, y: Int, color: Int) extends Widget {
val rect: Rect = new Rect(x, y, 0, 0)
class WidgetLabel(text: String, x: Int, y: Int, color: Color) extends Widget {
val rect = new Rect(x, y, 0, 0)
override def draw(mouse: Point) {
parent.getFontRenderer.drawString(text, x, y, color)
parent.drawText(text, rect.origin, color, false)
}
}