API Docs for: 0.1.0
Show:

CG.Sequence Class

Extends Class
Module: CG

CG.Sequence container to collect/group CG.Translation objects


                        sequence = new CG.Sequence({
                          loop: true
                        })
                        
                        sequence.addTranslation(
                        new CG.Translate().initBezier({
                           object: layersprites.elements[layersprites.elements.length - 2],
                           steps: 200,
                           startPoint: new CG.Point(500, 450),
                           endPoint: new CG.Point(100, 100),
                           control1: new CG.Point(-600, 600),
                           control2: new CG.Point(1200, -300)
                           }))
                        .addTranslation(new CG.Translate().initTween({
                               object: layersprites.elements[layersprites.elements.length - 2],
                               steps: 200,
                               startPoint: new CG.Point(100, 100),
                               endPoint: new CG.Point(550, 150)
                           }))
                        .addTranslation(new CG.Translate().initTween({
                               object: layersprites.elements[layersprites.elements.length - 2],
                               steps: 150,
                               startPoint: new CG.Point(550, 150),
                               endPoint: new CG.Point(100, 400)
                           }))
                        .addTranslation(new CG.Translate().initTween({
                               object: layersprites.elements[layersprites.elements.length - 2],
                               steps: 100,
                               startPoint: new CG.Point(100, 400),
                               endPoint: new CG.Point(550, 450)
                           }))
                        

Item Index

Methods

addTranslation

(
  • translationObj
)

add a translation object to the sequence array

Parameters:

  • translationObj Translation

    the translation object to add

Returns:

:

draw

()

init

()

Returns:

:

reset

()

update

()

Properties

translations

Array