Search in sources :

Example 1 with TransSurface

use of su.levenetc.android.textsurface.animations.TransSurface in project TextSurface by elevenetc.

the class CookieThumperSample method play.

public static void play(TextSurface textSurface, AssetManager assetManager) {
    final Typeface robotoBlack = Typeface.createFromAsset(assetManager, "fonts/Roboto-Black.ttf");
    Paint paint = new Paint();
    paint.setAntiAlias(true);
    paint.setTypeface(robotoBlack);
    Text textDaai = TextBuilder.create("Daai").setPaint(paint).setSize(64).setAlpha(0).setColor(Color.WHITE).setPosition(Align.SURFACE_CENTER).build();
    Text textBraAnies = TextBuilder.create("bra Anies").setPaint(paint).setSize(44).setAlpha(0).setColor(Color.RED).setPosition(Align.BOTTOM_OF, textDaai).build();
    Text textFokkenGamBra = TextBuilder.create(" hy's n fokken gam bra.").setPaint(paint).setSize(44).setAlpha(0).setColor(Color.RED).setPosition(Align.RIGHT_OF, textBraAnies).build();
    Text textHaai = TextBuilder.create("Haai!!").setPaint(paint).setSize(74).setAlpha(0).setColor(Color.RED).setPosition(Align.BOTTOM_OF, textFokkenGamBra).build();
    Text textDaaiAnies = TextBuilder.create("Daai Anies").setPaint(paint).setSize(44).setAlpha(0).setColor(Color.WHITE).setPosition(Align.BOTTOM_OF | Align.CENTER_OF, textHaai).build();
    Text texThyLamInnie = TextBuilder.create(" hy lam innie mang ja.").setPaint(paint).setSize(44).setAlpha(0).setColor(Color.WHITE).setPosition(Align.RIGHT_OF, textDaaiAnies).build();
    Text textThrowDamn = TextBuilder.create("Throw damn").setPaint(paint).setSize(44).setAlpha(0).setColor(Color.RED).setPosition(Align.BOTTOM_OF | Align.CENTER_OF, texThyLamInnie).build();
    Text textDevilishGang = TextBuilder.create("devilish gang").setPaint(paint).setSize(44).setAlpha(0).setColor(Color.RED).setPosition(Align.BOTTOM_OF | Align.CENTER_OF, textThrowDamn).build();
    Text textSignsInTheAir = TextBuilder.create("signs in the air.").setPaint(paint).setSize(44).setAlpha(0).setColor(Color.RED).setPosition(Align.BOTTOM_OF | Align.CENTER_OF, textDevilishGang).build();
    textSurface.play(new Sequential(ShapeReveal.create(textDaai, 750, SideCut.show(Side.LEFT), false), new Parallel(ShapeReveal.create(textDaai, 600, SideCut.hide(Side.LEFT), false), new Sequential(Delay.duration(300), ShapeReveal.create(textDaai, 600, SideCut.show(Side.LEFT), false))), new Parallel(new TransSurface(500, textBraAnies, Pivot.CENTER), ShapeReveal.create(textBraAnies, 1300, SideCut.show(Side.LEFT), false)), Delay.duration(500), new Parallel(new TransSurface(750, textFokkenGamBra, Pivot.CENTER), Slide.showFrom(Side.LEFT, textFokkenGamBra, 750), ChangeColor.to(textFokkenGamBra, 750, Color.WHITE)), Delay.duration(500), new Parallel(TransSurface.toCenter(textHaai, 500), Rotate3D.showFromSide(textHaai, 750, Pivot.TOP)), new Parallel(TransSurface.toCenter(textDaaiAnies, 500), Slide.showFrom(Side.TOP, textDaaiAnies, 500)), new Parallel(TransSurface.toCenter(texThyLamInnie, 750), Slide.showFrom(Side.LEFT, texThyLamInnie, 500)), Delay.duration(500), new Parallel(new TransSurface(1500, textSignsInTheAir, Pivot.CENTER), new Sequential(new Sequential(ShapeReveal.create(textThrowDamn, 500, Circle.show(Side.CENTER, Direction.OUT), false)), new Sequential(ShapeReveal.create(textDevilishGang, 500, Circle.show(Side.CENTER, Direction.OUT), false)), new Sequential(ShapeReveal.create(textSignsInTheAir, 500, Circle.show(Side.CENTER, Direction.OUT), false)))), Delay.duration(200), new Parallel(ShapeReveal.create(textThrowDamn, 1500, SideCut.hide(Side.LEFT), true), new Sequential(Delay.duration(250), ShapeReveal.create(textDevilishGang, 1500, SideCut.hide(Side.LEFT), true)), new Sequential(Delay.duration(500), ShapeReveal.create(textSignsInTheAir, 1500, SideCut.hide(Side.LEFT), true)), Alpha.hide(texThyLamInnie, 1500), Alpha.hide(textDaaiAnies, 1500))));
}
Also used : TransSurface(su.levenetc.android.textsurface.animations.TransSurface) Sequential(su.levenetc.android.textsurface.animations.Sequential) Typeface(android.graphics.Typeface) Text(su.levenetc.android.textsurface.Text) Paint(android.graphics.Paint) Parallel(su.levenetc.android.textsurface.animations.Parallel)

Example 2 with TransSurface

use of su.levenetc.android.textsurface.animations.TransSurface in project TextSurface by elevenetc.

the class ShapeRevealLoopSample 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(new Loop(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))));
}
Also used : Loop(su.levenetc.android.textsurface.animations.Loop) TransSurface(su.levenetc.android.textsurface.animations.TransSurface) Text(su.levenetc.android.textsurface.Text) AnimationsSet(su.levenetc.android.textsurface.animations.AnimationsSet)

Example 3 with TransSurface

use of su.levenetc.android.textsurface.animations.TransSurface in project TextSurface by elevenetc.

the class SlideSample method play.

public static void play(TextSurface textSurface) {
    Text textA = TextBuilder.create(" How are you?").build();
    Text textB = TextBuilder.create("I'm fine! ").setPosition(Align.LEFT_OF, textA).build();
    Text textC = TextBuilder.create("Are you sure?").setPosition(Align.BOTTOM_OF | Align.CENTER_OF, textB).build();
    Text textD = TextBuilder.create("Totally!").setPadding(10, 10, 10, 10).setPosition(Align.BOTTOM_OF | Align.CENTER_OF, textC).build();
    int duration = 1250;
    textSurface.play(TYPE.SEQUENTIAL, new AnimationsSet(TYPE.PARALLEL, new AnimationsSet(TYPE.SEQUENTIAL, new AnimationsSet(TYPE.PARALLEL, Slide.showFrom(Side.LEFT, textA, duration), Slide.showFrom(Side.RIGHT, textB, duration)), Slide.showFrom(Side.TOP, textC, duration), Slide.showFrom(Side.BOTTOM, textD, duration)), new TransSurface(duration * 3, textD, Pivot.CENTER)), new AnimationsSet(TYPE.PARALLEL, new AnimationsSet(TYPE.SEQUENTIAL, new AnimationsSet(TYPE.PARALLEL, Slide.hideFrom(Side.LEFT, textD, duration), Slide.hideFrom(Side.RIGHT, textC, duration)), Slide.hideFrom(Side.TOP, textB, duration), Slide.hideFrom(Side.BOTTOM, textA, duration)), new TransSurface(duration * 3, textA, Pivot.CENTER)));
}
Also used : TransSurface(su.levenetc.android.textsurface.animations.TransSurface) Text(su.levenetc.android.textsurface.Text) AnimationsSet(su.levenetc.android.textsurface.animations.AnimationsSet)

Example 4 with TransSurface

use of su.levenetc.android.textsurface.animations.TransSurface 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)));
}
Also used : TransSurface(su.levenetc.android.textsurface.animations.TransSurface) Text(su.levenetc.android.textsurface.Text) AnimationsSet(su.levenetc.android.textsurface.animations.AnimationsSet)

Example 5 with TransSurface

use of su.levenetc.android.textsurface.animations.TransSurface 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));
}
Also used : TransSurface(su.levenetc.android.textsurface.animations.TransSurface) Text(su.levenetc.android.textsurface.Text) AnimationsSet(su.levenetc.android.textsurface.animations.AnimationsSet)

Aggregations

Text (su.levenetc.android.textsurface.Text)5 TransSurface (su.levenetc.android.textsurface.animations.TransSurface)5 AnimationsSet (su.levenetc.android.textsurface.animations.AnimationsSet)4 Paint (android.graphics.Paint)1 Typeface (android.graphics.Typeface)1 Loop (su.levenetc.android.textsurface.animations.Loop)1 Parallel (su.levenetc.android.textsurface.animations.Parallel)1 Sequential (su.levenetc.android.textsurface.animations.Sequential)1