cocos2d with wax, overload method does not work?

56 views
Skip to first unread message

stone

unread,
Jul 24, 2012, 6:58:20 AM7/24/12
to ipho...@googlegroups.com

I'm using cocos2d with wax, I define A class as blew,

but the method "onEnter" had not being call at the time scene show.

what's should I define this class?


waxClass{"EnterScene", CCScene}


function EnterScene:scene()

    self = CCScene:node()

    local background = CCSprite:spriteWithFile("bck.png")

background:setPosition(CGPoint(320/2, 480/2))

self:addChild(background)


    return self

end

 

function EnterScene:onEnter()

    puts('===donot run this code?==')

end


Reply all
Reply to author
Forward
0 new messages