0
votes
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)
     */

So basicly I'm just creating a CCSprite from a file, and printing out the contentsize and the boundingbox. But those values seems a little odd.

Can you help me please? :)

1
oups. just realized it was floats not ints :p - chrs
UIKit has helper functions for making NSStrings from CGRect and CGSize: NSStringFromCGRect() and NSStringFromCGSize(). See UIKit function reference for more string conversion functions. - Kreiri
Well wasn't the problem, but seems like a good tool :) thx for sharing - chrs

1 Answers

0
votes

Use floats instead of integer when printing them out