Interface SkyLayer
public interface SkyLayer
Runtime control over one layer of a skybox, on top of its definition. Found by name with
Skybox.layer(java.lang.String); the
handle stays valid across resource reloads, and a name the definition lacks is simply never drawn.
Durations are in ticks of real time (20 per second). Only use a layer from the render thread.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfloatalpha()The opacity multiplier set or animated here, 1 unless changed.animateAlpha(float target, int ticks, Easing easing) Moves the opacity multiplier totargetoverticks.animateParam(int index, int ticks, Easing easing, float... target) MovesSkyParams[index]totargetoverticks.animateTint(int argb, int ticks, Easing easing) Moves the tint to a packed ARGB color overticks.bindParam(int index, SkyLayer.ParamBinding binding) ComputesSkyParams[index]every frame, overriding set and animated values untilresetParams().default SkyLayerfadeIn(int ticks) default SkyLayerfadeOut(int ticks) booleanname()float[]param(int index) The current value ofSkyParams[index], as 4 floats.Goes back to the definition's params, dropping bindings and animations.Goes back to the definition's tint.setAlpha(float alpha) Multiplies the layer's opacity, clamped to[0, 1].setParam(int index, float... values) SetsSkyParams[index](0 to 3); missing components are 0.default SkyLayersetParamColor(int index, int argb) SetsSkyParams[index]to a packed ARGB color, as RGBA.setTint(int argb) Replaces the definition's tint with a packed ARGB color, its alpha the base opacity.setVisible(boolean visible) Shows or hides the layer at once.
-
Method Details
-
name
String name() -
setVisible
Shows or hides the layer at once. Layers start visible. -
isVisible
boolean isVisible() -
setAlpha
Multiplies the layer's opacity, clamped to[0, 1]. Stops any opacity animation. -
animateAlpha
Moves the opacity multiplier totargetoverticks. -
fadeIn
-
fadeOut
-
alpha
float alpha()The opacity multiplier set or animated here, 1 unless changed. -
setTint
Replaces the definition's tint with a packed ARGB color, its alpha the base opacity. Stops any tint animation. -
animateTint
Moves the tint to a packed ARGB color overticks. -
resetTint
SkyLayer resetTint()Goes back to the definition's tint. -
setParam
SetsSkyParams[index](0 to 3); missing components are 0. Stops any animation of it. -
setParamColor
SetsSkyParams[index]to a packed ARGB color, as RGBA. -
animateParam
MovesSkyParams[index]totargetoverticks. -
bindParam
ComputesSkyParams[index]every frame, overriding set and animated values untilresetParams(). -
resetParams
SkyLayer resetParams()Goes back to the definition's params, dropping bindings and animations. -
param
float[] param(int index) The current value ofSkyParams[index], as 4 floats.
-