Jump to content

Mask staying when state changing


aurelien974
 Share

Recommended Posts

EDIT : I found a solution to change the state without any mask problem (even if i don't understand it). I defined the mask for my sprites like this :

 

    sprite1.mask =

    sprite2.mask =

    sprite3.mask =

    theMask;

 

and then, before changing state, i can remove all that with :

 

    sprite2.mask = null; // (or sprite3.mask = null; BUT NOT sprite1.mask = null; --> Error)

 

Moreover, console.log("YUOIO") from Phaser still triggers.

 

------------------------------------------------------------------------------

 

Hi guys!

 

I'm having a problem with mask and states.

I'm using a mask for some sprites in-game but when i change the state to go to my title screen, the mask is still staying and makes my title screen only visible through it.

When i try to disable it by changing the sprites .mask property to "null", i get :

      - "YUOIO" in the console for each sprite i try to change the mask to null

      - "Uncaught TypeError: Cannot set property '_iNext' of null"

 

By the way, when i try to play the game with Canvas instead of Auto (which is WebGL in my case), i get this error (due to masks i think, see http://www.html5gamedevs.com/topic/1444-how-to-use-pixi-masking-in-phaser/ , post 8#) :

"Uncaught TypeError: Cannot read property 'alpha' of undefined"

 

Can someone help me with that ?

 

Thanks and have a nice day :)

Link to comment
Share on other sites

  • 2 weeks later...

I'm also having trouble with mask using Canvas as renderer.

"Uncaught TypeError: Cannot read property 'alpha' of undefined"

The error happens in PixiPatch.js

 

Basically, I tried debugging around the error and it seems Phaser.Sprite has no mask property, which is weird since it should have inherit all the way to PIXI.DisplayObject which has the mask property. Although, I can only see PIXI.DisplayObjectContainer in it(using console.log). I hope someone can better address this or provide a fix.

Link to comment
Share on other sites

EDIT : I found a solution to change the state without any mask problem (even if i don't understand it). I defined the mask for my sprites like this :

 

    sprite1.mask =

    sprite2.mask =

    sprite3.mask =

    theMask;

 

and then, before changing state, i can remove all that with :

 

    sprite2.mask = null; // (or sprite3.mask = null; BUT NOT sprite1.mask = null; --> Error)

 

Moreover, console.log("YUOIO") from Phaser still triggers.

 

------------------------------------------------------------------------------

 

Hi guys!

 

I'm having a problem with mask and states.

I'm using a mask for some sprites in-game but when i change the state to go to my title screen, the mask is still staying and makes my title screen only visible through it.

When i try to disable it by changing the sprites .mask property to "null", i get :

      - "YUOIO" in the console for each sprite i try to change the mask to null

      - "Uncaught TypeError: Cannot set property '_iNext' of null"

 

By the way, when i try to play the game with Canvas instead of Auto (which is WebGL in my case), i get this error (due to masks i think, see http://www.html5gamedevs.com/topic/1444-how-to-use-pixi-masking-in-phaser/ , post 8#) :

"Uncaught TypeError: Cannot read property 'alpha' of undefined"

 

Can someone help me with that ?

 

Thanks and have a nice day :)

 

it's been solved link here

 

http://www.html5gamedevs.com/topic/3735-masking-issue/?hl=masking

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...