HaxeFlixel / HaxeFlixel/flixel-addons
FlxTypeText counterintuitive callback behaviour
Nobody has claimed this yet.
- Dominant language
- Haxe
- Stars
- 196
- Forks
- 175
- PR merge metrics
- No merged PRs in 30d
Description
Currently FlxTypeText.onComplete:Void->Void is public, and "Callback" is an optional paramater of FlxTypeText.start().
However, leaving out the Callback paramater of start() causes onComplete to be overwritten with null, meaning the only time you could meaningfully set onComplete directly is after calling start() but before the animation completes.
We could check for null in start(), but that would prevent you from intentionally nulling the callback when calling start.
I propose either making onComplete private, or removing Callback from start().
I personally lean towards the latter, as it creates less-messy function calls.
Thoughts?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the FlxTypeText implementation and its start() method, then read the existing handling of onComplete and the optional Callback parameter. The issue presents two competing API changes but does not choose one; done would require a decided behavior, an implementation, and coverage for omitted and intentionally null callbacks.
Written by the indexing model from the issue text.
Assessment
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100