简体   繁体   中英

When should I use SKShapeNode over SKSpriteNode?

I'm not really sure what is the point of using skshapenode when all the things you can do can be done on SKSpriteNode. Are there any uses cases that you've came across where SKShapeNode is absolutely needed?

Thanks

Flexibility and detail.

Image processing is a completely different approach than vector processing, the latter which you can only accomplish with SKShapeNode, which derives from a graphics context for drawing. Using Paths for drawing is extremely powerful. You can shade subsections of your shape, and change them or easily create variant objects with different subsection qualities.

You can dynamically draw and revise and scale a shape node.

Images and textures don't afford that level of flexibility. For example, what if you just want to change one line in a texture or image to a new color?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM