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,261
Reaction score
1,670
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,261
Reaction score
1,670
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


Here is the second song of the Eniko: Ghosts Of Grace soundtrack: Jus Ad Bellum (Battle Theme), composed by Nickolas Wolfe! Looking forward to your reactions!
Observation Log 1 on the planet of "RPGMAKERWEB": Local RMXP community seems to have very few survivors. Their script tech-level is in the early Stone Age(about the same as 66RPG in 2007).
Some cats/wolves/squirrels are spotted, they are likely friendly. :3
Keep working on establishing more meaningful contacts.
May try to use the "I Come in Peace" protocol if encounter any hostiles.
Using hiddenone's QTE tutorial I've been able to setup a simple fishing system. Instead of just the pointer moving, the goal moves as well. Holding the action button scrolls the pointer and pressing the down arrow key hooks the fish. The speed of both is variable as well as the number of successful hooks needed for a catch.

Forum statistics

Threads
108,926
Messages
1,040,648
Members
141,380
Latest member
Mrbinnsy
Top