mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Merge 1eb1c4c90e1186aa5bdf49446a6e2164104dbfad into 61e29d51d940de15718eb5e6c7c1325ee4248f85
This commit is contained in:
commit
1ca466a0dc
@ -39,9 +39,10 @@ public extension SkeletonDrawableWrapper {
|
|||||||
/// - size: The size of the `CGImage` that should be rendered.
|
/// - size: The size of the `CGImage` that should be rendered.
|
||||||
/// - backgroundColor: the background color of the image
|
/// - backgroundColor: the background color of the image
|
||||||
/// - scaleFactor: The scale factor. Set this to `UIScreen.main.scale` if you want to show the image in a view
|
/// - scaleFactor: The scale factor. Set this to `UIScreen.main.scale` if you want to show the image in a view
|
||||||
func renderToImage(size: CGSize, backgroundColor: UIColor, scaleFactor: CGFloat = 1) throws -> CGImage? {
|
func renderToImage(size: CGSize, boundsProvider: BoundsProvider = SetupPoseBounds(), backgroundColor: UIColor, scaleFactor: CGFloat = 1) throws -> CGImage? {
|
||||||
let spineView = SpineUIView(
|
let spineView = SpineUIView(
|
||||||
controller: SpineController(disposeDrawableOnDeInit: false), // Doesn't own the drawable
|
controller: SpineController(disposeDrawableOnDeInit: false), // Doesn't own the drawable
|
||||||
|
boundsProvider: boundsProvider,
|
||||||
backgroundColor: backgroundColor
|
backgroundColor: backgroundColor
|
||||||
)
|
)
|
||||||
spineView.frame = CGRect(origin: .zero, size: size)
|
spineView.frame = CGRect(origin: .zero, size: size)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user