perryliao / storyboard-projects Goto Github PK
View Code? Open in Web Editor NEWHD video animations made in C#
HD video animations made in C#
They are currently heading to the center which isn't the desired effect
Storyboard-Projects/Heart/Space.cs
Line 33 in 5a25321
Moves the object to a location but cuts off prematurely. Look for a potential fix for this hack
For a more robust look
Configurables
max range for varying is size/10
for (int i = 0; i < numSprites; i++) {
// y = size * (sin( (x + varyingX) / size)) + varyingY;
double varyingX = Random(size)/10 - size/20;
double varyingY = Random(size)/10 - size/20;
float x = Random(-107, 747);
float y = size * (Math.Sin( (x + varyingX) / size)) + varyingY;
OsbSprite circ = layer.CreateSprite("sb/cir.png", OsbOrigin.Centre, new Vector2(x, y));
circ.Scale(startTime, 0.5);
circ.Color(startTime, /* white */);
circ.Fade(startTime, startTime + timeStep, 0, 1);
for (double j = startTime; j < endTime - timeStep; j += timeStep) {
x += size/10;
y = size * (Math.Sin( (x + varyingX) / size)) + varyingY;
circ.Move(j, j + timeStep, circ.PositionAt(j), x, y);
}
circ.Fade(endTime - timeStep, endTime, 1, 0);
}
It'd look cleaner, TODO after contest ends.
[Configurable]
public double numBars = 3;
[Configurable]
public double startTime = 0;
[Configurable]
public double timeStep = Constants.beatLength / 4;
[Configurable]
public Color4 barColour = Colours.beige;
double height = Constants.height / numBars;
double endTime = startTime + numBars * timeStep;
int i;
OsbSprite bar;
bool left;
for (i = 0; i < numBars; i++) {
left = i % 2 == 0;
bar = layer.CreateSprite("sb/1x1.jpg", left ? OsbOrigin.TopLeft : OsbOrigin.TopRight, new Vector2(left ? Constants.xFloor : Constants.xCeil, (float) (i * height)));
bar.ScaleVec(startTime + i * timeStep, endTime, 0, height, Constants.width, height);
bar.Color(startTime + i * timeStep, barColour);
}
Apply the translation after rotation/scaling.
Storyboard-Projects/Heart/Cube.cs
Line 41 in 3c3a373
Change to just the Scale, and change the parameters to moveEdge
to include a x & y offset, so it can be added at
Storyboard-Projects/Heart/Cube.cs
Line 82 in 3c3a373
To be s.Move(i, i + timeStep, s.PositionAt(i), x + xOffset, y + yOffset);
Current one from the sprite pool is too ugly, find a new one to replace with after the event
use same logic as lyrics, possibly as an idea for the end if it is more optimal.
Configurables:
// globals
double h = Math.Sqrt(Math.Sqr(854, 2) + Math.Sqr(480, 2)));
double w = h/numLines;
double theta = Math.Arctan(480/854);
for (int i = 0; i < numLines; i++) {
Vector2 p = findPos(i);
OsbSprite bar = layer.CreateSprite("sb/1x1.jpg", OsbOrigin.BottomCentre, p);
double length = (p.X / Math.Cos(Math.PI)) + (p.Y / Math.Cos(Math.PI));
bar.Rotate(startTime, -Math.PI/4);
bar.ScaleVec(OsbEasing.OutExpo, startTime, startTime + beatLength/4, length, 0, length, w);
bar.ScaleVec(OsbEasing.OutExpo, startTime + beatLength/4, startTime + beatLength/2, length, w, length, 0);
bar.ScaleVec(OsbEasing.OutExpo, startTime + beatLength/2, startTime + beatLength*3/4, length, 0, length, w);
bar.Move(OsbEasing.OutExpo, startTime + beatLength/2, startTime + beatLength*3/4, bar.PositionAt(startTime + beatLength/2), bar.PositionAt(startTime + beatLength/2).X + w*Math.Cos(theta), bar.PositionAt(startTime + beatLength/2).Y - w*Math.Sin(theta)));
bar.Color(startTime, /*colour1*/); // blue
bar.Color(startTime + beatLength/2, /*colour3*/); // white
}
OsbSprite tempBG = layer.CreateSprite("sb/1x1.jpg", OsbOrigin.Centre);
tempBG.ScaleVec(startTime + beatLength/4, 854, 480);
tempBG.Fade(startTime + beatLength/4, 1);
tempBG.Fade(startTime + beatLength/2, 0);
tempBG.Color(startTime + beatLength/4, /*colour2*/); // pink
/// <summary>Helper function for finding the centre of the transition bar</summary>
private Vector2 findPos(double index) {
// find width of each line
float x = (float) ((numLines - i) * w * Math.Cos(theta)); // right to left
float y = (float) ((480/854)*(x + 107) + 480);
return new Vector2(x, y);
}
No configurables
// globals
double duration = beatLength * 3; // tentative
/*
setTitle("sb/title/true", ...);
setTitle("sb/title/chihara", ...);
setTitle("sb/title/credit", ...);
setTitle("sb/title/title", ...);
*/
// set violet sprite here
private void setTitle(string path, double startTime) {
OsbSprite title = layer.CreateSprite(path, OsbOrigin.Centre);
title.Fade(startTime, 1);
title.Fade(starTime + duration, 0);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.