Class Transition
java.lang.Object
org.openpatch.scratch.Transition
How one stage gives way to the next in
window.transitionToStage(…). A transition is a
small shader that mixes the old stage's picture (from) and the new one's (to)
by progress, from 0 to 1; the built-in ones cover the usual cases, and
fromShader(String) makes one of your own:
void main() {
color = mix(texture(from, uv), texture(to, uv), progress);
}
During a transition the old stage stands still, the new stage's run() starts once the
transition is over, and input is ignored.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TransitionBlends the old stage into the new one.static final TransitionFades the old stage to black, then the new one in.static final TransitionThe new stage pushes the old one out downwards.static final TransitionThe new stage pushes the old one out to the left.static final TransitionThe new stage pushes the old one out to the right.static final TransitionThe new stage pushes the old one out upwards. -
Method Summary
Modifier and TypeMethodDescriptionstatic TransitionfromShader(String path) A transition of your own: a shader body withfrom,to(the two pictures),progress(0 to 1),uvandcolor.getName()toString()
-
Field Details
-
FADE
Fades the old stage to black, then the new one in. -
CROSSFADE
Blends the old stage into the new one. -
SLIDE_LEFT
The new stage pushes the old one out to the left. -
SLIDE_RIGHT
The new stage pushes the old one out to the right. -
SLIDE_UP
The new stage pushes the old one out upwards. -
SLIDE_DOWN
The new stage pushes the old one out downwards.
-
-
Method Details
-
fromShader
A transition of your own: a shader body withfrom,to(the two pictures),progress(0 to 1),uvandcolor.- Parameters:
path- the file with the body- Returns:
- the transition
-
getName
- Returns:
- the built-in name or the shader file
-
toString
-