use of su.levenetc.android.textsurface.Text in project TextSurface by elevenetc.
the class AlignSample method play.
public static void play(TextSurface textSurface) {
Text textCenter = TextBuilder.create("Center").setPosition(Align.SURFACE_CENTER).setPadding(25, 25, 25, 25).build();
//
Text textLeft = TextBuilder.create("L").setPadding(20, 20, 20, 20).setPosition(Align.LEFT_OF | Align.CENTER_OF, textCenter).build();
Text textRight = TextBuilder.create("R").setPadding(20, 20, 20, 20).setPosition(Align.RIGHT_OF | Align.CENTER_OF, textCenter).build();
Text textTop = TextBuilder.create("T").setPosition(Align.TOP_OF | Align.CENTER_OF, textCenter).build();
Text textBottom = TextBuilder.create("B").setPosition(Align.BOTTOM_OF | Align.CENTER_OF, textCenter).build();
//
Text textBottomBottom = TextBuilder.create("BB").setPosition(Align.BOTTOM_OF | Align.CENTER_OF, textBottom).build();
//
Text textLeftTop = TextBuilder.create("LT").setPosition(Align.LEFT_OF | Align.TOP_OF, textCenter).build();
Text textRightTop = TextBuilder.create("RT").setPosition(Align.RIGHT_OF | Align.TOP_OF, textCenter).build();
Text textLeftBottom = TextBuilder.create("LB").setPosition(Align.LEFT_OF | Align.BOTTOM_OF, textCenter).build();
Text textRightBottom = TextBuilder.create("RB").setPosition(Align.BOTTOM_OF | Align.RIGHT_OF, textCenter).build();
final int duration = 125;
textSurface.play(TYPE.SEQUENTIAL, Alpha.show(textCenter, duration), Alpha.show(textRight, duration), Alpha.show(textTop, duration), Alpha.show(textLeft, duration), Alpha.show(textBottom, duration), Alpha.show(textLeftTop, duration), Alpha.show(textLeftBottom, duration), Alpha.show(textRightBottom, duration), Alpha.show(textRightTop, duration), Alpha.show(textBottomBottom, duration));
}
use of su.levenetc.android.textsurface.Text in project TextSurface by elevenetc.
the class ScaleTextSample method run.
public static void run(TextSurface textSurface) {
// Text textA = TextBuilder.create("oat cake")
//// .setScale(2.0f, Pivot.RIGHT)
// .build();
//
// textSurface.play(TYPE.SEQUENTIAL,
// //Just.show(textA)
// new Scale(textA, 1000, 0.1f, 1.5f, Pivot.RIGHT)
// );
Text textA = TextBuilder.create("textA").build();
Text textB = TextBuilder.create("textB").setPosition(Align.LEFT_OF, textA).build();
Text textC = TextBuilder.create("textC").setPosition(Align.RIGHT_OF, textA).build();
Text textD = TextBuilder.create("textD").setPosition(Align.LEFT_OF, textB).build();
Text textE = TextBuilder.create("textE").setPosition(Align.RIGHT_OF, textC).build();
textSurface.play(TYPE.PARALLEL, Just.show(textA, textB), new Sequential(new Scale(textA, 1000, 1, 2, Pivot.CENTER), new Scale(textA, 1000, 2, 1, Pivot.CENTER)));
}
use of su.levenetc.android.textsurface.Text in project TextSurface by elevenetc.
the class ShapeRevealSample method play.
public static void play(TextSurface textSurface) {
Text textA = TextBuilder.create("Now why you loer en kyk gelyk?").setPosition(Align.SURFACE_CENTER).build();
Text textB = TextBuilder.create("Is ek miskien van goud gemake?").setPosition(Align.BOTTOM_OF | Align.CENTER_OF, textA).build();
Text textC = TextBuilder.create("You want to fight, you come tonight.").setPosition(Align.BOTTOM_OF | Align.CENTER_OF, textB).build();
Text textD = TextBuilder.create("Ek moer jou sleg! So jy hardloop weg.").setPosition(Align.BOTTOM_OF | Align.CENTER_OF, textC).build();
final int flash = 1500;
textSurface.play(TYPE.SEQUENTIAL, Rotate3D.showFromCenter(textA, 500, Direction.CLOCK, Axis.X), new AnimationsSet(TYPE.PARALLEL, ShapeReveal.create(textA, flash, SideCut.hide(Side.LEFT), false), new AnimationsSet(TYPE.SEQUENTIAL, Delay.duration(flash / 4), ShapeReveal.create(textA, flash, SideCut.show(Side.LEFT), false))), new AnimationsSet(TYPE.PARALLEL, Rotate3D.showFromSide(textB, 500, Pivot.TOP), new TransSurface(500, textB, Pivot.CENTER)), Delay.duration(500), new AnimationsSet(TYPE.PARALLEL, Slide.showFrom(Side.TOP, textC, 500), new TransSurface(1000, textC, Pivot.CENTER)), Delay.duration(500), new AnimationsSet(TYPE.PARALLEL, ShapeReveal.create(textD, 500, Circle.show(Side.CENTER, Direction.OUT), false), new TransSurface(1500, textD, Pivot.CENTER)), Delay.duration(500), new AnimationsSet(TYPE.PARALLEL, new AnimationsSet(TYPE.PARALLEL, Alpha.hide(textD, 700), ShapeReveal.create(textD, 1000, SideCut.hide(Side.LEFT), true)), new AnimationsSet(TYPE.SEQUENTIAL, Delay.duration(500), new AnimationsSet(TYPE.PARALLEL, Alpha.hide(textC, 700), ShapeReveal.create(textC, 1000, SideCut.hide(Side.LEFT), true))), new AnimationsSet(TYPE.SEQUENTIAL, Delay.duration(1000), new AnimationsSet(TYPE.PARALLEL, Alpha.hide(textB, 700), ShapeReveal.create(textB, 1000, SideCut.hide(Side.LEFT), true))), new AnimationsSet(TYPE.SEQUENTIAL, Delay.duration(1500), new AnimationsSet(TYPE.PARALLEL, Alpha.hide(textA, 700), ShapeReveal.create(textA, 1000, SideCut.hide(Side.LEFT), true))), new TransSurface(4000, textA, Pivot.CENTER)));
}
use of su.levenetc.android.textsurface.Text in project TextSurface by elevenetc.
the class SurfaceScaleSample method play.
public static void play(TextSurface textSurface) {
Text textA = TextBuilder.create("How are you?").setPosition(Align.SURFACE_CENTER).build();
Text textB = TextBuilder.create("Would you mind?").setPosition(Align.BOTTOM_OF | Align.CENTER_OF, textA).build();
Text textC = TextBuilder.create("Yes!").setPosition(Align.BOTTOM_OF | Align.CENTER_OF, textB).build();
textSurface.play(TYPE.SEQUENTIAL, Alpha.show(textA, 500), new AnimationsSet(TYPE.PARALLEL, new AnimationsSet(TYPE.PARALLEL, Alpha.show(textB, 500), Alpha.hide(textA, 500)), new ScaleSurface(500, textB, Fit.WIDTH)), Delay.duration(1000), new AnimationsSet(TYPE.PARALLEL, new AnimationsSet(TYPE.PARALLEL, Alpha.show(textC, 500), Alpha.hide(textB, 500)), new ScaleSurface(500, textC, Fit.WIDTH)));
}
use of su.levenetc.android.textsurface.Text in project TextSurface by elevenetc.
the class SurfaceTransSample method play.
public static void play(TextSurface textSurface) {
Text textA = TextBuilder.create("TextA").setPosition(Align.SURFACE_CENTER).build();
Text textB = TextBuilder.create("TextB").setPosition(Align.RIGHT_OF | Align.BOTTOM_OF, textA).build();
Text textC = TextBuilder.create("TextC").setPosition(Align.LEFT_OF | Align.BOTTOM_OF, textB).build();
Text textD = TextBuilder.create("TextD").setPosition(Align.RIGHT_OF | Align.BOTTOM_OF, textC).build();
int duration = 500;
textSurface.play(TYPE.SEQUENTIAL, Alpha.show(textA, duration), new AnimationsSet(TYPE.PARALLEL, Alpha.show(textB, duration), new TransSurface(duration, textB, Pivot.CENTER)), new AnimationsSet(TYPE.PARALLEL, Alpha.show(textC, duration), new TransSurface(duration, textC, Pivot.CENTER)), new AnimationsSet(TYPE.PARALLEL, Alpha.show(textD, duration), new TransSurface(duration, textD, Pivot.CENTER)), new TransSurface(duration, textC, Pivot.CENTER), new TransSurface(duration, textB, Pivot.CENTER), new TransSurface(duration, textA, Pivot.CENTER));
}
Aggregations