WIP new UI elem

This commit is contained in:
minjaesong
2018-12-08 23:10:48 +09:00
committed by Minjae Song
parent 4b04bf3781
commit 6f0a923df7
9 changed files with 294 additions and 94 deletions

View File

@@ -1,8 +1,10 @@
package net.torvald.terrarum.ui
import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.Texture
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.BlendMode
import net.torvald.terrarum.GdxColorMap
import java.awt.Color
/**
@@ -16,6 +18,9 @@ class UIItemIntSlider(
val minValue: Int,
val maxValue: Int,
val step: Int,
// BASIC OPTIONS //
/** Show prev- and next values (if any) */
var showNotches: Boolean,
var showMinMaxValues: Boolean,
@@ -27,8 +32,12 @@ class UIItemIntSlider(
val notchCol: Color,
val barCol: Color,
val barAndNotchBlend: BlendMode
val barAndNotchBlend: BlendMode,
// EXTENDED OPTIONS //
val sliderUseColourMap: GdxColorMap? = null,
val sliderUseTexture: Texture? = null
) : UIItem(parent) {
constructor(
@@ -61,6 +70,11 @@ class UIItemIntSlider(
var value = initValue
init {
if (sliderUseColourMap != null && sliderUseTexture != null) {
throw IllegalArgumentException("Can't use colour map and texture at the same time -- ColorMap: $sliderUseColourMap, Texture: $sliderUseTexture")
}
}
// TODO unimplemented

View File

@@ -0,0 +1,19 @@
package net.torvald.terrarum.ui
import net.torvald.terrarum.Yaml
/**
* Created by minjaesong on 2018-12-08.
*/
/*class UIItemNSMenus(
parent: UICanvas,
var title: String? = null,
override var posX: Int,
override var posY: Int,
override var width: Int,
val tree: Yaml
) : UIItem(parent) {
override val height: Int
get() = TODO("not implemented")
}*/