HaxeFlixel / HaxeFlixel/flixel

FlxStrip debug wireframe

Open
#2,908 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

FlxDebugger Improvement New Feature Rendering
Dominant language
Haxe
Stars
2.2k
Forks
522
Avg merge
34m
Merged PRs (30d)
1

Description

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

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 with flixel/graphics/tile/FlxDrawTrianglesItem.hx at the linked lines and compare the existing debug drawing with the proposed FlxStrip wireframe behavior. Clarify whether the original drawing should be replaced and how the toggle flag should work; done means the intended wireframe display can be enabled during debugging without changing normal rendering.

Written by the indexing model from the issue text.

Assessment

Domain
game-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.