Pixelmask offset and Masklist


(Wayne Makoto Sturdy) #1

I am trying to add pixelMasks to an Entity’s Masklist with offsets but what I see in the console debug is all of the masks in the Masklist are rendering at the Entity’s origin, however, I do see the red bounding (hit) box increase in size as if it were encompassing the offset of pixelMasks.

If I do not use a Masklist and apply a single pixelMask with an offset, it appears to render correctly. What gives?


(Ultima2876) #2

Sounds like it might be a bug to me. Have you got a code sample?


(Wayne Makoto Sturdy) #3

This following is a test I did in the begin override in a World:

var img:Image = new Image(GA.OBJ_STAR, new Rectangle(50, 0, 50, 50));
var msk:Pixelmask = new Pixelmask(GA.OBJ_CLUB, 0, 64);
var temp:Entity = new Entity(375, 100, img, msk);
add(temp);

That will show the the entity with the proper offset, but if you pass in a Masklist to the Entity constructor, you will see the error I described.

var img:Image = new Image(GA.OBJ_STAR, new Rectangle(50, 0, 50, 50));
var msk:Pixelmask = new Pixelmask(GA.OBJ_CLUB, 0, 64);
var temp:Entity = new Entity(375, 100, img, new Masklist(msk));
add(temp);

I would very much like to know if anyone can reproduce this.


(Wayne Makoto Sturdy) #4

Well I guess I should have tried some collision tests first… It appears that the collisions happen where they’re supposed to, and its just the debug render view that is displaying the masks incorrectly.

I’m reminded of the scene in Ninja Scroll where the blind samurai tells Jubei that his ability of sight is his weakness…


(Ultima2876) #5

Ninja Scroll, haven’t seen that in years. I might hunt down a DVD…

The debug console does have a few oddities like that. Generally speaking it’s more of a guide than anything else - iirc it was still in development when FlashPunk was taken over by the new maintainers. You could submit a bug report on the Github :slight_smile:


(Zachary Lewis) #6

That is a brilliant idea.