Closed itulau closed 10 months ago
is this happening on flixel 5.5.0 or are you using the dev github branch, or an older version of flixel?
Edited the description, but I'm on flixel 5.5.0
Could reproduce in latest dev version of flixel/flixel-addons
thanks for clarifying. Truthfully FlxNestedSprite is not actively maintained, or well-understood by the current team, so we tend to recommend FlxSpriteGroup as a substitute. In fact, it would be very helpful to hear why you chose it, and how you're using it. I've thought about deprecating this class, since it seems so niche and problematic
if you wanted to make a PR to fix this, I think it makes sense, and (in my limited knowledge of FlxNestedSprite) seems like an easy change
Hi, I've noticed that FlxNestedSprite works better for the use-case I need right now: a group of sprites that represents a character where one sprite acts as the collider and the rest of the sprites are just visual and do not interact with the collisions. To my limited knowledge from my testings, it seems that FlxSpriteGroup was not designed for this because when collision occurs, the rest of the sprites simply ignore this. With FlxNestedSprite I could get, more or less, the result I was looking for with practically the same code.
FlxSpriteGroup:
FlxNestedSprite:
And for a solution, yes, I've already found one, by simply guarding the call for drawing of the current FlxNestedSprite with a null check for _frame
(the same variable that's used for adding the default png) the problem goes away.. now the thing is that I'm not experienced enough with Flixel to be sure if this solution might have unintended side-effects by not allowing the draw() call to occur anyway.
I wouldn't mind opening a PR if this is not an issue.
I wouldn't mind opening a PR if this is not an issue.
Yes, please!
I've noticed that FlxNestedSprite works better for the use-case I need right now: a group of sprites that represents a character where one sprite acts as the collider and the rest of the sprites are just visual and do not interact with the collisions. To my limited knowledge from my testings, it seems that FlxSpriteGroup was not designed for this because when collision occurs, the rest of the sprites simply ignore this.
Yeah FlxSpriteGroups collide as groups, which is kind of annoying. I almost added the ability for spritegroups to collide as if it was a single sprite but I wasn't entirely happy with it and plan to revisit it later.
I've noticed FlxNestedSprite shows the Flixel default icon when there isn't an image nor graphic loaded which seems to be the default behavior of
draw()
inherited from FlxSprite. So every FlxNestedSprite that itself doesn't render anything but contains children will have a default icon hidden within it by default.flixel-addons: 3.2.1 flixel:5.5.0