HaxeFlixel / HaxeFlixel/flixel

Better alternative to FlxG.bitmap.whitePixel

Open
#3,620 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assets New Feature Structure
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

Open the contributing guide

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.