HaxeFlixel / HaxeFlixel/flixel-addons

FlxTypeText counterintuitive callback behaviour

Open
#331 5 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.