UncivTooltip

class UncivTooltip<T : Actor>(target: Group, content: T, targetAlign: Int, tipAlign: Int, offset: Vector2, animate: Boolean, forceContentSize: Vector2?) : InputListener

A Replacement for Gdx Tooltip, placement does not follow the mouse.

Usage: group.addTooltip(text, size) builds a Label as tip actor and attaches it to your Group.

Parameters

target

The widget the tooltip will be added to - take care this is the same for which addListener is called

content

The actor to display as Tooltip

targetAlign

Point on the target widget to align the Tooltip to

tipAlign

Point on the Tooltip to align with the given point on the target

offset

Additional offset for Tooltip position after alignment

animate

Use show/hide animations

forceContentSize

Force virtual content width/height for alignment calculation - because Gdx auto layout reports wrong dimensions on scaled actors.

Constructors

UncivTooltip
Link copied to clipboard
fun <T : Actor> UncivTooltip(target: Group, content: T, targetAlign: Int = Align.topRight, tipAlign: Int = Align.topRight, offset: Vector2 = Vector2.Zero, animate: Boolean = true, forceContentSize: Vector2? = null)

Types

Companion
Link copied to clipboard
object Companion
TipState
Link copied to clipboard
enum TipState : Enum<UncivTooltip.TipState>

Functions

enter
Link copied to clipboard
open override fun enter(event: InputEvent?, x: Float, y: Float, pointer: Int, fromActor: Actor?)
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
exit
Link copied to clipboard
open override fun exit(event: InputEvent?, x: Float, y: Float, pointer: Int, toActor: Actor?)
getEdgePoint
Link copied to clipboard
private fun Actor.getEdgePoint(align: Int): Vector2
getOriginX
Link copied to clipboard
private fun getOriginX(width: Float, align: Int): Float
getOriginY
Link copied to clipboard
private fun getOriginY(height: Float, align: Int): Float
handle
Link copied to clipboard
open override fun handle(p0: Event): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
hide
Link copied to clipboard
fun hide(immediate: Boolean = false)

Hide the Tooltip (immediately or begin the animation). Can be called programmatically.

keyDown
Link copied to clipboard
open fun keyDown(p0: InputEvent, p1: Int): Boolean
keyTyped
Link copied to clipboard
open fun keyTyped(p0: InputEvent, p1: Char): Boolean
keyUp
Link copied to clipboard
open fun keyUp(p0: InputEvent, p1: Int): Boolean
mouseMoved
Link copied to clipboard
open fun mouseMoved(p0: InputEvent, p1: Float, p2: Float): Boolean
scrolled
Link copied to clipboard
open fun scrolled(p0: InputEvent, p1: Float, p2: Float, p3: Float, p4: Float): Boolean
show
Link copied to clipboard
fun show(immediate: Boolean = false)

Show the Tooltip (immediately or begin the animation). Can be called programmatically.

toString
Link copied to clipboard
open fun toString(): String
touchDown
Link copied to clipboard
open override fun touchDown(event: InputEvent?, x: Float, y: Float, pointer: Int, button: Int): Boolean
touchDragged
Link copied to clipboard
open fun touchDragged(p0: InputEvent, p1: Float, p2: Float, p3: Int)
touchUp
Link copied to clipboard
open fun touchUp(p0: InputEvent, p1: Float, p2: Float, p3: Int, p4: Int)

Properties

animate
Link copied to clipboard
val animate: Boolean = true
container
Link copied to clipboard
private val container: Container<T>
content
Link copied to clipboard
val content: T
contentHeight
Link copied to clipboard
private val contentHeight: Float
contentWidth
Link copied to clipboard
private val contentWidth: Float
offset
Link copied to clipboard
val offset: Vector2
state
Link copied to clipboard
var state: UncivTooltip.TipState

current visibility state of the Tooltip

target
Link copied to clipboard
val target: Group
targetAlign
Link copied to clipboard
val targetAlign: Int
tipAlign
Link copied to clipboard
val tipAlign: Int

Sources

jvm source
Link copied to clipboard