Layer.remove_all_handlers does not seem to do what the docs says, unless
I'm misunderstanding.
This is part of my code:
def activate(self):
self.is_event_handler = True
self.push_all_handlers()
self.visible = True
def deactivate(self):
self.remove_all_handlers()
self.is_event_handler = False
self.visible = False
def on_mouse_press(self, x, y, b, m):
if y < director.get_window_size()[1] - 96:
for button in self.tilebuttons:
if button.contains(x, y):
return True
return False
>From the docs:
remove_all_handlers(self)
> de-registers itself to receive director.window events and propagates the
> call to childs that are layers.
>
Should make it so self.on_mouse_press is not registered, but this is not
what happens in my code, unless I also use the is_event_handler=False
Have I misunderstood the usage, or is it maybe some other bug in my code?
The use case is toggling on / off a layer which acts as a kind of menu.
--
You received this message because you are subscribed to the Google Groups
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/groups/opt_out.