2019-06-23 22:23:59 +00:00
|
|
|
package net.shadowfacts.cacao.view
|
|
|
|
|
|
|
|
import net.shadowfacts.cacao.geometry.Point
|
|
|
|
import net.shadowfacts.cacao.util.RenderHelper
|
2019-06-26 23:32:06 +00:00
|
|
|
import net.shadowfacts.cacao.util.texture.Texture
|
2019-06-23 22:23:59 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A helper class for drawing a [Texture] in a view.
|
|
|
|
* `TextureView` will draw the given texture filling the bounds of the view.
|
|
|
|
*
|
|
|
|
* @author shadowfacts
|
|
|
|
*/
|
2019-06-24 02:21:59 +00:00
|
|
|
class TextureView(var texture: Texture): View() {
|
2019-06-23 22:23:59 +00:00
|
|
|
|
|
|
|
override fun drawContent(mouse: Point, delta: Float) {
|
|
|
|
RenderHelper.draw(bounds, texture)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|