Sprite kit and colorWithPatternImage

后端 未结 3 1745
傲寒
傲寒 2020-11-29 11:32

Do we have any way of repeating an image across an area, like a SKSpriteNode? SKColor colorWithPatternImage doesn\'t work unfortunately.

Edit:

I

3条回答
  •  难免孤独
    2020-11-29 12:10

    Yes, it is possible to implement that with a call to CGContextDrawTiledImage(), but that wastes a lot of memory for medium and large size nodes. A significantly improved approach is provided at spritekit_repeat_shader. This blog post provides example GLSL code and BSD licensed source is provided.

提交回复
热议问题