Sprite Kit OS X: SKTexture size property is incorrect

后端 未结 2 1242
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-10 17:55

I\'m testing a game on the OS X version of Sprite Kit, and find that some textures report their size incorrectly. I\'m wondering if anyone else is seeing this problem and wh

2条回答
  •  孤街浪徒
    2020-12-10 18:42

    Do you create texture with regular methods or actually show it on screen? I had similar issue with animations today, and I think this has to do with lazy lading of textures. They don't actually load until the time you have to use them. Try using this and checking size:

        [tempTexture preloadWithCompletionHandler:^{}];
    

    This also might explain why the rect is 0,0,1,1

提交回复
热议问题