Still struggling with my root bone.
I've been combing through the code trying to figure out what's going on.
Here's the main initialization code and loop:
skeleton.flipX = False
skeleton.flipY = False
skeleton.setToBindPose()
rootBone = skeleton.getRootBone()
rootBone.x = 320
rootBone.y = 240
skeleton.setRootBone(rootBone)
skeleton.updateWorldTransform()
clock = pygame.time.Clock()
animationTime = 0.0
done = False
while not done:
clock.tick(60)
animationTime += clock.get_time() / 1000.0
animation.apply(skeleton=skeleton,
time=animationTime,
loop=True)
screen.fill((0, 0, 0))
skeleton.draw(screen, 0)
pygame.display.flip()
pygame.quit()
Here's my debug code for drawing the bone circles:
if self.debug:
for bone in self.bones:
if not bone.circle:
bone.circle = Circle(0, 0, 3)
bone.circle.x = int(bone.worldX)
bone.circle.y = -int(bone.worldY)
bone.circle.color = (0, 255, 0)
pygame.draw.circle(screen,
bone.circle.color,
(bone.circle.x, bone.circle.y),
bone.circle.r,
3)
When this debug code gets used, the bone.worldY is 240, so it gets flipped to -240 and my circle draws off screen.
This is exactly how Corona does it, so I can only assume that I've got something messed up somewhere that is supposed to be making bone.worldY negative before this drawing routine, but it's not happening.
Any ideas? I can't seem to figure out what's going on.