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,373
Reaction score
1,781
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,373
Reaction score
1,781
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 Profile Posts


Swag collecting in the new randomly generated area. Now the mini map also shows the randomly generated features... And even illustrates the whole "bubble" system" that I made to manage memory... Though that part's inadvertent. We'll just call that "the fog of war"... Yes, that's what we'll do. Nobody will be the wiser! :kaopride:
not me being not lazy for 5 seconds and drawing another char portrait (her name is hazel)
its_hazel.png
Been a while since the last time I made a song remix. Had a blast making this
One thing those jp developer still get wrong about boob physic is that... men's muscly hard pecs can jiggle too.
Definitely glad I haven't released a few of my plugins that are technically done. As I learn more, I find ways to make my code more efficient, and in one case so far, discovered an existing function that did EXACTLY what I created my own function to do.

Forum statistics

Threads
110,454
Messages
1,053,435
Members
143,541
Latest member
Neikoku
Top