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

Error with FlxBar rendering if fill direction is changed #3256

Open
DetectiveBaldi opened this issue Sep 25, 2024 · 0 comments
Open

Error with FlxBar rendering if fill direction is changed #3256

DetectiveBaldi opened this issue Sep 25, 2024 · 0 comments
Labels

Comments

@DetectiveBaldi
Copy link
Contributor

  • Haxe version: 4.3.6
  • Flixel version: git
  • OpenFL version: git
  • Lime version: git
  • Affected targets: all
2024-09-25.18-22-47.mp4

the issue can be reproduced with this snippet:

package;

import flixel.FlxG;
import flixel.FlxState;
import flixel.ui.FlxBar;
import flixel.util.FlxColor;

class PlayState extends FlxState
{
	var health:Float = 50.0;

	var flx:FlxBar;

	override public function create()
	{
		super.create();

		flx = new FlxBar(0.0, 0.0, RIGHT_TO_LEFT, 640, 25, this, "health", 0.0, 100.0, true);

		flx.createFilledBar(0xFF66FF33, FlxColor.RED, true, FlxColor.BLACK, 5);

		add(flx);
	}

	override public function update(elapsed:Float)
	{
		super.update(elapsed);

		if (FlxG.keys.pressed.RIGHT)
			health--;

		if (FlxG.keys.pressed.LEFT)
			health++;

		if (FlxG.keys.justPressed.SPACE)
		{
			flx.fillDirection = flx.fillDirection == LEFT_TO_RIGHT ? RIGHT_TO_LEFT : LEFT_TO_RIGHT;

			trace("updated fill dir");
		}
	}
}

by pressing space, and then pressing right to reduce the health, which results in 2 visible green sects

@Geokureli Geokureli added the Bug label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants