Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Basics of storyboard related programming

Zerss edited this page Aug 24, 2018 · 12 revisions

creating a sprite

creating a sprite is easy; all layers have already been determined. you can create a sprite in these layers simply by using the .CreateSprite() command. this command can be used using theses methods:

Layer.CreateSprite(Path, Origin)
Layer.CreateSprite(Path, Origin, InitialX, InitialY)
Layer.CreateAnimation(Path, Origin, FrameCount, FrameDelay, LoopType)
Layer.CreateAnimation(Path, Origin, FrameCount, FrameDelay, LoopType, InitialX, InitialY)

Layer is either Background, Fail, Pass or Foreground. more here.

Origin is either TopLeft, TopCentre, TopRight, CentreLeft, Centre, CentreRight, BottomLeft, BottomCentre or BottomRight.

easings

easings are used, in storyboarding, in order to smoothen an object's parameter, such as movement. there are various ones and are all specified in this website.

when using the program, you could specify Out, In, QuadIn, QuadOut, QuadInOut, CubicIn, CubicOut, CubicInOut, QuartIn, QuartOut, QuartInOut, QuintIn, QuintOut, QuintInOut, SineIn, SineOut, SineInOut, ExpoIn, ExpoOut, ExpoInOut, CircIn, CircOut, CircInOut, ElasticIn, ElasticOut, ElasticHalfOut, ElasticQuarterOut, ElasticInOut, BackIn, BackOut, BackInOut, BounceIn, BounceOut or BounceInOut.

don't specify any in order to have a linear movement.

move functions

these are the available function for movements (resp. with MoveX and MoveY):

Sprite.Move(Time, Position)
Sprite.Move(Time, X, Y)
Sprite.Move(StartTime, EndTime, StartPosition, EndPosition)
Sprite.Move(StartTime, EndTime, StartX, StartY, EndX, EndY) 
Sprite.Move(Easing, StartTime, EndTime, StartPosition, EndPosition)
Sprite.Move(Easing, StartTime, EndTime, StartX, StartY, EndX, EndY) 

Position, StartPosition and EndPosition is a Vector2 type that can have two attributes, X and Y.

scale functions

these are the available functions for scaling (resp. with ScaleVec):

Sprite.Scale(Time, Scale)
Sprite.Scale(StartTime, EndTime, StartRatio, EndRatio)
Sprite.Scale(Easing, StartTime, EndTime, StartRatio, EndRatio)

rotate functions

these are the available functions for rotation:

Sprite.Rotate(Time, Angle)
Sprite.Rotate(StartTime, EndTime, StartAngle, EndAngle)
Sprite.Rotate(Easing, StartTime, EndTime, StartAngle, EndAngle)

angles are expressed in radians.

opacity functions

these are the available functions for opacity:

Sprite.Fade(Time, Opacity)
Sprite.Fade(StartTime, EndTime, StartOpacity, EndOpacity)
Sprite.Fade(Easing, StartTime, EndTime, StartOpacity, EndOpacity)

color functions

these are the available functions for coloring:

Sprite.Color(Time, Color)
Sprite.Color(Time, R, G, B)
Sprite.Color(StartTime, EndTime, StartColor, EndColor)
Sprite.Color(StartTime, EndTime, StartR, StartG, StartB, EndR, EndG, EndB)
Sprite.Color(Easing, StartTime, EndTime, StartColor, EndColor)
Sprite.Color(Easing, StartTime, EndTime, StartR, StartG, StartB, EndR, EndG, EndB)

Color, StartColor and EndColor is a Color type that can have two attributes, R, G and B.

parameters functions

these are the available functions:

Sprite.HFlip(StartTime, EndTime)
Sprite.VFlip(StartTime, EndTime)
Sprite.Additive(StartTime, EndTime)

loops and triggers

these are the available functions:

Sprite.BeginLoop(Time, LoopCount)
Sprite.EndLoop()
Sprite.OnTrigger(StartTime, EndTime, TriggerType)
Sprite.EndTrigger()

TriggerType is a string that can take several values. see here for more info.

e.g.

Sprite.BeginLoop(300, 4);
    Sprite.Move(CubicInOut, 0, 100, 50, 150);
    Sprite.Move(CubicInOut, 100, 200, 150, 50);
Sprite.EndLoop();

advanced functions

hide function

this function is used in order to create a fake object, for instance to be able to retrieve any affectations (movements, fading, ...) about it. this element won't be rendered and won't appear on the final .osb file. you can call it using Sprite.Hide()

parameters

allows the storyboarder to get a sprite's parameter:

Sprite.getPath()
Sprite.getOrigin()
Sprite.getX()
Sprite.getY()
Sprite.IsHidden()
Sprite.getAffectations() // outputs every affectations in the .osb format in a O(1), not recommended to use
Sprite.getFirstLine() // outputs the initial line of the sprite in the .osb format, not recommended to use

get functions

these functions allows the storyboarder to retrieve any values concerning the affectations of a sprite at any moment:

Sprite.getPositionAt(Time)
Sprite.getOpacityAt(Time)
Sprite.getScaleAt(Time)
Sprite.getXScaleAt(Time)
Sprite.getYScaleAt(Time)
Sprite.getRotationAt(Time)

merge with

these functions allows the storyboarder to merge its current project with another .osb file and add its content to the project:

MergeWith(Path)

script folder

these functions allow the storyboarder to query the script's folder path:

getScriptFolder()