| Trees | Indices | Toggle frames |
|---|
object --+
|
cocosnode.CocosNode --+
|
object --+ |
| |
scene.EventHandlerMixin --+
|
base_layers.Layer --+
|
ColorLayer
Creates a layer of a certain color. The color shall be specified in the format (r,g,b,a).
For example, to create green layer:
l = ColorLayer(0, 255, 0, 0 )
The size and position can be changed, for example:
l = ColorLayer( 0, 255,0,0, width=200, height=400) l.position = (50,50)
|
__init__(self,
r,
g,
b,
a,
width=None,
height=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for
signature
|
|
|
on_enter(self)
Called every time just before the node enters the stage.
|
|
|
on_exit(self)
Called every time just before the node leaves the stage
|
|
|
draw(self)
This is the function you will have to override if you want your
subclassed to draw something on screen.
|
|
Inherited from base_layers.Layer:
push_all_handlers,
remove_all_handlers
Inherited from cocosnode.CocosNode:
__contains__,
add,
are_actions_running,
do,
get,
get_ancestor,
get_children,
pause,
pause_scheduler,
remove,
remove_action,
resume,
resume_scheduler,
schedule,
schedule_interval,
stop,
transform,
unschedule,
visit,
walk
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__str__
|
|
Inherited from object:
__class__
|
Inherited from cocosnode.CocosNode:
actions,
camera,
children,
children_anchor_x,
children_anchor_y,
children_names,
grid,
is_running,
rotation,
scale,
scheduled_calls,
scheduled_interval_calls,
skip_frame,
to_remove,
transform_anchor_x,
transform_anchor_y,
visible,
x,
y
|
opacity = property(lambda self: self._opacity, _set_opacity, d
|
|
color = property(lambda self: self._rgb, _set_color, doc= '''B
|
|
Inherited from base_layers.Layer:
is_event_handler
Inherited from cocosnode.CocosNode:
anchor,
anchor_x,
anchor_y,
children_anchor,
parent,
position,
transform_anchor
|
|
This is the function you will have to override if you want your subclassed to draw something on screen.
You must respect the position, scale, rotation and anchor attributes. If you want OpenGL to do the scaling for you, you can:
def draw(self): glPushMatrix() self.transform() # ... draw .. glPopMatrix()
property(lambda self: self._opacity, _set_opacity, doc= '''Blend opaci |
property(lambda self: self._rgb, _set_color, doc= '''Blend color.
This property sets the color of the layer's vertices. This allows |
| Trees | Indices | Toggle frames |
|---|
| Generated by Epydoc 3.0beta1 on Sat Sep 6 13:21:11 2008 | http://epydoc.sourceforge.net |