Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Game with Sprite Kit Physics and Collision Adding Enemies

SKSpriteNode default size

Hi,

I'm following this course by writing the game with swift, and I'm a bit surprised because for some reason my spacedog_A node is not created at the correct size of the image.

Instead, the node seems to be a rectangle, and so the image looks bad.

Is there any reason why this is behaving like this ?

Thanks

Are you setting a size to the image via Code?

2 Answers

I'm not setting a size to the image, rather creating my node directly with "imageNamed"

Have you created an outlet for it? If so check the settings via storyboard under the view mode.

Can you post the code. or share the project. I'll take a look at it for you if you want.

No outlet, just declared and positioned straight from my GameScene swift file. What's surprising if that it only happens with this particular image but all of my other sprites were created at original image size