-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
coreCore logic module of the frameworkCore logic module of the frameworkenhancementNew feature or requestNew feature or requesthigh priorityMust be completed as soon as possibleMust be completed as soon as possiblerefactorParts of the code need to be moved, enhanced, changed, or removedParts of the code need to be moved, enhanced, changed, or removedtweeningCustom tweening system for adding animations on objectsCustom tweening system for adding animations on objects
Description
Currently, the way to create a tween is to manually create a FlixelTweenSettings object. This can cause annoyance with how much is required just to build one tween. To simplify this, we need to create static builder classes that automatically constructs tweens for all types.
Requirements:
Fluent builder API
- Entry points return a builder; all configuration methods (e.g.
addGoal,setEase,setType,setDuration) return the builder for chaining. - The chain ends with
.start(), which creates the tween, adds it to the global manager, starts it, and returns it.
Typed return
Support a class reference (e.g. FlixelTween.tween(FlixelPropertyTween.class)) so that .start() returns the concrete type (e.g. FlixelPropertyTween), enabling something like:
// Reflection tween example.
FlixelPropertyTween tween = FlixelTween.tween(FlixelVarTween.class)
.setObject(...)
.addGoal(...)
.setDuration(1f)
.setCallback(values -> {...})
.start();
// Property tween example.
FlixelPropertyTween tween = FlixelTween.tween(FlixelPropertyTween.class)
.addGoal(...)
.setDuration(1f)
.start();
// Numerical tween example.
FlixelPropertyTween tween = FlixelTween.tween(FlixelNumTween.class)
.from(1f)
.to(2f)
.setCallback(num -> {...})
.setDuration(1f)
.start(); // Make sure that the start method throws an exception if from, to or the update callback isn't set!Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreCore logic module of the frameworkCore logic module of the frameworkenhancementNew feature or requestNew feature or requesthigh priorityMust be completed as soon as possibleMust be completed as soon as possiblerefactorParts of the code need to be moved, enhanced, changed, or removedParts of the code need to be moved, enhanced, changed, or removedtweeningCustom tweening system for adding animations on objectsCustom tweening system for adding animations on objects
Projects
Status
🗒️ Todo