使用 CoreGraphics 而不是 SpriteKit 的原因?
Reasons to use CoreGraphics instead of SpriteKit?
SpriteKit 在 GPU 上高效运行。
CoreGraphics 在 CPU.
上运行
我想不出任何 CoreGraphics 可以做而 SpriteKit 做不到的绘图。
鉴于此,您能否说出为什么有些人仍然希望在新应用中更喜欢 CoreGraphics 而不是 SpriteKit 的原因?
不是"either or"的问题,因为他们的能力存在差距
Core Graphics 可以制作非常复杂的图像,通过具有不同效果和内容的令人难以置信的复杂图层构建。但最重要的是,它非常擅长以其他 iOS 框架无法比拟的质量绘制形状和线条。正如苹果所说:
Core Graphics... provides low-level, lightweight 2D rendering with
unmatched output fidelity. You use this framework to handle path-based
drawing, transformations, color management, offscreen rendering,
patterns, gradients and shadings, image data management, image
creation, and image masking, as well as PDF document creation,
display, and parsing.
https://developer.apple.com/reference/coregraphics
您不会在 SpriteKit 中找到带有上下文的 PDF 导出创建、图像创建(纹理创建,是的,但不是图像创建),也不会找到复杂的渐变、颜色管理、复杂的图案、转换和屏幕外渲染。
同样,在SpriteKit中,你不会在Core Graphics中找到那种anti-aliasing。
如果你想将你的图像制作作品集成到 UIKit 应用程序中,你最好混合使用 Core Graphics、Core Image 和 Core Animation,而不是尝试使用 SpriteKit 进行此类图像创作和应用中的动画。
将 SpriteKit 用于可适当受益于将 Sprites 作为主要图形内容的游戏。
例如,您可以为专注于更多动态内容的游戏选择 Core Animation 和 Core Graphics,或者需要比仅从 SpriteKit 获得的更高质量的程序创建内容。或者,您可以使用 Core Graphics 以比从 SKShapeNode 中获得的质量更高的质量为精灵制作内容。
所以...课程的马匹。
课程基本上是:
A) 精灵和简单的 2D 渲染和绘图
B) 各种图形、动态绘图以及对质量和输出类型的更高要求
或
C) 两者有点混合
SpriteKit 在 GPU 上高效运行。
CoreGraphics 在 CPU.
上运行我想不出任何 CoreGraphics 可以做而 SpriteKit 做不到的绘图。
鉴于此,您能否说出为什么有些人仍然希望在新应用中更喜欢 CoreGraphics 而不是 SpriteKit 的原因?
不是"either or"的问题,因为他们的能力存在差距
Core Graphics 可以制作非常复杂的图像,通过具有不同效果和内容的令人难以置信的复杂图层构建。但最重要的是,它非常擅长以其他 iOS 框架无法比拟的质量绘制形状和线条。正如苹果所说:
Core Graphics... provides low-level, lightweight 2D rendering with unmatched output fidelity. You use this framework to handle path-based drawing, transformations, color management, offscreen rendering, patterns, gradients and shadings, image data management, image creation, and image masking, as well as PDF document creation, display, and parsing.
https://developer.apple.com/reference/coregraphics
您不会在 SpriteKit 中找到带有上下文的 PDF 导出创建、图像创建(纹理创建,是的,但不是图像创建),也不会找到复杂的渐变、颜色管理、复杂的图案、转换和屏幕外渲染。
同样,在SpriteKit中,你不会在Core Graphics中找到那种anti-aliasing。
如果你想将你的图像制作作品集成到 UIKit 应用程序中,你最好混合使用 Core Graphics、Core Image 和 Core Animation,而不是尝试使用 SpriteKit 进行此类图像创作和应用中的动画。
将 SpriteKit 用于可适当受益于将 Sprites 作为主要图形内容的游戏。
例如,您可以为专注于更多动态内容的游戏选择 Core Animation 和 Core Graphics,或者需要比仅从 SpriteKit 获得的更高质量的程序创建内容。或者,您可以使用 Core Graphics 以比从 SKShapeNode 中获得的质量更高的质量为精灵制作内容。
所以...课程的马匹。
课程基本上是:
A) 精灵和简单的 2D 渲染和绘图
B) 各种图形、动态绘图以及对质量和输出类型的更高要求
或
C) 两者有点混合