forum

oosbl v0.6 - A different way to create Storyboards!

posted
Total Posts
5
Topic Starter
Aqua
Heya ~ !

Do you like Storyboarding but have Problems with the osb Syntax?
You are a Coder and want Variables and Methods?
No? Well, i do.

oosbl is a simple DSL which generates .osb Code for you! Let's call it, a osb Scripting Alternative!
oosbl helps you with repeating Storyboard Things and makes them even easier!



How to use it?
You simply write your Code in a Editor of your choice. When finished, paste the Code in a oosbl Parser and let the magic begin! Copy the Output into your osb File and that's it!

Examples
var stone = new Sprite("sb/stoney.png");
would initialize a new Sprite-Object called 'stone' using the Picture 'sb/stoney.png'.
Oke, let's have some fun with it
stone.setSize(0.2);
stone.setLayer("Foreground");
stone.setPosition(200, 200);
stone.render(300);

Oke, what did we just do?
We changed some starting Properties of our Sprite. In this case, we moved the Sprite to the Foreground, set it's size to 0.2 and changed the Position to 200,200.
The last line, render(), will make it 'visible' to the User at 200 milliseccounds.

Executing the Code above (for example here: http://realaqua.re.funpic.de/) would give you this osb-ready-stuff (30000 is the Songlength):
Sprite,Foreground,Centre,"sb/stoney.png",200,200
_S,0,0,0,0.2,0.2
_F,0,0,0,1,0
_F,0,300,300,0,1
_S,0,30000,30000,1,1
changing the last line
stone.render(300);
to
stone.fadeIn(300, 500);
would create a Fade Animation, starting at 300 and taking 500 milliseccounds.

The osb Output would be:
Sprite,Foreground,Centre,"sb/stoney.png",200,200
_S,0,0,0,0.2,0.2
_F,0,0,0,1,0
_F,0,300,800,0,1
_S,0,30000,30000,1,1

Once it's rendered, we still can change the Position of the Object, but a bit Different.
stone.moveTo(1000, 500, 240, 240);
will move our Stone to Position 240, 240. The Animation starts at 1000 Milliseccounds and will end at 1500 (500ms duration). Means, at 1500ms, the Sprite will be at the new Position.

Osb Equivalent:
_M,0,1000,1500,200,200,240,240
(Do you remember? We set the Position Property to 200,200. Means the Animation will start from this Point. The next Move will then start at 240,240)


Another great Thing in oosbl are Effects.
You can define your own effects and apply them to every Object you want. For example, one Strobe Effect for more then one element.
var strobe = new Effect(); 
strobe.add('setSize(0.2)');
strobe.add('render(%ms)');
strobe.add('resize(%ms, 200, 2)');
strobe.add('fadeOut(%ms, 200)');

This would create a new Effect, called strobe. %ms will be replaced with the starting ms.
At the beginning of the Effect, we'd like to set the Size of the Element to 0.2. After that, it should be set to visible, then start becoming bigger. At the Same Time it should start fading itself out. (Both over a duration of 200ms).

Now we have our effect, we just want to apply it. But we need a copy of the Stone first, which should be 'strobed'.
var stoneStrobe = new Sprite("sb/stoney.png");
stoneStrobe.copy(stone);
stoneStrobe.addEffect(2000, strobe);
copy() copies all of properties (the actual transarenz, the size, the position, the layer) of object1 to object2. In our Case, stone to stoneStrobe.
The last line will create a Effect on our stoneStrobe, starting at 2000ms. The Seccound parameter is the Effect Object.
When parsing it, all %ms will be replaced with 2000ms.

Osb Equivalent:
Sprite,Foreground,Centre,"sb/stoney.png",240,240
_S,0,0,0,0.2,0.2
_F,0,0,0,1,0
_F,0,2000,2000,0,1 // <-- our Effect starts here
_S,0,30000,30000,1,1
_S,0,2000,2200,0.2,2
_F,0,2000,2200,1,0

Looping:
Oke, in normal use, we want the Object to strobe more then just once. Looping is made as simple as Effects :)
stoneStrobe.addEffect(2000, strobe, 5);
That's it. The Effect runs 5 times, instead of just once.
During a loop, the %ms is 0. If you want a different ms, use %ms + 500 or something like that.

Keep in mind that the duration is still the duration and NOT endms.
Means if you start the Effect at %ms + 200 with a duration of 500, the Effect will end at 700ms after Effectstart

Osb Equivalent:
_L,2000,5
__F,0,0,0,0,1
__S,0,0,200,0.2,2
__F,0,0,200,1,0

Another thing you have to keep an eye is: When using loops, make sure your object is rendered BEFORE the loop. (The initial render).
You still can make it invisible and visible during a loop tho but the initial renderer have to be before the loop.


Links:
- A Parser: http://realaqua.re.funpic.de/
- Help me on Github https://github.com/dabido/oosbl
- Read the Wiki! (Work in Progress!) https://github.com/dabido/oosbl/wiki/Introduction
- Read the Docs (xSprite, Sprite, Effect)




The Parser still has some Bugs, but i try to fix them as fast as possible.

Some Things-to-avoid:
- Avoid the name 'Sprite' as var-name (with capital)
- Avoid var-name = exact picture name. (Eg. var stone, stone.png)
- Avoid Underscores ('my_stone'), use camelcase ('myStone')

Just tell me what you think :)

~ Aqua




Changelog
0.6
- Implemented xSprites, A set of unlimited Sprites
- Implemented xSprite basic Methods (move, rotate, fade, etc.)
- Implemented xSprite Copy (Copies a xSprite)

oosbl is now Supported in MoonShades Storyboard Editor! :)

0.5
- New Parser Setted Up
- Parser Style
- Added Ajax Parsing


0.4
- Implemented Effect-Driven-Loops

0.3
- Bug Fixes
- Implemented rotate()
- Implemented setRotation()

0.2
- Bug Fixes
- Features Effects

0.1
- Initial Release
Rukario
This looks pretty amazing. For me as a C# coder this is making stuff work way faster.
Can't wait until this gets bug fixed and all.
MoonShade
Nice work there, Aqua. I'm sure that when it's finished, it will help a lot. :3

Just to mention, I'm working on something similar to this project, but It has some problems right now and is not ready for a beta release :o
But if anyone want to follow or folk my project, you can find it at https://github.com/MoonShade/osbe
Topic Starter
Aqua
FYI!
Released Version 0.6 featuring xSprites.
oosbl is now supported in MoonShades osbe Project


Read the Wiki Page for Informations :)
KGB_RUSSIAN
hi
Please sign in to reply.

New reply