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,379
Reaction score
1,786
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,379
Reaction score
1,786
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

It seems that I have to change the order with which I make the fantasy games on my bucket list, because the intended title is used as a story element in the first two games in the line, and somebody else might take the title for their own game because the term uses real words. I can't risk going over the apparent three year limit for registering trademark ahead of time.
I am interested in collaborations so if you like my art, hit up my messages! :wub
unknown.png

Making good progress with the second chapter. :)

Still work in progress.

(Real life, it is chronically the fourth chapter that I am making.)
constructionworkconcept.pngezgif-2-0acb620ecf8d.gifezgif-2-afeaf16ebb8d.gif "The Great Wall is great. But, most people can only be the slaves who built it, leaving their bones underneath that wall. They spent their whole life to build that wall and the empire, an empire that enslaves them." :kaoswt2: I'm just going to turn it into a modern-day sad tale.

Forum statistics

Threads
110,676
Messages
1,055,107
Members
143,796
Latest member
ShadyBrain_Entertainment
Top