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

Add support for custom border sizes to FlxBar #3234

Merged
merged 5 commits into from
Aug 26, 2024

Conversation

DetectiveBaldi
Copy link
Contributor

@DetectiveBaldi DetectiveBaldi commented Aug 15, 2024

Adds support for custom border sizes to FlxBar by allowing the user to pass in an Int when calling functions such as createFilledBar.

@DetectiveBaldi
Copy link
Contributor Author

Updated borderSize to be an Int rather than an FlxPoint. Also fixed an issue with gradient bars! With that I believe I can mark this ready for review.

@DetectiveBaldi DetectiveBaldi marked this pull request as ready for review August 15, 2024 21:26
@DetectiveBaldi DetectiveBaldi changed the title Add support for custom border sizes in FlxBar. Add support for custom border sizes to FlxBar. Aug 15, 2024
@DetectiveBaldi DetectiveBaldi changed the title Add support for custom border sizes to FlxBar. Add support for custom border sizes to FlxBar Aug 15, 2024
@Geokureli
Copy link
Member

got a small little example snippet, I can quickly check?

@DetectiveBaldi
Copy link
Contributor Author

DetectiveBaldi commented Aug 21, 2024

got a small little example snippet, I can quickly check?

package;

import flixel.FlxG;
import flixel.FlxState;

import flixel.ui.FlxBar;

import flixel.util.FlxColor;

class PlayState extends FlxState
{
	override public function create()
	{
		super.create();

		FlxG.camera.bgColor = FlxColor.WHITE;

		var fivePixelBorder:FlxBar = new FlxBar(0.0, 0.0, LEFT_TO_RIGHT, 300, 30, null, "", 0.0, 100.0, true);

		fivePixelBorder.createFilledBar(FlxColor.RED, FlxColor.LIME, true, FlxColor.BLACK, 5);

		add(fivePixelBorder);

		var tenPixelBorder:FlxBar = new FlxBar(0.0, 0.0, LEFT_TO_RIGHT, 300, 30, null, "", 0.0, 100.0, true);

		tenPixelBorder.createFilledBar(FlxColor.RED, FlxColor.LIME, true, FlxColor.BLACK, 10);

		tenPixelBorder.setPosition(0.0, tenPixelBorder.height + 15.0);

		add(tenPixelBorder);
	}

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

@Geokureli Geokureli added this to the 5.9.0 milestone Aug 26, 2024
@Geokureli
Copy link
Member

Thanks!

@Geokureli Geokureli merged commit 4409577 into HaxeFlixel:dev Aug 26, 2024
11 checks passed
@DetectiveBaldi DetectiveBaldi deleted the FlxBar.borderSize branch September 20, 2024 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants