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

FlxStrip debug wireframe #2908

Open
Geokureli opened this issue Aug 30, 2023 · 0 comments · May be fixed by #2909
Open

FlxStrip debug wireframe #2908

Geokureli opened this issue Aug 30, 2023 · 0 comments · May be fixed by #2909

Comments

@Geokureli
Copy link
Member

Continued from #2906

UncertainProd has found that replacing these lines with the following, will draw a wireframe display of FlxStrips:

if (FlxG.debugger.drawDebug)
{
	var gfx:Graphics = camera.debugLayer.graphics;
	gfx.lineStyle(1, FlxColor.BLUE, 0.5);
	// draw a triangle path for each triangle in the drawitem
	var i = 0;
	while (i < indices.length)
	{
		var indexToPoint = (idx:Int) ->
		{
			return [vertices[idx * 2], vertices[idx * 2 + 1]];
		};
		var pt1 = indexToPoint(indices[i]);
		var pt2 = indexToPoint(indices[i + 1]);
		var pt3 = indexToPoint(indices[i + 2]);
		gfx.drawPath(Vector.ofArray([MOVE_TO, LINE_TO, LINE_TO, LINE_TO]), Vector.ofArray([
			pt1[0], pt1[1],
			pt2[0], pt2[1],
			pt3[0], pt3[1],
			pt1[0], pt1[1],
		]));
		i += 3;
	}
}

I'm considering removing the original lines entirely and using this in FlxStrip with a flag to toggle this effect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant