Skip to content

colors don't work in FlxStrip #2263

@starry-abyss

Description

@starry-abyss
  • Haxe version: 4.1.2
  • Flixel version: 4.8.0
  • OpenFL version: 8.9.6
  • Lime version: 7.7.0
  • Affected targets: native

Code snippet reproducing the issue:

package;

import flixel.FlxSprite;
import flixel.FlxState;

import openfl.Vector;
import flixel.FlxStrip;
import flixel.util.FlxColor;

class PlayState extends FlxState
{

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

		var testLine = new FlxStrip();
		testLine.makeGraphic(10, 10, FlxColor.WHITE);
		
		var n:Int = 0;
		var indices:Array<Int> = [ n + 0, n + 1, n + 2, n + 1, n + 3, n + 2 ];
		var uvtData:Array<Float> = [ 0, 0, 1, 0, 0, 1, 1, 1 ];
		//var colors = [ FlxColor.WHITE, FlxColor.WHITE, FlxColor.WHITE, FlxColor.WHITE ];
		var colors = [ FlxColor.RED, FlxColor.RED, FlxColor.RED, FlxColor.RED ];
		
		testLine.indices = new Vector(indices.length, true, indices);
		testLine.uvtData = new Vector(uvtData.length, true, uvtData);
		testLine.colors = new Vector(colors.length, true, colors);

		var vertices:Array<Float> = [];
			
		var lineWidth = 10;
			
		var lootboxX:Float = 20;
		var lootboxY:Float = 20;
			
		var editorX = 150;
		var editorY = 150;
			
		//vertices = [ dx, dy, dx + 23, dy, dx, dy + 8, dx + 23, dy + 8 ];
		vertices = [ lootboxX, lootboxY, lootboxX + lineWidth, lootboxY, editorX, editorY, editorX + lineWidth, editorY ];
			
		testLine.vertices = new Vector(vertices.length, true, vertices);

		add(testLine);
	}
}

Observed behavior:

I'm not sure if the problem is in the engine or the way I'm using FlxStrip, but colors did work on Beeblerox branch

image

Expected behavior:

(from Beeblerox branch)

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions