SKSpriteNode - create a round corner node?

前端 未结 8 1423
猫巷女王i
猫巷女王i 2020-12-01 05:10

Is there a way to make a SKSpriteNode round cornered? I am trying to create a Tile likesqaure blocks with color filled SKSpriteNode:

SKSpriteNode *tile = [SK         


        
8条回答
  •  鱼传尺愫
    2020-12-01 05:44

    from the class reference:

    "An SKSpriteNode is a node that draws a textured image, a colored square, or a textured image blended with a color."

    It seems the easiest way is to draw a block with rounded corners and then use one of these class methods:

    • spriteNodeWithImageNamed:
    • spriteNodeWithTexture:
    • spriteNodeWithTexture:size:

提交回复
热议问题