ASMR/src/main/kotlin/net/shadowfacts/cacao/view/TextureView.kt

19 lines
483 B
Kotlin
Raw Normal View History

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
import net.shadowfacts.cacao.util.Texture
/**
* 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)
}
}