Returns an entity based on Label.
(label "I'm a label" (color :white)) (label "I'm a label" (style :label (bitmap-font) (color :white))) (label "I'm a label" (skin "uiskin.json"))
Options
:draw^Batch batch, ^float parent-alpha
:get-font-scale-x
:get-font-scale-y
:get-glyph-layout
:get-label-align
:get-line-align
:get-pref-height
:get-pref-width
:get-style
Returns the label's style. Modifying the returned style may not have an effect until {@link #setStyle(LabelStyle)} is
called.
:get-text
:invalidate
:layout
:set-alignment^int alignment
:set-alignment^int label-align, ^int line-align
:set-ellipsis^String ellipsis
When non-null the text will be truncated "..." if it does not fit within the width of the label. Wrapping will not occur
when ellipsis is enabled. Default is false.
:set-ellipsis^boolean ellipsis
When true the text will be truncated "..." if it does not fit within the width of the label. Wrapping will not occur when
ellipsis is true. Default is false.
:set-font-scale^float font-scale
:set-font-scale^float font-scale-x, ^float font-scale-y
:set-font-scale-x^float font-scale-x
:set-font-scale-y^float font-scale-y
:set-style^Label.LabelStyle style
:set-text^CharSequence new-text
:set-wrap^boolean wrap
If false, the text will only wrap where it contains newlines (\n). The preferred size of the label will be the text bounds.
If true, the text will word wrap using the width of the label. The preferred width of the label will be 0, it is expected
that the something external will set the width of the label. Wrapping will not occur when ellipsis is enabled. Default is
false.
When wrap is enabled, the label's preferred height depends on the width of the label. In some cases the parent of the label will need to layout twice: once to set the width of the label and a second time to adjust to the label's new preferred height.
:text-equals^CharSequence other
:to-string
Source
(defn label*
[^String text arg]
(ActorEntity.
(if (instance? Color arg)
(Label. text (style :label (g2d/bitmap-font) arg))
(Label. text arg))))(defmacro label
[text arg & options]
`(let [entity# (label* ~text ~arg)]
(u/calls! ^Label (u/get-obj entity# :object) ~@options)
entity#))