Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fill the remaining pixels of a FlxGradient with the last colour picked #2367

Merged

Conversation

fabtjar
Copy link
Contributor

@fabtjar fabtjar commented Jul 31, 2021

Because the height is dividing by the chunk size and rounding down to an integer it may not end up being the correct height when scaled back up.

With the follow line of code the sprite isn't the full height of the game (640x480) :

FlxGradient.createGradientFlxSprite(FlxG.width, FlxG.height, [FlxColor.BLUE, FlxColor.RED], 121)

image

My change will fill the rest with the last colour picked in the array. It wont be the same size as the other chunks but it's better for it to be smaller that just not shown.
image

Because the height is dividing by the chunk size it may not end up being the correct height when scaled back up.
@fabtjar fabtjar changed the title Fill the remaining pixels of a FlxGradient with the last color picked Fill the remaining pixels of a FlxGradient with the last colour picked Jul 31, 2021
@Gama11 Gama11 merged commit 2fe2c31 into HaxeFlixel:dev Aug 1, 2021
@fabtjar fabtjar deleted the fill-remaining-pixels-with-gradients branch August 1, 2021 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants