Warning
This is only in BETA
Create osu storyboards using Java with custom Effects or use the ones already created for now
for example: Background, ProgressBar and more to come...
Creating a Storyboard:
final Storyboard sb = new Storyboard(beatmapPath, diffName);Beatmap properties:
You can access to HitObject, TimingPoint and BPM etc...
path: Path of the beatmap in the personal machine.title: Title of the Beatmap.diffName: Name of the difficulty.artist: Name of the artist.mapper: Name of the mapper.timingPoints: Timing Points given in aLinkedList.
sb.getBeatmap();Creating a Sprite:
final Sprite sprite = new Sprite(spriteName, layer, origin, filePath);spriteName: This is a personal choice to get the sprite later by its name.layer: Layer of the sprite e.g:Layer.BACKGROUND.origin: Origin of the sprite e.g:Origin.CENTRE.filePath: Path of the sprite e.g:sb\\img.png
Creating a Sprite with coordinates:
final Sprite sprite = new Sprite(spriteName, Layer.BACKGROUND, Origin.CENTRE, filePath, x, y);x: x coordinatey: y coordinate
Manipulation of a Sprite
Give this a read: Osu storyboarding.
Sprite#(Command)(args);Command loop = particle.createLoop(startTime, loopCount);
loop.addSubCommand(particle.Fade(Easing.EASING_OUT, 0, (int) (loopDuration * 0.2), 0, color.getAlpha()));
loop.addSubCommand(particle.Move(EASING, 0, (int) loopDuration, startPosition.x, startPosition.y, endPosition.x, endPosition.y));sb.addObject(sprite);sb.addEffect(clazz, startTime, endTime, parameters);class: Class of the desired Effect.startTime: Time when the effect will start in milliseconds.endTime: Time when the effect will finish in milliseconds.parameters: Usually depends on the effect for example:- Progressbar:
x: x coordinatey: y coordinatebarLength: length of the bar
- Background:
path: file path of the background image e.g: 'sb\bg.png'startFade: fade value when the bg will appearendFade: fade value when the bg will disappear
- Progressbar:
public class TestEffect implements Effect {
@Override
public void render(Storyboard storyboard, long startTime, long endTime, Object... params) {
}
}SBText sbText = new SBText(spriteName, storyboard, text, font, startTime, endTime, x, y, color);spriteName: This is a personal choice to get the sprite later by its name.storyboard: Storyboard instance.text: Text string.font: Font you can get a custom font using this:FontUtils.getCustomFont(fontName, size):- You have to add a font named fontName in the resources directory in a directory named "customFont"
FontUtils.getFont(fontName, size):- You can also get a normal font like Calibri for example
startTime: Time when the text will appear in milliseconds.endTime: Time when the text will disappear in milliseconds.x: x coordinatey: y coordinate
sbText.addFilter(filter)
filter: You can either create one or use an existing one like these:new GlitchFilter()new ZoomFilter(scale)
public class TestFilter implements TextFilter {
@Override
public void apply(SBText text) {
}
}After finishing the text:
sbText.apply();
sb.write();