cocos.skeleton module

class Animate(*args, **kwargs)

Bases: cocos.actions.base_actions.IntervalAction

init(animation, recenter=False, recenter_x=False, recenter_y=False)

Gets called by __init__ with all the parameteres received, At this time the target for the action is unknown. Typical use is store parameters needed by the action.

start()

External code sets self.target and then calls this method. Perform here any extra initialization needed.

update(t)

Gets called on every frame ‘t’ is the time elapsed normalized to [0, 1] If this action takes 5 seconds to execute, t will be equal to 0 at 0 seconds. t will be 0.5 at 2.5 seconds and t will be 1 at 5sec. This method must not use self._elapsed, which is not guaranted to be updated.

class Animation(skeleton)

Bases: object

delete_time(delta)
flipped()
get_duration()
get_keyframe(offset=0)
get_markers()
get_position()
insert_keyframe()
insert_time(delta)
move_end()
move_position(delta)
move_start()
next_keyframe()
pose(who, t, start)
prev_keyframe()
remove_keyframe()
class BitmapSkin(skeleton, skin_def, alpha=255)

Bases: cocos.skeleton.Skin

blit_image(matrix, position, scale, image)
draw()

This is the function you will have to override if you want your subclassed CocosNode 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()
flip()
get_control_points()
move(idx, dx, dy)
regenerate()
skin_parts = []
class Bone(label, size, rotation, translation)

Bases: object

add(bone)
dump(depth=0)
flipped()
get_end()
get_start()
interpolated_to(next, delta)
move(dx, dy)
repr(depth=0)
rotate(angle)
class ColorSkin(skeleton, color)

Bases: cocos.skeleton.Skin

draw()

This is the function you will have to override if you want your subclassed CocosNode 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()
draw_bone(bone)
class Skeleton(bone)

Bases: object

flipped()
get_control_points()
interpolated_to(next, delta)
move(dx, dy)
pose_from(other)
propagate_matrix()
save(name)
visit_children(func)
class Skin(skeleton)

Bases: cocos.cocosnode.CocosNode