Saturday, October 8, 2022
HomeGame DevelopmentQuestions in regards to the masks element - Cocos Creator

Questions in regards to the masks element – Cocos Creator


Hello!
I want to chop out varied shapes from a texture for puzzle video games. Currently utilizing Cocos Creator 3.6.0.
Tell me, please, what kind of masks has the least impression on the efficiency of the sport engine?
Would like to make use of GRAPHICS_STENCIL. Tried the instance from Cocos Creator 3.6 User Manual->Mask Component Reference, obtained
error: “Error: [Scene] ‘Mask.graphics’ is deprecated, please use ‘Mask.subComp’ instead.”
Visual Studio Code – Property ‘graphics’ doesn’t exist on kind ‘Mask’:

But the masks works!
Will GRAPHICS_STENCIL be supported in future variations of the engine or will there be an alternate?
What could be carried out with ‘Mask.subComp’?

I’ve used “Mask._graphics” in 2.x model, verify if it nonetheless works in 3.x ?

Yes, I wrote that it really works, however it offers a warning: “Error: [Scene] ‘Mask.graphics’ is deprecated, please use ‘Mask.subComp’ instead.” within the browser and within the Cocos Creator console, in addition to in
Visual Studio Code – “Property ‘graphics’ does not exist on type ‘Mask’”

In the engine, the masks makes use of the _graphics, you need to use it usually.

Thanks I used to be simply confused by the deprecated API warning.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments