Skip to content

Commit

Permalink
fix #8 added convert className
Browse files Browse the repository at this point in the history
  • Loading branch information
kyokomi committed Sep 15, 2014
1 parent bf798f6 commit ece6317
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spritebuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ var CCBConvertClassMapping = map[string]string{
"CCSprite9Slice": "cocos2d::extension::Scale9Sprite",
"CCSprite": "cocos2d::Sprite",
"CCLabelTTF": "cocos2d::Label",
"CCButton": "cocos2d::extension::ControlButton",
"CCBFile": "cocos2d::Node",
"CCNode": "cocos2d::Node",
}

type ccbRoot struct {
Expand All @@ -45,6 +48,10 @@ type children struct {
}

func (c *children) Cocos2dxClassName() string {
customClass := c.getCCBCustomClass()
if customClass != "" {
return customClass
}
return CCBConvertClassMapping[c.BaseClass]
}

Expand Down

0 comments on commit ece6317

Please sign in to comment.