Cocos2d CCSPrite维度问题

时间:2012-08-31 03:39:21

标签: cocos2d-iphone

self.background = [CCSprite spriteWithFile:@"LetterBrick.png"];
    CCLOG(@"background contentSize: (w: %d, h: %d)", self.background.contentSize.width, self.background.contentSize.height);
    CCLOG(@"background boundingBox: (x: %d, y: %d, w: %d, h: %d)", self.background.boundingBox.origin.x, self.background.boundingBox.origin.y, self.background.boundingBox.size.width, self.background.boundingBox.size.height);

    /**
     OUTPUT:
        background contentSize: (w: 0, h: 1078984704)
        background boundingBox: (x: 0, y: -1069547520, w: 0, h: -1069547520)
     */

所以基本上我只是从文件创建一个CCSprite,并打印出contentize和边界框。但这些价值观似乎有些奇怪。

你能帮帮我吗? :)

1 个答案:

答案 0 :(得分:0)

打印出来时使用浮点数而不是整数