mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Add boundsProvider parameter to renderToImage function
This commit is contained in:
parent
07b8d96e19
commit
38b32bde58
@ -39,9 +39,10 @@ public extension SkeletonDrawableWrapper {
|
||||
/// - size: The size of the `CGImage` that should be rendered.
|
||||
/// - 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
|
||||
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(
|
||||
controller: SpineController(disposeDrawableOnDeInit: false), // Doesn't own the drawable
|
||||
boundsProvider: boundsProvider,
|
||||
backgroundColor: backgroundColor
|
||||
)
|
||||
spineView.frame = CGRect(origin: .zero, size: size)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user