Layer class and subclasses
A Layer has as size the whole drawable area (window or screen), and knows how to draw itself. It can be semi transparent (having holes and/or partial transparency in some/all places), allowing to see other layers behind it. Layers are the ones defining appearance and behavior, so most of your programming time will be spent coding Layer subclasses that do what you need. The layer is where you define event handlers. Events are propagated to layers (from front to back) until some layer catches the event and accepts it.
Bases: cocos.cocosnode.CocosNode, cocos.scene.EventHandlerMixin
a CocosNode that automatically handles listening to director.window events
registers itself to receive director.window events and propagates the call to childs that are layers. class member is_event_handler must be True for this to work
de-registers itself to receive director.window events and propagates the call to childs that are layers. class member is_event_handler must be True for this to work
if true, the event handlers of this layer will be registered. defaults to false.
Bases: cocos.layer.base_layers.Layer
A Composite layer that only enables one layer at the time.
This is useful, for example, when you have 3 or 4 menus, but you want to show one at the time
Switches to another Layer that belongs to the Multiplexor.
Parameters: |
|
---|