HaxeFlixel / HaxeFlixel/flixel
Better alternative to FlxG.bitmap.whitePixel
Nobody has claimed this yet.
- Dominant language
- Haxe
- Stars
- 2.2k
- Forks
- 522
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Description
Continued from: https://github.com/HaxeFlixel/flixel/issues/3619#issuecomment-4780504475
The expected usage of whitePixel for solid rectangular sprites is:
sprite.frame = FlxG.bitmap.whitePixel;
sprite.setGraphicSize(someWidth, someHeight);
sprite.color = someColor;
Setting the scale of the sprite won't work because whitePixel is actually 10x10, which is very misleading. I would like a new option that is actually 1 pixel perhaps just pixel
Would be nice if there was a single method to do this, similar to the ease of
sprite.makeGraphic(someWidth, someHeight, someColor);
I think in order to better convey what is actually going on in relation to makeGraphic, which has different use cases, we should make something like:
FlxG.bitmap.pixel.loadInto(sprite, someWidth, someHeight, someColor);
Contributor guide
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 comparing the existing FlxG.bitmap.whitePixel and sprite.makeGraphic usage described in the issue. Determine the API shape that best supports a true one-pixel solid sprite and the proposed width, height, and color workflow. Done means a decided, documented approach with agreement on how it relates to the existing makeGraphic use cases.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100