RMMV Uncaught TypeError: displayObject._mask.containsPoint is not a function

GreenTree-Studios

Creator of Dragon Bones
Member
Joined
Feb 3, 2021
Messages
15
Reaction score
1
First Language
English
Primarily Uses
RMMV
So I've managed to get the drill effect to work on my Cleaning Plugin. However, when I apply a simple mask to the layer hidden below the topmost rock layer, it gives me the above error. Here is how I did the code that might have caused the error (plus the bitmap I am using):

JavaScript:
Spriteset_Cleaning.prototype.punctureHoles = function() {
    this._holeSprite = new Sprite();
    this._holeSprite.bitmap = this.holeBitmap();
    this._holeSprite.bitmap.blt(this._holeSprite.bitmap, 0, 0, 16, 16, 0, 0);   // blit onto fresh canvas
    this._holeSprite.move(TouchInput._x, TouchInput._y);
    this._rockL1.addChild(this._holeSprite);
    this._rockL2.mask = this._holeSprite.children;
};

Drill.png
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,361
Reaction score
1,771
First Language
EN
Primarily Uses
RMMZ
Looks like you've tried to assign an array, children, to a property that expects a single image, mask. I'm not really familiar with CSS or PIXI masking (I know there are/were some users active here knowledgable about that), but I think for multiple masks you'd want to render them to a single image and assign that as the mask? Or maybe you can just assign the parent sprite, not sure how that works.

In case it helps, I did a quick search and found this thread:
Couple more notes:
  • It seems like your code will re-paint the top-left 16x16 px of holeBitmap onto itself with no offset. I'm not sure that's what you intended? :kaoswt:

  • The source image for blitting and the image mask should be loaded into separate identifiers to avoid affecting the cached image, e.g. this._holeSource and this._cleaningMask. That said, the thread I linked seems to suggest that blitting is unnecessary if you use PIXI masks.
 

GreenTree-Studios

Creator of Dragon Bones
Member
Joined
Feb 3, 2021
Messages
15
Reaction score
1
First Language
English
Primarily Uses
RMMV
So how would you go about storing the coordinates of the drill bitmap that has been previously placed? I'm assuming it will involve using the aforementioned this._holeSource and this._cleaningMask examples. So far it seems to work the way I desire it to: Cleaning Drill Effect Video Take 2
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,361
Reaction score
1,771
First Language
EN
Primarily Uses
RMMZ
Oh, looks good! If it works then I guess it's OK, don't mind me~ :kaoblush:
 

GreenTree-Studios

Creator of Dragon Bones
Member
Joined
Feb 3, 2021
Messages
15
Reaction score
1
First Language
English
Primarily Uses
RMMV
Just one more question: How would I go about tracking the number of Drill Bitmaps created?
 

Latest Threads

Latest Posts

Latest Profile Posts

They're watching...
Unbenannt.png
currently working on some template sprites and tweaking the walk cycle :)
Lunee.jpg
Early try to draw our Demon Countess, who destroyed her own soul leaving just an empty shell of a body - until our heroine unwillingly takes possession of it, every time she falls asleep.
(I know it’s a premade face from the Dark Fantasy Set, but I spent so much time with her, that I can’t bring myself to change the sprite anymore xD)
I finished setting up my new desk and apparently she thinks this is where she goes now.

20210411_082331.jpg
not me baking a pie because i was inspired by celeste

Forum statistics

Threads
110,296
Messages
1,052,066
Members
143,328
Latest member
YukiSanMoji
Top