mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ios] Regenerate bindings and fix example disposal timing
This commit is contained in:
parent
d70f9444a2
commit
9b969202e8
@ -69,6 +69,11 @@ struct AnimationStateEvents: View {
|
|||||||
controller: controller
|
controller: controller
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
.onDisappear {
|
||||||
|
// SwiftUI may retain the @StateObject controller after the view disappears.
|
||||||
|
// Explicit disposal is only needed here so leak reporting runs after native teardown.
|
||||||
|
controller.dispose()
|
||||||
|
}
|
||||||
.navigationTitle("Animation State Listener")
|
.navigationTitle("Animation State Listener")
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,6 +51,11 @@ struct DebugRendering: View {
|
|||||||
.frame(width: boneLocation.width, height: boneLocation.height)
|
.frame(width: boneLocation.width, height: boneLocation.height)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.onDisappear {
|
||||||
|
// SwiftUI may retain the @StateObject model after the view disappears.
|
||||||
|
// Explicit disposal is only needed here so leak reporting runs after native teardown.
|
||||||
|
model.dispose()
|
||||||
|
}
|
||||||
.navigationTitle("Debug Rendering")
|
.navigationTitle("Debug Rendering")
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
}
|
}
|
||||||
@ -62,6 +67,14 @@ struct DebugRendering: View {
|
|||||||
|
|
||||||
final class DebugRenderingModel: ObservableObject {
|
final class DebugRenderingModel: ObservableObject {
|
||||||
|
|
||||||
|
// Not strictly necessary for normal usage. SwiftUI will eventually release the
|
||||||
|
// model and controller. We dispose explicitly here so leak reporting runs after
|
||||||
|
// native teardown when navigating back from the example.
|
||||||
|
func dispose() {
|
||||||
|
controller.dispose()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Published
|
@Published
|
||||||
var controller: SpineController!
|
var controller: SpineController!
|
||||||
|
|
||||||
|
|||||||
@ -76,6 +76,11 @@ struct DisableRendering: View {
|
|||||||
.frame(minHeight: 400)
|
.frame(minHeight: 400)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.onDisappear {
|
||||||
|
// SwiftUI may retain the @StateObject controller after the view disappears.
|
||||||
|
// Explicit disposal is only needed here so leak reporting runs after native teardown.
|
||||||
|
controller.dispose()
|
||||||
|
}
|
||||||
.navigationTitle("Disable Rendering")
|
.navigationTitle("Disable Rendering")
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,6 +64,20 @@ struct DressUp: View {
|
|||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.onDisappear {
|
||||||
|
// SwiftUI may retain the @StateObject model after the view disappears.
|
||||||
|
// Explicit disposal is only needed here so leak reporting runs after native teardown.
|
||||||
|
model.dispose()
|
||||||
|
|
||||||
|
// This example also passes the drawable directly to SpineView via .drawable(...).
|
||||||
|
// SwiftUI can keep the disappearing view alive for a bit longer, so delay leak
|
||||||
|
// reporting until that view and its source have been released.
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
reportLeaks()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
.navigationTitle("Dress Up")
|
.navigationTitle("Dress Up")
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
}
|
}
|
||||||
@ -75,6 +89,21 @@ struct DressUp: View {
|
|||||||
|
|
||||||
final class DressUpModel: ObservableObject {
|
final class DressUpModel: ObservableObject {
|
||||||
|
|
||||||
|
// Not strictly necessary for normal usage. SwiftUI will eventually release the
|
||||||
|
// model and controller. We dispose explicitly here so leak reporting runs after
|
||||||
|
// native teardown when navigating back from the example.
|
||||||
|
func dispose() {
|
||||||
|
disposed = true
|
||||||
|
loadTask?.cancel()
|
||||||
|
loadTask = nil
|
||||||
|
controller.dispose()
|
||||||
|
drawable?.dispose()
|
||||||
|
drawable = nil
|
||||||
|
customSkin?.dispose()
|
||||||
|
customSkin = nil
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
let thumbnailSize = CGSize(width: 200, height: 200)
|
let thumbnailSize = CGSize(width: 200, height: 200)
|
||||||
let boundsProvider: BoundsProvider = SkinAndAnimationBounds(skins: ["full-skins/girl"])
|
let boundsProvider: BoundsProvider = SkinAndAnimationBounds(skins: ["full-skins/girl"])
|
||||||
|
|
||||||
@ -91,6 +120,8 @@ final class DressUpModel: ObservableObject {
|
|||||||
var selectedSkins = [String: Bool]()
|
var selectedSkins = [String: Bool]()
|
||||||
|
|
||||||
private var customSkin: Skin?
|
private var customSkin: Skin?
|
||||||
|
private var loadTask: Task<Void, Never>?
|
||||||
|
private var disposed = false
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
controller = SpineController(
|
controller = SpineController(
|
||||||
@ -99,37 +130,56 @@ final class DressUpModel: ObservableObject {
|
|||||||
},
|
},
|
||||||
disposeDrawableOnDeInit: false
|
disposeDrawableOnDeInit: false
|
||||||
)
|
)
|
||||||
Task.detached(priority: .high) {
|
loadTask = Task.detached(priority: .high) { [weak self] in
|
||||||
let drawable = try await SkeletonDrawableWrapper.fromBundle(
|
guard let self else { return }
|
||||||
atlasFileName: "mix-and-match-pma.atlas",
|
do {
|
||||||
skeletonFileName: "mix-and-match-pro.skel"
|
let drawable = try await SkeletonDrawableWrapper.fromBundle(
|
||||||
)
|
atlasFileName: "mix-and-match-pma.atlas",
|
||||||
try await MainActor.run {
|
skeletonFileName: "mix-and-match-pro.skel"
|
||||||
let skins = drawable.skeletonData.skins
|
)
|
||||||
for i in 0..<skins.count {
|
if Task.isCancelled {
|
||||||
guard let skin = skins[i] else { continue }
|
drawable.dispose()
|
||||||
if skin.name == "default" { continue }
|
return
|
||||||
let skeleton = drawable.skeleton
|
|
||||||
skeleton.setSkin2(skin)
|
|
||||||
skeleton.setupPose()
|
|
||||||
skeleton.update(0)
|
|
||||||
skeleton.updateWorldTransform(SpineSwift.Physics.update)
|
|
||||||
let skinName = skin.name
|
|
||||||
self.skinImages[skinName] = try drawable.renderToImage(
|
|
||||||
size: self.thumbnailSize,
|
|
||||||
boundsProvider: self.boundsProvider,
|
|
||||||
backgroundColor: .white,
|
|
||||||
scaleFactor: UIScreen.main.scale
|
|
||||||
)
|
|
||||||
self.selectedSkins[skinName] = false
|
|
||||||
}
|
}
|
||||||
self.toggleSkin(skinName: "full-skins/girl", drawable: drawable)
|
try await MainActor.run {
|
||||||
self.drawable = drawable
|
if self.disposed || Task.isCancelled {
|
||||||
|
drawable.dispose()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let skins = drawable.skeletonData.skins
|
||||||
|
for i in 0..<skins.count {
|
||||||
|
if self.disposed || Task.isCancelled {
|
||||||
|
drawable.dispose()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
guard let skin = skins[i] else { continue }
|
||||||
|
if skin.name == "default" { continue }
|
||||||
|
let skeleton = drawable.skeleton
|
||||||
|
skeleton.setSkin2(skin)
|
||||||
|
skeleton.setupPose()
|
||||||
|
skeleton.update(0)
|
||||||
|
skeleton.updateWorldTransform(SpineSwift.Physics.update)
|
||||||
|
let skinName = skin.name
|
||||||
|
self.skinImages[skinName] = try drawable.renderToImage(
|
||||||
|
size: self.thumbnailSize,
|
||||||
|
boundsProvider: self.boundsProvider,
|
||||||
|
backgroundColor: .white,
|
||||||
|
scaleFactor: UIScreen.main.scale
|
||||||
|
)
|
||||||
|
self.selectedSkins[skinName] = false
|
||||||
|
}
|
||||||
|
self.toggleSkin(skinName: "full-skins/girl", drawable: drawable)
|
||||||
|
self.drawable = drawable
|
||||||
|
self.loadTask = nil
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
print(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
|
loadTask?.cancel()
|
||||||
drawable?.dispose()
|
drawable?.dispose()
|
||||||
customSkin?.dispose()
|
customSkin?.dispose()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,6 +49,11 @@ struct IKFollowing: View {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
.onDisappear {
|
||||||
|
// SwiftUI may retain the @StateObject model after the view disappears.
|
||||||
|
// Explicit disposal is only needed here so leak reporting runs after native teardown.
|
||||||
|
model.dispose()
|
||||||
|
}
|
||||||
.navigationTitle("IK Following")
|
.navigationTitle("IK Following")
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
}
|
}
|
||||||
@ -65,6 +70,14 @@ struct IKFollowing: View {
|
|||||||
|
|
||||||
final class IKFollowingModel: ObservableObject {
|
final class IKFollowingModel: ObservableObject {
|
||||||
|
|
||||||
|
// Not strictly necessary for normal usage. SwiftUI will eventually release the
|
||||||
|
// model and controller. We dispose explicitly here so leak reporting runs after
|
||||||
|
// native teardown when navigating back from the example.
|
||||||
|
func dispose() {
|
||||||
|
controller.dispose()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Published
|
@Published
|
||||||
var controller: SpineController!
|
var controller: SpineController!
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,9 @@ struct LeakReporter: ViewModifier {
|
|||||||
func body(content: Content) -> some View {
|
func body(content: Content) -> some View {
|
||||||
content
|
content
|
||||||
.onDisappear {
|
.onDisappear {
|
||||||
reportLeaks()
|
DispatchQueue.main.async {
|
||||||
|
reportLeaks()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,7 +71,6 @@ struct MainView: View {
|
|||||||
}
|
}
|
||||||
NavigationLink("Dress Up") {
|
NavigationLink("Dress Up") {
|
||||||
DressUp()
|
DressUp()
|
||||||
.reportLeaksOnDisappear()
|
|
||||||
}
|
}
|
||||||
NavigationLink("IK Following") {
|
NavigationLink("IK Following") {
|
||||||
IKFollowing()
|
IKFollowing()
|
||||||
|
|||||||
@ -49,6 +49,11 @@ struct Physics: View {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
.onDisappear {
|
||||||
|
// SwiftUI may retain the @StateObject model after the view disappears.
|
||||||
|
// Explicit disposal is only needed here so leak reporting runs after native teardown.
|
||||||
|
model.dispose()
|
||||||
|
}
|
||||||
.navigationTitle("Physics (drag anywhere)")
|
.navigationTitle("Physics (drag anywhere)")
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
}
|
}
|
||||||
@ -60,6 +65,14 @@ struct Physics: View {
|
|||||||
|
|
||||||
final class PhysicsModel: ObservableObject {
|
final class PhysicsModel: ObservableObject {
|
||||||
|
|
||||||
|
// Not strictly necessary for normal usage. SwiftUI will eventually release the
|
||||||
|
// model and controller. We dispose explicitly here so leak reporting runs after
|
||||||
|
// native teardown when navigating back from the example.
|
||||||
|
func dispose() {
|
||||||
|
controller.dispose()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Published
|
@Published
|
||||||
var controller: SpineController!
|
var controller: SpineController!
|
||||||
|
|
||||||
|
|||||||
@ -49,6 +49,11 @@ struct PlayPauseAnimation: View {
|
|||||||
controller: controller,
|
controller: controller,
|
||||||
boundsProvider: SkinAndAnimationBounds(animation: "flying")
|
boundsProvider: SkinAndAnimationBounds(animation: "flying")
|
||||||
)
|
)
|
||||||
|
.onDisappear {
|
||||||
|
// SwiftUI may retain the @StateObject controller after the view disappears.
|
||||||
|
// Explicit disposal is only needed here so leak reporting runs after native teardown.
|
||||||
|
controller.dispose()
|
||||||
|
}
|
||||||
.navigationTitle("Play/Pause")
|
.navigationTitle("Play/Pause")
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
.toolbar {
|
.toolbar {
|
||||||
|
|||||||
@ -50,6 +50,11 @@ struct SimpleAnimation: View {
|
|||||||
mode: .fit,
|
mode: .fit,
|
||||||
alignment: .center
|
alignment: .center
|
||||||
)
|
)
|
||||||
|
.onDisappear {
|
||||||
|
// SwiftUI may retain the @StateObject controller after the view disappears.
|
||||||
|
// Explicit disposal is only needed here so leak reporting runs after native teardown.
|
||||||
|
controller.dispose()
|
||||||
|
}
|
||||||
.navigationTitle("Simple Animation")
|
.navigationTitle("Simple Animation")
|
||||||
.navigationBarTitleDisplayMode(.inline)
|
.navigationBarTitleDisplayMode(.inline)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,6 +33,7 @@
|
|||||||
@interface SimpleAnimationViewController ()
|
@interface SimpleAnimationViewController ()
|
||||||
|
|
||||||
@property (nonatomic, strong) SpineController *spineController;
|
@property (nonatomic, strong) SpineController *spineController;
|
||||||
|
@property (nonatomic, strong) SpineUIView *spineView;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@ -56,18 +57,28 @@
|
|||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
|
|
||||||
SpineUIView *spineView = [[SpineUIView alloc] initWithAtlasFileName:@"spineboy-pma.atlas"
|
self.spineView = [[SpineUIView alloc] initWithAtlasFileName:@"spineboy-pma.atlas"
|
||||||
skeletonFileName:@"spineboy-pro.skel"
|
skeletonFileName:@"spineboy-pro.skel"
|
||||||
bundle:[NSBundle mainBundle]
|
bundle:[NSBundle mainBundle]
|
||||||
controller:self.spineController
|
controller:self.spineController
|
||||||
mode:SpineContentModeFit
|
mode:SpineContentModeFit
|
||||||
alignment:SpineAlignmentCenter
|
alignment:SpineAlignmentCenter
|
||||||
boundsProvider:[[SpineSetupPoseBounds alloc] init]
|
boundsProvider:[[SpineSetupPoseBounds alloc] init]
|
||||||
backgroundColor:[UIColor clearColor]];
|
backgroundColor:[UIColor clearColor]];
|
||||||
spineView.frame = self.view.bounds;
|
self.spineView.frame = self.view.bounds;
|
||||||
spineView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
self.spineView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
||||||
|
|
||||||
[self.view addSubview:spineView];
|
[self.view addSubview:self.spineView];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)viewDidDisappear:(BOOL)animated {
|
||||||
|
[super viewDidDisappear:animated];
|
||||||
|
|
||||||
|
// UIKit will eventually release the view controller and controller. We dispose
|
||||||
|
// explicitly here so leak reporting runs after native teardown when navigating back.
|
||||||
|
[self.spineController dispose];
|
||||||
|
[self.spineView removeFromSuperview];
|
||||||
|
self.spineView = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -53,11 +53,10 @@ public class Animation: NSObject {
|
|||||||
public var timelines: ArrayTimeline {
|
public var timelines: ArrayTimeline {
|
||||||
get {
|
get {
|
||||||
let result = spine_animation_get_timelines(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
let result = spine_animation_get_timelines(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
||||||
return ArrayTimeline(fromPointer: result!)
|
return ArrayTimeline(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_animation_set_timelines(
|
spine_animation_set_timelines(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_timeline_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_timeline_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +66,7 @@ public class Animation: NSObject {
|
|||||||
public var duration: Float {
|
public var duration: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_animation_get_duration(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
let result = spine_animation_get_duration(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_animation_set_duration(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), newValue)
|
spine_animation_set_duration(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), newValue)
|
||||||
@ -88,8 +87,7 @@ public class Animation: NSObject {
|
|||||||
|
|
||||||
/// Returns true if this animation contains a timeline with any of the specified property IDs.
|
/// Returns true if this animation contains a timeline with any of the specified property IDs.
|
||||||
public func hasTimeline(_ ids: ArrayPropertyId) -> Bool {
|
public func hasTimeline(_ ids: ArrayPropertyId) -> Bool {
|
||||||
let result = spine_animation_has_timeline(
|
let result = spine_animation_has_timeline(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), ids._ptr.assumingMemoryBound(to: spine_array_property_id_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), ids._ptr.assumingMemoryBound(to: spine_array_property_id_wrapper.self))
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,14 +103,8 @@ public class Animation: NSObject {
|
|||||||
/// - Parameter alpha: 0 applies the current or setup values (depending on blend). 1 applies the timeline values. Between 0 and 1 applies values between the current or setup values and the timeline values. By adjusting alpha over time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layering).
|
/// - Parameter alpha: 0 applies the current or setup values (depending on blend). 1 applies the timeline values. Between 0 and 1 applies values between the current or setup values and the timeline values. By adjusting alpha over time, an animation can be mixed in or out. alpha can also be useful to apply animations on top of each other (layering).
|
||||||
/// - Parameter blend: Controls how mixing is applied when alpha < 1.
|
/// - Parameter blend: Controls how mixing is applied when alpha < 1.
|
||||||
/// - Parameter direction: Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions, such as DrawOrderTimeline or AttachmentTimeline.
|
/// - Parameter direction: Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions, such as DrawOrderTimeline or AttachmentTimeline.
|
||||||
public func apply(
|
public func apply(_ skeleton: Skeleton, _ lastTime: Float, _ time: Float, _ loop: Bool, _ events: ArrayEvent?, _ alpha: Float, _ blend: MixBlend, _ direction: MixDirection, _ appliedPose: Bool) {
|
||||||
_ skeleton: Skeleton, _ lastTime: Float, _ time: Float, _ loop: Bool, _ events: ArrayEvent?, _ alpha: Float, _ blend: MixBlend,
|
spine_animation_apply(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), lastTime, time, loop, events?._ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), spine_mix_direction(rawValue: UInt32(direction.rawValue)), appliedPose)
|
||||||
_ direction: MixDirection, _ appliedPose: Bool
|
|
||||||
) {
|
|
||||||
spine_animation_apply(
|
|
||||||
_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), lastTime,
|
|
||||||
time, loop, events?._ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), alpha,
|
|
||||||
spine_mix_blend(rawValue: UInt32(blend.rawValue)), spine_mix_direction(rawValue: UInt32(direction.rawValue)), appliedPose)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// - Parameter target: After the first and before the last entry.
|
/// - Parameter target: After the first and before the last entry.
|
||||||
|
|||||||
@ -381,8 +381,7 @@ public class ArrayAnimation: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: Animation?) {
|
public func add(_ value: Animation?) {
|
||||||
spine_array_animation_add(
|
spine_array_animation_add(_ptr.assumingMemoryBound(to: spine_array_animation_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_animation_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -460,8 +459,7 @@ public class ArrayAtlasPage: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: AtlasPage?) {
|
public func add(_ value: AtlasPage?) {
|
||||||
spine_array_atlas_page_add(
|
spine_array_atlas_page_add(_ptr.assumingMemoryBound(to: spine_array_atlas_page_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_atlas_page_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -539,8 +537,7 @@ public class ArrayAtlasRegion: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: AtlasRegion?) {
|
public func add(_ value: AtlasRegion?) {
|
||||||
spine_array_atlas_region_add(
|
spine_array_atlas_region_add(_ptr.assumingMemoryBound(to: spine_array_atlas_region_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_atlas_region_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -614,36 +611,35 @@ public class ArrayAttachment: NSObject {
|
|||||||
let elementPtr = buffer[Int(index)]
|
let elementPtr = buffer[Int(index)]
|
||||||
guard let ptr = elementPtr else { return nil }
|
guard let ptr = elementPtr else { return nil }
|
||||||
let rtti = spine_attachment_get_rtti(ptr)
|
let rtti = spine_attachment_get_rtti(ptr)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
case "BoundingBoxAttachment":
|
case "BoundingBoxAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(ptr)
|
||||||
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
||||||
case "ClippingAttachment":
|
case "ClippingAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_clipping_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_clipping_attachment(ptr)
|
||||||
return ClippingAttachment(fromPointer: castedPtr!)
|
return ClippingAttachment(fromPointer: castedPtr!)
|
||||||
case "MeshAttachment":
|
case "MeshAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_mesh_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_mesh_attachment(ptr)
|
||||||
return MeshAttachment(fromPointer: castedPtr!)
|
return MeshAttachment(fromPointer: castedPtr!)
|
||||||
case "PathAttachment":
|
case "PathAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_path_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_path_attachment(ptr)
|
||||||
return PathAttachment(fromPointer: castedPtr!)
|
return PathAttachment(fromPointer: castedPtr!)
|
||||||
case "PointAttachment":
|
case "PointAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_point_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_point_attachment(ptr)
|
||||||
return PointAttachment(fromPointer: castedPtr!)
|
return PointAttachment(fromPointer: castedPtr!)
|
||||||
case "RegionAttachment":
|
case "RegionAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_region_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_region_attachment(ptr)
|
||||||
return RegionAttachment(fromPointer: castedPtr!)
|
return RegionAttachment(fromPointer: castedPtr!)
|
||||||
default:
|
default:
|
||||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: Attachment?) {
|
public func add(_ value: Attachment?) {
|
||||||
spine_array_attachment_add(
|
spine_array_attachment_add(_ptr.assumingMemoryBound(to: spine_array_attachment_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_attachment_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -721,8 +717,7 @@ public class ArrayBone: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: Bone?) {
|
public func add(_ value: Bone?) {
|
||||||
spine_array_bone_add(
|
spine_array_bone_add(_ptr.assumingMemoryBound(to: spine_array_bone_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_bone_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -800,8 +795,7 @@ public class ArrayBoneData: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: BoneData?) {
|
public func add(_ value: BoneData?) {
|
||||||
spine_array_bone_data_add(
|
spine_array_bone_data_add(_ptr.assumingMemoryBound(to: spine_array_bone_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_bone_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -879,8 +873,7 @@ public class ArrayBonePose: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: BonePose?) {
|
public func add(_ value: BonePose?) {
|
||||||
spine_array_bone_pose_add(
|
spine_array_bone_pose_add(_ptr.assumingMemoryBound(to: spine_array_bone_pose_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_bone_pose_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -958,9 +951,7 @@ public class ArrayBoundingBoxAttachment: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: BoundingBoxAttachment?) {
|
public func add(_ value: BoundingBoxAttachment?) {
|
||||||
spine_array_bounding_box_attachment_add(
|
spine_array_bounding_box_attachment_add(_ptr.assumingMemoryBound(to: spine_array_bounding_box_attachment_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_bounding_box_attachment_wrapper.self),
|
|
||||||
value?._ptr.assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -981,8 +972,7 @@ public class ArrayBoundingBoxAttachment: NSObject {
|
|||||||
public var length: Int {
|
public var length: Int {
|
||||||
get { count }
|
get { count }
|
||||||
set {
|
set {
|
||||||
spine_array_bounding_box_attachment_set_size(
|
spine_array_bounding_box_attachment_set_size(_ptr.assumingMemoryBound(to: spine_array_bounding_box_attachment_wrapper.self), newValue, nil)
|
||||||
_ptr.assumingMemoryBound(to: spine_array_bounding_box_attachment_wrapper.self), newValue, nil)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1035,33 +1025,32 @@ public class ArrayConstraint: NSObject {
|
|||||||
let elementPtr = buffer[Int(index)]
|
let elementPtr = buffer[Int(index)]
|
||||||
guard let ptr = elementPtr else { return nil }
|
guard let ptr = elementPtr else { return nil }
|
||||||
let rtti = spine_constraint_get_rtti(ptr)
|
let rtti = spine_constraint_get_rtti(ptr)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
case "IkConstraint":
|
case "IkConstraint":
|
||||||
let castedPtr = spine_constraint_cast_to_ik_constraint(ptr)
|
let castedPtr = spine_constraint_cast_to_ik_constraint(ptr)
|
||||||
return IkConstraint(fromPointer: castedPtr!)
|
return IkConstraint(fromPointer: castedPtr!)
|
||||||
case "PathConstraint":
|
case "PathConstraint":
|
||||||
let castedPtr = spine_constraint_cast_to_path_constraint(ptr)
|
let castedPtr = spine_constraint_cast_to_path_constraint(ptr)
|
||||||
return PathConstraint(fromPointer: castedPtr!)
|
return PathConstraint(fromPointer: castedPtr!)
|
||||||
case "PhysicsConstraint":
|
case "PhysicsConstraint":
|
||||||
let castedPtr = spine_constraint_cast_to_physics_constraint(ptr)
|
let castedPtr = spine_constraint_cast_to_physics_constraint(ptr)
|
||||||
return PhysicsConstraint(fromPointer: castedPtr!)
|
return PhysicsConstraint(fromPointer: castedPtr!)
|
||||||
case "Slider":
|
case "Slider":
|
||||||
let castedPtr = spine_constraint_cast_to_slider(ptr)
|
let castedPtr = spine_constraint_cast_to_slider(ptr)
|
||||||
return Slider(fromPointer: castedPtr!)
|
return Slider(fromPointer: castedPtr!)
|
||||||
case "TransformConstraint":
|
case "TransformConstraint":
|
||||||
let castedPtr = spine_constraint_cast_to_transform_constraint(ptr)
|
let castedPtr = spine_constraint_cast_to_transform_constraint(ptr)
|
||||||
return TransformConstraint(fromPointer: castedPtr!)
|
return TransformConstraint(fromPointer: castedPtr!)
|
||||||
default:
|
default:
|
||||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
|
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: Constraint?) {
|
public func add(_ value: Constraint?) {
|
||||||
spine_array_constraint_add(
|
spine_array_constraint_add(_ptr.assumingMemoryBound(to: spine_array_constraint_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_constraint_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_constraint_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_constraint_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -1135,34 +1124,32 @@ public class ArrayConstraintData: NSObject {
|
|||||||
let elementPtr = buffer[Int(index)]
|
let elementPtr = buffer[Int(index)]
|
||||||
guard let ptr = elementPtr else { return nil }
|
guard let ptr = elementPtr else { return nil }
|
||||||
let rtti = spine_constraint_data_get_rtti(ptr)
|
let rtti = spine_constraint_data_get_rtti(ptr)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
case "IkConstraintData":
|
case "IkConstraintData":
|
||||||
let castedPtr = spine_constraint_data_cast_to_ik_constraint_data(ptr)
|
let castedPtr = spine_constraint_data_cast_to_ik_constraint_data(ptr)
|
||||||
return IkConstraintData(fromPointer: castedPtr!)
|
return IkConstraintData(fromPointer: castedPtr!)
|
||||||
case "PathConstraintData":
|
case "PathConstraintData":
|
||||||
let castedPtr = spine_constraint_data_cast_to_path_constraint_data(ptr)
|
let castedPtr = spine_constraint_data_cast_to_path_constraint_data(ptr)
|
||||||
return PathConstraintData(fromPointer: castedPtr!)
|
return PathConstraintData(fromPointer: castedPtr!)
|
||||||
case "PhysicsConstraintData":
|
case "PhysicsConstraintData":
|
||||||
let castedPtr = spine_constraint_data_cast_to_physics_constraint_data(ptr)
|
let castedPtr = spine_constraint_data_cast_to_physics_constraint_data(ptr)
|
||||||
return PhysicsConstraintData(fromPointer: castedPtr!)
|
return PhysicsConstraintData(fromPointer: castedPtr!)
|
||||||
case "SliderData":
|
case "SliderData":
|
||||||
let castedPtr = spine_constraint_data_cast_to_slider_data(ptr)
|
let castedPtr = spine_constraint_data_cast_to_slider_data(ptr)
|
||||||
return SliderData(fromPointer: castedPtr!)
|
return SliderData(fromPointer: castedPtr!)
|
||||||
case "TransformConstraintData":
|
case "TransformConstraintData":
|
||||||
let castedPtr = spine_constraint_data_cast_to_transform_constraint_data(ptr)
|
let castedPtr = spine_constraint_data_cast_to_transform_constraint_data(ptr)
|
||||||
return TransformConstraintData(fromPointer: castedPtr!)
|
return TransformConstraintData(fromPointer: castedPtr!)
|
||||||
default:
|
default:
|
||||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class ConstraintData")
|
fatalError("Unknown concrete type: \(rttiClassName) for abstract class ConstraintData")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: ConstraintData?) {
|
public func add(_ value: ConstraintData?) {
|
||||||
spine_array_constraint_data_add(
|
spine_array_constraint_data_add(_ptr.assumingMemoryBound(to: spine_array_constraint_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_constraint_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_constraint_data_wrapper.self),
|
|
||||||
value?._ptr.assumingMemoryBound(to: spine_constraint_data_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -1240,8 +1227,7 @@ public class ArrayEvent: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: Event?) {
|
public func add(_ value: Event?) {
|
||||||
spine_array_event_add(
|
spine_array_event_add(_ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -1319,8 +1305,7 @@ public class ArrayEventData: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: EventData?) {
|
public func add(_ value: EventData?) {
|
||||||
spine_array_event_data_add(
|
spine_array_event_data_add(_ptr.assumingMemoryBound(to: spine_array_event_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_event_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -1394,37 +1379,35 @@ public class ArrayFromProperty: NSObject {
|
|||||||
let elementPtr = buffer[Int(index)]
|
let elementPtr = buffer[Int(index)]
|
||||||
guard let ptr = elementPtr else { return nil }
|
guard let ptr = elementPtr else { return nil }
|
||||||
let rtti = spine_from_property_get_rtti(ptr)
|
let rtti = spine_from_property_get_rtti(ptr)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
case "FromRotate":
|
case "FromRotate":
|
||||||
let castedPtr = spine_from_property_cast_to_from_rotate(ptr)
|
let castedPtr = spine_from_property_cast_to_from_rotate(ptr)
|
||||||
return FromRotate(fromPointer: castedPtr!)
|
return FromRotate(fromPointer: castedPtr!)
|
||||||
case "FromScaleX":
|
case "FromScaleX":
|
||||||
let castedPtr = spine_from_property_cast_to_from_scale_x(ptr)
|
let castedPtr = spine_from_property_cast_to_from_scale_x(ptr)
|
||||||
return FromScaleX(fromPointer: castedPtr!)
|
return FromScaleX(fromPointer: castedPtr!)
|
||||||
case "FromScaleY":
|
case "FromScaleY":
|
||||||
let castedPtr = spine_from_property_cast_to_from_scale_y(ptr)
|
let castedPtr = spine_from_property_cast_to_from_scale_y(ptr)
|
||||||
return FromScaleY(fromPointer: castedPtr!)
|
return FromScaleY(fromPointer: castedPtr!)
|
||||||
case "FromShearY":
|
case "FromShearY":
|
||||||
let castedPtr = spine_from_property_cast_to_from_shear_y(ptr)
|
let castedPtr = spine_from_property_cast_to_from_shear_y(ptr)
|
||||||
return FromShearY(fromPointer: castedPtr!)
|
return FromShearY(fromPointer: castedPtr!)
|
||||||
case "FromX":
|
case "FromX":
|
||||||
let castedPtr = spine_from_property_cast_to_from_x(ptr)
|
let castedPtr = spine_from_property_cast_to_from_x(ptr)
|
||||||
return FromX(fromPointer: castedPtr!)
|
return FromX(fromPointer: castedPtr!)
|
||||||
case "FromY":
|
case "FromY":
|
||||||
let castedPtr = spine_from_property_cast_to_from_y(ptr)
|
let castedPtr = spine_from_property_cast_to_from_y(ptr)
|
||||||
return FromY(fromPointer: castedPtr!)
|
return FromY(fromPointer: castedPtr!)
|
||||||
default:
|
default:
|
||||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class FromProperty")
|
fatalError("Unknown concrete type: \(rttiClassName) for abstract class FromProperty")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: FromProperty?) {
|
public func add(_ value: FromProperty?) {
|
||||||
spine_array_from_property_add(
|
spine_array_from_property_add(_ptr.assumingMemoryBound(to: spine_array_from_property_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_from_property_wrapper.self),
|
|
||||||
value?._ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -1502,9 +1485,7 @@ public class ArrayPhysicsConstraint: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: PhysicsConstraint?) {
|
public func add(_ value: PhysicsConstraint?) {
|
||||||
spine_array_physics_constraint_add(
|
spine_array_physics_constraint_add(_ptr.assumingMemoryBound(to: spine_array_physics_constraint_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_physics_constraint_wrapper.self),
|
|
||||||
value?._ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -1582,8 +1563,7 @@ public class ArrayPolygon: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: Polygon?) {
|
public func add(_ value: Polygon?) {
|
||||||
spine_array_polygon_add(
|
spine_array_polygon_add(_ptr.assumingMemoryBound(to: spine_array_polygon_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_polygon_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -1661,8 +1641,7 @@ public class ArraySkin: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: Skin?) {
|
public func add(_ value: Skin?) {
|
||||||
spine_array_skin_add(
|
spine_array_skin_add(_ptr.assumingMemoryBound(to: spine_array_skin_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_skin_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -1740,8 +1719,7 @@ public class ArraySlot: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: Slot?) {
|
public func add(_ value: Slot?) {
|
||||||
spine_array_slot_add(
|
spine_array_slot_add(_ptr.assumingMemoryBound(to: spine_array_slot_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_slot_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -1819,8 +1797,7 @@ public class ArraySlotData: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: SlotData?) {
|
public func add(_ value: SlotData?) {
|
||||||
spine_array_slot_data_add(
|
spine_array_slot_data_add(_ptr.assumingMemoryBound(to: spine_array_slot_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_slot_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -1898,9 +1875,7 @@ public class ArrayTextureRegion: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: TextureRegion?) {
|
public func add(_ value: TextureRegion?) {
|
||||||
spine_array_texture_region_add(
|
spine_array_texture_region_add(_ptr.assumingMemoryBound(to: spine_array_texture_region_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_texture_region_wrapper.self),
|
|
||||||
value?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -1974,126 +1949,125 @@ public class ArrayTimeline: NSObject {
|
|||||||
let elementPtr = buffer[Int(index)]
|
let elementPtr = buffer[Int(index)]
|
||||||
guard let ptr = elementPtr else { return nil }
|
guard let ptr = elementPtr else { return nil }
|
||||||
let rtti = spine_timeline_get_rtti(ptr)
|
let rtti = spine_timeline_get_rtti(ptr)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
case "AlphaTimeline":
|
case "AlphaTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_alpha_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_alpha_timeline(ptr)
|
||||||
return AlphaTimeline(fromPointer: castedPtr!)
|
return AlphaTimeline(fromPointer: castedPtr!)
|
||||||
case "AttachmentTimeline":
|
case "AttachmentTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_attachment_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_attachment_timeline(ptr)
|
||||||
return AttachmentTimeline(fromPointer: castedPtr!)
|
return AttachmentTimeline(fromPointer: castedPtr!)
|
||||||
case "DeformTimeline":
|
case "DeformTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_deform_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_deform_timeline(ptr)
|
||||||
return DeformTimeline(fromPointer: castedPtr!)
|
return DeformTimeline(fromPointer: castedPtr!)
|
||||||
case "DrawOrderTimeline":
|
case "DrawOrderTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_draw_order_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_draw_order_timeline(ptr)
|
||||||
return DrawOrderTimeline(fromPointer: castedPtr!)
|
return DrawOrderTimeline(fromPointer: castedPtr!)
|
||||||
case "EventTimeline":
|
case "EventTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_event_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_event_timeline(ptr)
|
||||||
return EventTimeline(fromPointer: castedPtr!)
|
return EventTimeline(fromPointer: castedPtr!)
|
||||||
case "IkConstraintTimeline":
|
case "IkConstraintTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_ik_constraint_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_ik_constraint_timeline(ptr)
|
||||||
return IkConstraintTimeline(fromPointer: castedPtr!)
|
return IkConstraintTimeline(fromPointer: castedPtr!)
|
||||||
case "InheritTimeline":
|
case "InheritTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_inherit_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_inherit_timeline(ptr)
|
||||||
return InheritTimeline(fromPointer: castedPtr!)
|
return InheritTimeline(fromPointer: castedPtr!)
|
||||||
case "PathConstraintMixTimeline":
|
case "PathConstraintMixTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_path_constraint_mix_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_path_constraint_mix_timeline(ptr)
|
||||||
return PathConstraintMixTimeline(fromPointer: castedPtr!)
|
return PathConstraintMixTimeline(fromPointer: castedPtr!)
|
||||||
case "PathConstraintPositionTimeline":
|
case "PathConstraintPositionTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_path_constraint_position_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_path_constraint_position_timeline(ptr)
|
||||||
return PathConstraintPositionTimeline(fromPointer: castedPtr!)
|
return PathConstraintPositionTimeline(fromPointer: castedPtr!)
|
||||||
case "PathConstraintSpacingTimeline":
|
case "PathConstraintSpacingTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_path_constraint_spacing_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_path_constraint_spacing_timeline(ptr)
|
||||||
return PathConstraintSpacingTimeline(fromPointer: castedPtr!)
|
return PathConstraintSpacingTimeline(fromPointer: castedPtr!)
|
||||||
case "PhysicsConstraintDampingTimeline":
|
case "PhysicsConstraintDampingTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_physics_constraint_damping_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_physics_constraint_damping_timeline(ptr)
|
||||||
return PhysicsConstraintDampingTimeline(fromPointer: castedPtr!)
|
return PhysicsConstraintDampingTimeline(fromPointer: castedPtr!)
|
||||||
case "PhysicsConstraintGravityTimeline":
|
case "PhysicsConstraintGravityTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_physics_constraint_gravity_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_physics_constraint_gravity_timeline(ptr)
|
||||||
return PhysicsConstraintGravityTimeline(fromPointer: castedPtr!)
|
return PhysicsConstraintGravityTimeline(fromPointer: castedPtr!)
|
||||||
case "PhysicsConstraintInertiaTimeline":
|
case "PhysicsConstraintInertiaTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_physics_constraint_inertia_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_physics_constraint_inertia_timeline(ptr)
|
||||||
return PhysicsConstraintInertiaTimeline(fromPointer: castedPtr!)
|
return PhysicsConstraintInertiaTimeline(fromPointer: castedPtr!)
|
||||||
case "PhysicsConstraintMassTimeline":
|
case "PhysicsConstraintMassTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_physics_constraint_mass_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_physics_constraint_mass_timeline(ptr)
|
||||||
return PhysicsConstraintMassTimeline(fromPointer: castedPtr!)
|
return PhysicsConstraintMassTimeline(fromPointer: castedPtr!)
|
||||||
case "PhysicsConstraintMixTimeline":
|
case "PhysicsConstraintMixTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_physics_constraint_mix_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_physics_constraint_mix_timeline(ptr)
|
||||||
return PhysicsConstraintMixTimeline(fromPointer: castedPtr!)
|
return PhysicsConstraintMixTimeline(fromPointer: castedPtr!)
|
||||||
case "PhysicsConstraintResetTimeline":
|
case "PhysicsConstraintResetTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_physics_constraint_reset_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_physics_constraint_reset_timeline(ptr)
|
||||||
return PhysicsConstraintResetTimeline(fromPointer: castedPtr!)
|
return PhysicsConstraintResetTimeline(fromPointer: castedPtr!)
|
||||||
case "PhysicsConstraintStrengthTimeline":
|
case "PhysicsConstraintStrengthTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_physics_constraint_strength_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_physics_constraint_strength_timeline(ptr)
|
||||||
return PhysicsConstraintStrengthTimeline(fromPointer: castedPtr!)
|
return PhysicsConstraintStrengthTimeline(fromPointer: castedPtr!)
|
||||||
case "PhysicsConstraintWindTimeline":
|
case "PhysicsConstraintWindTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_physics_constraint_wind_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_physics_constraint_wind_timeline(ptr)
|
||||||
return PhysicsConstraintWindTimeline(fromPointer: castedPtr!)
|
return PhysicsConstraintWindTimeline(fromPointer: castedPtr!)
|
||||||
case "Rgb2Timeline":
|
case "Rgb2Timeline":
|
||||||
let castedPtr = spine_timeline_cast_to_rgb2_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_rgb2_timeline(ptr)
|
||||||
return Rgb2Timeline(fromPointer: castedPtr!)
|
return Rgb2Timeline(fromPointer: castedPtr!)
|
||||||
case "Rgba2Timeline":
|
case "Rgba2Timeline":
|
||||||
let castedPtr = spine_timeline_cast_to_rgba2_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_rgba2_timeline(ptr)
|
||||||
return Rgba2Timeline(fromPointer: castedPtr!)
|
return Rgba2Timeline(fromPointer: castedPtr!)
|
||||||
case "RgbaTimeline":
|
case "RgbaTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_rgba_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_rgba_timeline(ptr)
|
||||||
return RgbaTimeline(fromPointer: castedPtr!)
|
return RgbaTimeline(fromPointer: castedPtr!)
|
||||||
case "RgbTimeline":
|
case "RgbTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_rgb_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_rgb_timeline(ptr)
|
||||||
return RgbTimeline(fromPointer: castedPtr!)
|
return RgbTimeline(fromPointer: castedPtr!)
|
||||||
case "RotateTimeline":
|
case "RotateTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_rotate_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_rotate_timeline(ptr)
|
||||||
return RotateTimeline(fromPointer: castedPtr!)
|
return RotateTimeline(fromPointer: castedPtr!)
|
||||||
case "ScaleTimeline":
|
case "ScaleTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_scale_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_scale_timeline(ptr)
|
||||||
return ScaleTimeline(fromPointer: castedPtr!)
|
return ScaleTimeline(fromPointer: castedPtr!)
|
||||||
case "ScaleXTimeline":
|
case "ScaleXTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_scale_x_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_scale_x_timeline(ptr)
|
||||||
return ScaleXTimeline(fromPointer: castedPtr!)
|
return ScaleXTimeline(fromPointer: castedPtr!)
|
||||||
case "ScaleYTimeline":
|
case "ScaleYTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_scale_y_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_scale_y_timeline(ptr)
|
||||||
return ScaleYTimeline(fromPointer: castedPtr!)
|
return ScaleYTimeline(fromPointer: castedPtr!)
|
||||||
case "SequenceTimeline":
|
case "SequenceTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_sequence_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_sequence_timeline(ptr)
|
||||||
return SequenceTimeline(fromPointer: castedPtr!)
|
return SequenceTimeline(fromPointer: castedPtr!)
|
||||||
case "ShearTimeline":
|
case "ShearTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_shear_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_shear_timeline(ptr)
|
||||||
return ShearTimeline(fromPointer: castedPtr!)
|
return ShearTimeline(fromPointer: castedPtr!)
|
||||||
case "ShearXTimeline":
|
case "ShearXTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_shear_x_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_shear_x_timeline(ptr)
|
||||||
return ShearXTimeline(fromPointer: castedPtr!)
|
return ShearXTimeline(fromPointer: castedPtr!)
|
||||||
case "ShearYTimeline":
|
case "ShearYTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_shear_y_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_shear_y_timeline(ptr)
|
||||||
return ShearYTimeline(fromPointer: castedPtr!)
|
return ShearYTimeline(fromPointer: castedPtr!)
|
||||||
case "SliderMixTimeline":
|
case "SliderMixTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_slider_mix_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_slider_mix_timeline(ptr)
|
||||||
return SliderMixTimeline(fromPointer: castedPtr!)
|
return SliderMixTimeline(fromPointer: castedPtr!)
|
||||||
case "SliderTimeline":
|
case "SliderTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_slider_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_slider_timeline(ptr)
|
||||||
return SliderTimeline(fromPointer: castedPtr!)
|
return SliderTimeline(fromPointer: castedPtr!)
|
||||||
case "TransformConstraintTimeline":
|
case "TransformConstraintTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_transform_constraint_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_transform_constraint_timeline(ptr)
|
||||||
return TransformConstraintTimeline(fromPointer: castedPtr!)
|
return TransformConstraintTimeline(fromPointer: castedPtr!)
|
||||||
case "TranslateTimeline":
|
case "TranslateTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_translate_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_translate_timeline(ptr)
|
||||||
return TranslateTimeline(fromPointer: castedPtr!)
|
return TranslateTimeline(fromPointer: castedPtr!)
|
||||||
case "TranslateXTimeline":
|
case "TranslateXTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_translate_x_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_translate_x_timeline(ptr)
|
||||||
return TranslateXTimeline(fromPointer: castedPtr!)
|
return TranslateXTimeline(fromPointer: castedPtr!)
|
||||||
case "TranslateYTimeline":
|
case "TranslateYTimeline":
|
||||||
let castedPtr = spine_timeline_cast_to_translate_y_timeline(ptr)
|
let castedPtr = spine_timeline_cast_to_translate_y_timeline(ptr)
|
||||||
return TranslateYTimeline(fromPointer: castedPtr!)
|
return TranslateYTimeline(fromPointer: castedPtr!)
|
||||||
default:
|
default:
|
||||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Timeline")
|
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Timeline")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: Timeline?) {
|
public func add(_ value: Timeline?) {
|
||||||
spine_array_timeline_add(
|
spine_array_timeline_add(_ptr.assumingMemoryBound(to: spine_array_timeline_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_timeline_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_timeline_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_timeline_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -2167,36 +2141,35 @@ public class ArrayToProperty: NSObject {
|
|||||||
let elementPtr = buffer[Int(index)]
|
let elementPtr = buffer[Int(index)]
|
||||||
guard let ptr = elementPtr else { return nil }
|
guard let ptr = elementPtr else { return nil }
|
||||||
let rtti = spine_to_property_get_rtti(ptr)
|
let rtti = spine_to_property_get_rtti(ptr)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
case "ToRotate":
|
case "ToRotate":
|
||||||
let castedPtr = spine_to_property_cast_to_to_rotate(ptr)
|
let castedPtr = spine_to_property_cast_to_to_rotate(ptr)
|
||||||
return ToRotate(fromPointer: castedPtr!)
|
return ToRotate(fromPointer: castedPtr!)
|
||||||
case "ToScaleX":
|
case "ToScaleX":
|
||||||
let castedPtr = spine_to_property_cast_to_to_scale_x(ptr)
|
let castedPtr = spine_to_property_cast_to_to_scale_x(ptr)
|
||||||
return ToScaleX(fromPointer: castedPtr!)
|
return ToScaleX(fromPointer: castedPtr!)
|
||||||
case "ToScaleY":
|
case "ToScaleY":
|
||||||
let castedPtr = spine_to_property_cast_to_to_scale_y(ptr)
|
let castedPtr = spine_to_property_cast_to_to_scale_y(ptr)
|
||||||
return ToScaleY(fromPointer: castedPtr!)
|
return ToScaleY(fromPointer: castedPtr!)
|
||||||
case "ToShearY":
|
case "ToShearY":
|
||||||
let castedPtr = spine_to_property_cast_to_to_shear_y(ptr)
|
let castedPtr = spine_to_property_cast_to_to_shear_y(ptr)
|
||||||
return ToShearY(fromPointer: castedPtr!)
|
return ToShearY(fromPointer: castedPtr!)
|
||||||
case "ToX":
|
case "ToX":
|
||||||
let castedPtr = spine_to_property_cast_to_to_x(ptr)
|
let castedPtr = spine_to_property_cast_to_to_x(ptr)
|
||||||
return ToX(fromPointer: castedPtr!)
|
return ToX(fromPointer: castedPtr!)
|
||||||
case "ToY":
|
case "ToY":
|
||||||
let castedPtr = spine_to_property_cast_to_to_y(ptr)
|
let castedPtr = spine_to_property_cast_to_to_y(ptr)
|
||||||
return ToY(fromPointer: castedPtr!)
|
return ToY(fromPointer: castedPtr!)
|
||||||
default:
|
default:
|
||||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class ToProperty")
|
fatalError("Unknown concrete type: \(rttiClassName) for abstract class ToProperty")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: ToProperty?) {
|
public func add(_ value: ToProperty?) {
|
||||||
spine_array_to_property_add(
|
spine_array_to_property_add(_ptr.assumingMemoryBound(to: spine_array_to_property_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_to_property_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_to_property_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_to_property_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -2274,8 +2247,7 @@ public class ArrayTrackEntry: NSObject {
|
|||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: TrackEntry?) {
|
public func add(_ value: TrackEntry?) {
|
||||||
spine_array_track_entry_add(
|
spine_array_track_entry_add(_ptr.assumingMemoryBound(to: spine_array_track_entry_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_track_entry_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
@ -2349,39 +2321,38 @@ public class ArrayUpdate: NSObject {
|
|||||||
let elementPtr = buffer[Int(index)]
|
let elementPtr = buffer[Int(index)]
|
||||||
guard let ptr = elementPtr else { return nil }
|
guard let ptr = elementPtr else { return nil }
|
||||||
let rtti = spine_update_get_rtti(ptr)
|
let rtti = spine_update_get_rtti(ptr)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
case "Bone":
|
case "Bone":
|
||||||
let castedPtr = spine_update_cast_to_bone(ptr)
|
let castedPtr = spine_update_cast_to_bone(ptr)
|
||||||
return Bone(fromPointer: castedPtr!)
|
return Bone(fromPointer: castedPtr!)
|
||||||
case "BonePose":
|
case "BonePose":
|
||||||
let castedPtr = spine_update_cast_to_bone_pose(ptr)
|
let castedPtr = spine_update_cast_to_bone_pose(ptr)
|
||||||
return BonePose(fromPointer: castedPtr!)
|
return BonePose(fromPointer: castedPtr!)
|
||||||
case "IkConstraint":
|
case "IkConstraint":
|
||||||
let castedPtr = spine_update_cast_to_ik_constraint(ptr)
|
let castedPtr = spine_update_cast_to_ik_constraint(ptr)
|
||||||
return IkConstraint(fromPointer: castedPtr!)
|
return IkConstraint(fromPointer: castedPtr!)
|
||||||
case "PathConstraint":
|
case "PathConstraint":
|
||||||
let castedPtr = spine_update_cast_to_path_constraint(ptr)
|
let castedPtr = spine_update_cast_to_path_constraint(ptr)
|
||||||
return PathConstraint(fromPointer: castedPtr!)
|
return PathConstraint(fromPointer: castedPtr!)
|
||||||
case "PhysicsConstraint":
|
case "PhysicsConstraint":
|
||||||
let castedPtr = spine_update_cast_to_physics_constraint(ptr)
|
let castedPtr = spine_update_cast_to_physics_constraint(ptr)
|
||||||
return PhysicsConstraint(fromPointer: castedPtr!)
|
return PhysicsConstraint(fromPointer: castedPtr!)
|
||||||
case "Slider":
|
case "Slider":
|
||||||
let castedPtr = spine_update_cast_to_slider(ptr)
|
let castedPtr = spine_update_cast_to_slider(ptr)
|
||||||
return Slider(fromPointer: castedPtr!)
|
return Slider(fromPointer: castedPtr!)
|
||||||
case "TransformConstraint":
|
case "TransformConstraint":
|
||||||
let castedPtr = spine_update_cast_to_transform_constraint(ptr)
|
let castedPtr = spine_update_cast_to_transform_constraint(ptr)
|
||||||
return TransformConstraint(fromPointer: castedPtr!)
|
return TransformConstraint(fromPointer: castedPtr!)
|
||||||
default:
|
default:
|
||||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Update")
|
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Update")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adds a value to the end of this array
|
/// Adds a value to the end of this array
|
||||||
public func add(_ value: Update?) {
|
public func add(_ value: Update?) {
|
||||||
spine_array_update_add(
|
spine_array_update_add(_ptr.assumingMemoryBound(to: spine_array_update_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_update_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_array_update_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_update_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Removes all elements from this array
|
/// Removes all elements from this array
|
||||||
|
|||||||
@ -48,15 +48,13 @@ public class Bone: PosedActive, Posed, Update {
|
|||||||
|
|
||||||
/// - Parameter parent: May be NULL.
|
/// - Parameter parent: May be NULL.
|
||||||
public convenience init(_ data: BoneData, _ parent: Bone?) {
|
public convenience init(_ data: BoneData, _ parent: Bone?) {
|
||||||
let ptr = spine_bone_create(
|
let ptr = spine_bone_create(data._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), parent?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||||
data._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), parent?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
|
||||||
self.init(fromPointer: ptr!)
|
self.init(fromPointer: ptr!)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Copy constructor. Does not copy the children bones.
|
/// Copy constructor. Does not copy the children bones.
|
||||||
public static func from(_ bone: Bone, _ parent: Bone?) -> Bone {
|
public static func from(_ bone: Bone, _ parent: Bone?) -> Bone {
|
||||||
let ptr = spine_bone_create2(
|
let ptr = spine_bone_create2(bone._ptr.assumingMemoryBound(to: spine_bone_wrapper.self), parent?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||||
bone._ptr.assumingMemoryBound(to: spine_bone_wrapper.self), parent?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
|
||||||
return Bone(fromPointer: ptr!)
|
return Bone(fromPointer: ptr!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,9 +106,7 @@ public class Bone: PosedActive, Posed, Update {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||||
spine_bone_update(
|
spine_bone_update(_ptr.assumingMemoryBound(to: spine_bone_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_bone_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
|
||||||
spine_physics(rawValue: UInt32(physics.rawValue)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func resetConstrained() {
|
public func resetConstrained() {
|
||||||
|
|||||||
@ -56,7 +56,7 @@ public class Color: NSObject {
|
|||||||
public var r: Float {
|
public var r: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_color_get_r(_ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
let result = spine_color_get_r(_ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_color_set_r(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), newValue)
|
spine_color_set_r(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), newValue)
|
||||||
@ -66,7 +66,7 @@ public class Color: NSObject {
|
|||||||
public var g: Float {
|
public var g: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_color_get_g(_ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
let result = spine_color_get_g(_ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_color_set_g(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), newValue)
|
spine_color_set_g(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), newValue)
|
||||||
@ -76,7 +76,7 @@ public class Color: NSObject {
|
|||||||
public var b: Float {
|
public var b: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_color_get_b(_ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
let result = spine_color_get_b(_ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_color_set_b(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), newValue)
|
spine_color_set_b(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), newValue)
|
||||||
@ -86,7 +86,7 @@ public class Color: NSObject {
|
|||||||
public var a: Float {
|
public var a: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_color_get_a(_ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
let result = spine_color_get_a(_ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_color_set_a(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), newValue)
|
spine_color_set_a(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), newValue)
|
||||||
@ -124,8 +124,7 @@ public class Color: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func set3(_ other: Color) -> Color {
|
public func set3(_ other: Color) -> Color {
|
||||||
let result = spine_color_set_3(
|
let result = spine_color_set_3(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), other._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_color_wrapper.self), other._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
|
||||||
return Color(fromPointer: result!)
|
return Color(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,8 +139,7 @@ public class Color: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func add3(_ other: Color) -> Color {
|
public func add3(_ other: Color) -> Color {
|
||||||
let result = spine_color_add_3(
|
let result = spine_color_add_3(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), other._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_color_wrapper.self), other._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
|
||||||
return Color(fromPointer: result!)
|
return Color(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,7 @@ public class Event: NSObject {
|
|||||||
public var intValue: Int32 {
|
public var intValue: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_get_int(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
let result = spine_event_get_int(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_set_int(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
|
spine_event_set_int(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
|
||||||
@ -78,7 +78,7 @@ public class Event: NSObject {
|
|||||||
public var floatValue: Float {
|
public var floatValue: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_get_float(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
let result = spine_event_get_float(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_set_float(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
|
spine_event_set_float(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
|
||||||
@ -88,7 +88,7 @@ public class Event: NSObject {
|
|||||||
public var stringValue: String {
|
public var stringValue: String {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_get_string(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
let result = spine_event_get_string(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_set_string(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
|
spine_event_set_string(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
|
||||||
@ -98,7 +98,7 @@ public class Event: NSObject {
|
|||||||
public var volume: Float {
|
public var volume: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_get_volume(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
let result = spine_event_get_volume(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_set_volume(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
|
spine_event_set_volume(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
|
||||||
@ -108,7 +108,7 @@ public class Event: NSObject {
|
|||||||
public var balance: Float {
|
public var balance: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_get_balance(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
let result = spine_event_get_balance(_ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_set_balance(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
|
spine_event_set_balance(_ptr.assumingMemoryBound(to: spine_event_wrapper.self), newValue)
|
||||||
|
|||||||
@ -51,18 +51,17 @@ public class Polygon: NSObject {
|
|||||||
public var vertices: ArrayFloat {
|
public var vertices: ArrayFloat {
|
||||||
get {
|
get {
|
||||||
let result = spine_polygon_get__vertices(_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
|
let result = spine_polygon_get__vertices(_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
|
||||||
return ArrayFloat(fromPointer: result!)
|
return ArrayFloat(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_polygon_set__vertices(
|
spine_polygon_set__vertices(_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var count: Int32 {
|
public var count: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_polygon_get__count(_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
|
let result = spine_polygon_get__count(_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_polygon_set__count(_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self), newValue)
|
spine_polygon_set__count(_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self), newValue)
|
||||||
|
|||||||
@ -49,14 +49,12 @@ public class Rtti: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func isExactly(_ rtti: Rtti) -> Bool {
|
public func isExactly(_ rtti: Rtti) -> Bool {
|
||||||
let result = spine_rtti_is_exactly(
|
let result = spine_rtti_is_exactly(_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self), rtti._ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self), rtti._ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public func instanceOf(_ rtti: Rtti) -> Bool {
|
public func instanceOf(_ rtti: Rtti) -> Bool {
|
||||||
let result = spine_rtti_instance_of(
|
let result = spine_rtti_instance_of(_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self), rtti._ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self), rtti._ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,8 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import SpineC
|
import SpineC
|
||||||
|
|
||||||
/// Sequence wrapper
|
/// Holds texture regions, UVs, and vertex offsets for rendering a region or mesh attachment.
|
||||||
|
/// Regions must be populated and update() called before use.
|
||||||
@objc(SpineSequence)
|
@objc(SpineSequence)
|
||||||
@objcMembers
|
@objcMembers
|
||||||
public class Sequence: NSObject {
|
public class Sequence: NSObject {
|
||||||
@ -43,26 +44,26 @@ public class Sequence: NSObject {
|
|||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
public convenience init(_ count: Int32) {
|
public convenience init(_ count: Int32, _ pathSuffix: Bool) {
|
||||||
let ptr = spine_sequence_create(count)
|
let ptr = spine_sequence_create(count, pathSuffix)
|
||||||
self.init(fromPointer: ptr!)
|
self.init(fromPointer: ptr!)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a unique ID for this attachment.
|
/// Copy constructor.
|
||||||
public var id: Int32 {
|
public static func from(_ other: Sequence) -> Sequence {
|
||||||
get {
|
let ptr = spine_sequence_create2(other._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||||
let result = spine_sequence_get_id(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
return Sequence(fromPointer: ptr!)
|
||||||
return result
|
}
|
||||||
}
|
|
||||||
set {
|
public var regions: ArrayTextureRegion {
|
||||||
spine_sequence_set_id(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), newValue)
|
let result = spine_sequence_get_regions(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||||
}
|
return ArrayTextureRegion(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
public var start: Int32 {
|
public var start: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_sequence_get_start(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
let result = spine_sequence_get_start(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_sequence_set_start(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), newValue)
|
spine_sequence_set_start(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), newValue)
|
||||||
@ -72,7 +73,7 @@ public class Sequence: NSObject {
|
|||||||
public var digits: Int32 {
|
public var digits: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_sequence_get_digits(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
let result = spine_sequence_get_digits(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_sequence_set_digits(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), newValue)
|
spine_sequence_set_digits(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), newValue)
|
||||||
@ -83,27 +84,44 @@ public class Sequence: NSObject {
|
|||||||
public var setupIndex: Int32 {
|
public var setupIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_sequence_get_setup_index(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
let result = spine_sequence_get_setup_index(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_sequence_set_setup_index(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), newValue)
|
spine_sequence_set_setup_index(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), newValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var regions: ArrayTextureRegion {
|
public var pathSuffix: Bool {
|
||||||
let result = spine_sequence_get_regions(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
let result = spine_sequence_get_path_suffix(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||||
return ArrayTextureRegion(fromPointer: result!)
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public func copyAttachment() -> Sequence {
|
/// Returns a unique ID for this attachment.
|
||||||
let result = spine_sequence_copy(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
public var id: Int32 {
|
||||||
return Sequence(fromPointer: result!)
|
let result = spine_sequence_get_id(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||||
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public func apply(_ slot: SlotPose?, _ attachment: Attachment?) {
|
public func resolveIndex(_ pose: SlotPose) -> Int32 {
|
||||||
spine_sequence_apply(
|
let result = spine_sequence_resolve_index(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), slot?._ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self),
|
return result
|
||||||
attachment?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
}
|
||||||
|
|
||||||
|
public func getRegion(_ index: Int32) -> TextureRegion? {
|
||||||
|
let result = spine_sequence_get_region(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), index)
|
||||||
|
return result.map { TextureRegion(fromPointer: $0) }
|
||||||
|
}
|
||||||
|
|
||||||
|
public func getUVs(_ index: Int32) -> ArrayFloat {
|
||||||
|
let result = spine_sequence_get_u_vs(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), index)
|
||||||
|
return ArrayFloat(fromPointer: result!)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns vertex offsets from the center of a RegionAttachment. Invalid to call for a
|
||||||
|
/// MeshAttachment.
|
||||||
|
public func getOffsets(_ index: Int32) -> ArrayFloat {
|
||||||
|
let result = spine_sequence_get_offsets(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), index)
|
||||||
|
return ArrayFloat(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func getPath(_ basePath: String, _ index: Int32) -> String {
|
public func getPath(_ basePath: String, _ index: Int32) -> String {
|
||||||
@ -111,6 +129,16 @@ public class Sequence: NSObject {
|
|||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Computes UVs and offsets for the specified attachment. Must be called if the regions or
|
||||||
|
/// attachment properties are changed.
|
||||||
|
public func update(_ attachment: RegionAttachment) {
|
||||||
|
spine_sequence_update_1(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), attachment._ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||||
|
}
|
||||||
|
|
||||||
|
public func update2(_ attachment: MeshAttachment) {
|
||||||
|
spine_sequence_update_2(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), attachment._ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||||
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
spine_sequence_dispose(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
spine_sequence_dispose(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,7 +101,7 @@ public class Skeleton: NSObject {
|
|||||||
public var scaleX: Float {
|
public var scaleX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_get_scale_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
let result = spine_skeleton_get_scale_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_set_scale_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
spine_skeleton_set_scale_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
||||||
@ -111,7 +111,7 @@ public class Skeleton: NSObject {
|
|||||||
public var scaleY: Float {
|
public var scaleY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_get_scale_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
let result = spine_skeleton_get_scale_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_set_scale_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
spine_skeleton_set_scale_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
||||||
@ -121,7 +121,7 @@ public class Skeleton: NSObject {
|
|||||||
public var x: Float {
|
public var x: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_get_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
let result = spine_skeleton_get_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_set_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
spine_skeleton_set_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
||||||
@ -131,7 +131,7 @@ public class Skeleton: NSObject {
|
|||||||
public var y: Float {
|
public var y: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_get_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
let result = spine_skeleton_get_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_set_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
spine_skeleton_set_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
||||||
@ -141,7 +141,7 @@ public class Skeleton: NSObject {
|
|||||||
public var windX: Float {
|
public var windX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_get_wind_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
let result = spine_skeleton_get_wind_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_set_wind_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
spine_skeleton_set_wind_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
||||||
@ -151,7 +151,7 @@ public class Skeleton: NSObject {
|
|||||||
public var windY: Float {
|
public var windY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_get_wind_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
let result = spine_skeleton_get_wind_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_set_wind_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
spine_skeleton_set_wind_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
||||||
@ -161,7 +161,7 @@ public class Skeleton: NSObject {
|
|||||||
public var gravityX: Float {
|
public var gravityX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_get_gravity_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
let result = spine_skeleton_get_gravity_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_set_gravity_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
spine_skeleton_set_gravity_x(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
||||||
@ -171,7 +171,7 @@ public class Skeleton: NSObject {
|
|||||||
public var gravityY: Float {
|
public var gravityY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_get_gravity_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
let result = spine_skeleton_get_gravity_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_set_gravity_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
spine_skeleton_set_gravity_y(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
||||||
@ -181,7 +181,7 @@ public class Skeleton: NSObject {
|
|||||||
public var time: Float {
|
public var time: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_get_time(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
let result = spine_skeleton_get_time(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_set_time(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
spine_skeleton_set_time(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue)
|
||||||
@ -191,8 +191,7 @@ public class Skeleton: NSObject {
|
|||||||
public var setColor: Color {
|
public var setColor: Color {
|
||||||
get { fatalError("Setter-only property") }
|
get { fatalError("Setter-only property") }
|
||||||
set(newValue) {
|
set(newValue) {
|
||||||
spine_skeleton_set_color_1(
|
spine_skeleton_set_color_1(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,13 +206,11 @@ public class Skeleton: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func constrained(_ object: Posed) {
|
public func constrained(_ object: Posed) {
|
||||||
spine_skeleton_constrained(
|
spine_skeleton_constrained(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), object._ptr.assumingMemoryBound(to: spine_posed_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), object._ptr.assumingMemoryBound(to: spine_posed_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func sortBone(_ bone: Bone?) {
|
public func sortBone(_ bone: Bone?) {
|
||||||
spine_skeleton_sort_bone(
|
spine_skeleton_sort_bone(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), bone?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), bone?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func sortReset(_ bones: ArrayBone) {
|
public static func sortReset(_ bones: ArrayBone) {
|
||||||
@ -225,8 +222,7 @@ public class Skeleton: NSObject {
|
|||||||
/// See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms)
|
/// See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms)
|
||||||
/// in the Spine Runtimes Guide.
|
/// in the Spine Runtimes Guide.
|
||||||
public func updateWorldTransform(_ physics: Physics) {
|
public func updateWorldTransform(_ physics: Physics) {
|
||||||
spine_skeleton_update_world_transform(
|
spine_skeleton_update_world_transform(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the bones, constraints, and slots to their setup pose values.
|
/// Sets the bones, constraints, and slots to their setup pose values.
|
||||||
@ -297,8 +293,7 @@ public class Skeleton: NSObject {
|
|||||||
///
|
///
|
||||||
/// - Parameter newSkin: May be NULL.
|
/// - Parameter newSkin: May be NULL.
|
||||||
public func setSkin2(_ newSkin: Skin?) {
|
public func setSkin2(_ newSkin: Skin?) {
|
||||||
spine_skeleton_set_skin_2(
|
spine_skeleton_set_skin_2(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newSkin?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newSkin?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// - Returns: May be NULL.
|
/// - Returns: May be NULL.
|
||||||
|
|||||||
@ -73,9 +73,7 @@ public class Skin: NSObject {
|
|||||||
/// Adds an attachment to the skin for the specified slot index and name. If the name already
|
/// Adds an attachment to the skin for the specified slot index and name. If the name already
|
||||||
/// exists for the slot, the previous value is replaced.
|
/// exists for the slot, the previous value is replaced.
|
||||||
public func setAttachment(_ slotIndex: Int, _ name: String, _ attachment: Attachment?) {
|
public func setAttachment(_ slotIndex: Int, _ name: String, _ attachment: Attachment?) {
|
||||||
spine_skin_set_attachment(
|
spine_skin_set_attachment(_ptr.assumingMemoryBound(to: spine_skin_wrapper.self), slotIndex, name, attachment?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_skin_wrapper.self), slotIndex, name,
|
|
||||||
attachment?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the attachment for the specified slot index and name, or NULL.
|
/// Returns the attachment for the specified slot index and name, or NULL.
|
||||||
@ -119,9 +117,7 @@ public class Skin: NSObject {
|
|||||||
/// - Parameter slotIndex: The target slotIndex. To find the slot index, use SkeletonData::findSlot and SlotData::getIndex.
|
/// - Parameter slotIndex: The target slotIndex. To find the slot index, use SkeletonData::findSlot and SlotData::getIndex.
|
||||||
/// - Parameter attachments: Found Attachments will be added to this array.
|
/// - Parameter attachments: Found Attachments will be added to this array.
|
||||||
public func findAttachmentsForSlot(_ slotIndex: Int, _ attachments: ArrayAttachment) {
|
public func findAttachmentsForSlot(_ slotIndex: Int, _ attachments: ArrayAttachment) {
|
||||||
spine_skin_find_attachments_for_slot(
|
spine_skin_find_attachments_for_slot(_ptr.assumingMemoryBound(to: spine_skin_wrapper.self), slotIndex, attachments._ptr.assumingMemoryBound(to: spine_array_attachment_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_skin_wrapper.self), slotIndex,
|
|
||||||
attachments._ptr.assumingMemoryBound(to: spine_array_attachment_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adds all attachments, bones, and constraints from the specified skin to this skin.
|
/// Adds all attachments, bones, and constraints from the specified skin to this skin.
|
||||||
|
|||||||
@ -42,25 +42,22 @@ public class Slider: SliderBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public convenience init(_ data: SliderData, _ skeleton: Skeleton) {
|
public convenience init(_ data: SliderData, _ skeleton: Skeleton) {
|
||||||
let ptr = spine_slider_create(
|
let ptr = spine_slider_create(data._ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
data._ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
self.init(fromPointer: ptr!)
|
self.init(fromPointer: ptr!)
|
||||||
}
|
}
|
||||||
|
|
||||||
public var bone: Bone {
|
public var bone: Bone {
|
||||||
get {
|
get {
|
||||||
let result = spine_slider_get_bone(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
|
let result = spine_slider_get_bone(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||||
return Bone(fromPointer: result!)
|
return Bone(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slider_set_bone(
|
spine_slider_set_bone(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func copyAttachment(_ skeleton: Skeleton) -> Slider {
|
public func copyAttachment(_ skeleton: Skeleton) -> Slider {
|
||||||
let result = spine_slider_copy(
|
let result = spine_slider_copy(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
return Slider(fromPointer: result!)
|
return Slider(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,8 +46,7 @@ public class Slot: NSObject, Posed {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public convenience init(_ data: SlotData, _ skeleton: Skeleton) {
|
public convenience init(_ data: SlotData, _ skeleton: Skeleton) {
|
||||||
let ptr = spine_slot_create(
|
let ptr = spine_slot_create(data._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
data._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
self.init(fromPointer: ptr!)
|
self.init(fromPointer: ptr!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -83,14 +83,8 @@ open class Timeline: NSObject {
|
|||||||
/// - Parameter blend: Controls how mixing is applied when alpha is than 1.
|
/// - Parameter blend: Controls how mixing is applied when alpha is than 1.
|
||||||
/// - Parameter direction: Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions such as DrawOrderTimeline and AttachmentTimeline.
|
/// - Parameter direction: Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions such as DrawOrderTimeline and AttachmentTimeline.
|
||||||
/// - Parameter appliedPose: True to modify the applied pose.
|
/// - Parameter appliedPose: True to modify the applied pose.
|
||||||
public func apply(
|
public func apply(_ skeleton: Skeleton, _ lastTime: Float, _ time: Float, _ events: ArrayEvent?, _ alpha: Float, _ blend: MixBlend, _ direction: MixDirection, _ appliedPose: Bool) {
|
||||||
_ skeleton: Skeleton, _ lastTime: Float, _ time: Float, _ events: ArrayEvent?, _ alpha: Float, _ blend: MixBlend, _ direction: MixDirection,
|
spine_timeline_apply(_ptr.assumingMemoryBound(to: spine_timeline_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), lastTime, time, events?._ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), spine_mix_direction(rawValue: UInt32(direction.rawValue)), appliedPose)
|
||||||
_ appliedPose: Bool
|
|
||||||
) {
|
|
||||||
spine_timeline_apply(
|
|
||||||
_ptr.assumingMemoryBound(to: spine_timeline_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), lastTime,
|
|
||||||
time, events?._ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)),
|
|
||||||
spine_mix_direction(rawValue: UInt32(direction.rawValue)), appliedPose)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func rttiStatic() -> Rtti {
|
public static func rttiStatic() -> Rtti {
|
||||||
|
|||||||
@ -49,7 +49,7 @@ public class AlphaTimeline: CurveTimeline1, SlotTimeline {
|
|||||||
public var slotIndex: Int32 {
|
public var slotIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_alpha_timeline_get_slot_index(_ptr.assumingMemoryBound(to: spine_alpha_timeline_wrapper.self))
|
let result = spine_alpha_timeline_get_slot_index(_ptr.assumingMemoryBound(to: spine_alpha_timeline_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_alpha_timeline_set_slot_index(_ptr.assumingMemoryBound(to: spine_alpha_timeline_wrapper.self), newValue)
|
spine_alpha_timeline_set_slot_index(_ptr.assumingMemoryBound(to: spine_alpha_timeline_wrapper.self), newValue)
|
||||||
|
|||||||
@ -79,7 +79,7 @@ public class AnimationState: NSObject {
|
|||||||
public var timeScale: Float {
|
public var timeScale: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_animation_state_get_time_scale(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self))
|
let result = spine_animation_state_get_time_scale(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_animation_state_set_time_scale(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), newValue)
|
spine_animation_state_set_time_scale(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), newValue)
|
||||||
@ -89,7 +89,7 @@ public class AnimationState: NSObject {
|
|||||||
public var manualTrackEntryDisposal: Bool {
|
public var manualTrackEntryDisposal: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_animation_state_get_manual_track_entry_disposal(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self))
|
let result = spine_animation_state_get_manual_track_entry_disposal(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_animation_state_set_manual_track_entry_disposal(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), newValue)
|
spine_animation_state_set_manual_track_entry_disposal(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), newValue)
|
||||||
@ -112,8 +112,7 @@ public class AnimationState: NSObject {
|
|||||||
///
|
///
|
||||||
/// - Returns: True if any animations were applied.
|
/// - Returns: True if any animations were applied.
|
||||||
public func apply(_ skeleton: Skeleton) -> Bool {
|
public func apply(_ skeleton: Skeleton) -> Bool {
|
||||||
let result = spine_animation_state_apply(
|
let result = spine_animation_state_apply(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,7 +142,7 @@ public class AnimationState: NSObject {
|
|||||||
/// less over the mix duration. Properties keyed in the previous animation transition to the
|
/// less over the mix duration. Properties keyed in the previous animation transition to the
|
||||||
/// value from lower tracks or to the setup pose value if no lower tracks key the property. A
|
/// value from lower tracks or to the setup pose value if no lower tracks key the property. A
|
||||||
/// mix duration of 0 still mixes out over one frame.
|
/// mix duration of 0 still mixes out over one frame.
|
||||||
///
|
///
|
||||||
/// Mixing in is done by first setting an empty animation, then adding an animation using
|
/// Mixing in is done by first setting an empty animation, then adding an animation using
|
||||||
/// addAnimation(int, Animation, bool, float) with the desired delay (an empty animation has a
|
/// addAnimation(int, Animation, bool, float) with the desired delay (an empty animation has a
|
||||||
/// duration of 0) and on the returned track entry, set the TrackEntry::setMixDuration(float).
|
/// duration of 0) and on the returned track entry, set the TrackEntry::setMixDuration(float).
|
||||||
@ -151,11 +150,10 @@ public class AnimationState: NSObject {
|
|||||||
/// mix duration. Properties keyed in the new animation transition from the value from lower
|
/// mix duration. Properties keyed in the new animation transition from the value from lower
|
||||||
/// tracks or from the setup pose value if no lower tracks key the property to the value keyed
|
/// tracks or from the setup pose value if no lower tracks key the property to the value keyed
|
||||||
/// in the new animation.
|
/// in the new animation.
|
||||||
///
|
///
|
||||||
/// See Empty animations in the Spine Runtimes Guide.
|
/// See Empty animations in the Spine Runtimes Guide.
|
||||||
public func setEmptyAnimation(_ trackIndex: Int, _ mixDuration: Float) -> TrackEntry {
|
public func setEmptyAnimation(_ trackIndex: Int, _ mixDuration: Float) -> TrackEntry {
|
||||||
let result = spine_animation_state_set_empty_animation(
|
let result = spine_animation_state_set_empty_animation(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, mixDuration)
|
||||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, mixDuration)
|
|
||||||
return TrackEntry(fromPointer: result!)
|
return TrackEntry(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,8 +167,7 @@ public class AnimationState: NSObject {
|
|||||||
///
|
///
|
||||||
/// - Returns: A track entry to allow further customization of animation playback. References to the track entry must not be kept after the AnimationStateListener::dispose(TrackEntry) event occurs.
|
/// - Returns: A track entry to allow further customization of animation playback. References to the track entry must not be kept after the AnimationStateListener::dispose(TrackEntry) event occurs.
|
||||||
public func addEmptyAnimation(_ trackIndex: Int, _ mixDuration: Float, _ delay: Float) -> TrackEntry {
|
public func addEmptyAnimation(_ trackIndex: Int, _ mixDuration: Float, _ delay: Float) -> TrackEntry {
|
||||||
let result = spine_animation_state_add_empty_animation(
|
let result = spine_animation_state_add_empty_animation(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, mixDuration, delay)
|
||||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, mixDuration, delay)
|
|
||||||
return TrackEntry(fromPointer: result!)
|
return TrackEntry(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,16 +186,14 @@ public class AnimationState: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func disposeTrackEntry(_ entry: TrackEntry?) {
|
public func disposeTrackEntry(_ entry: TrackEntry?) {
|
||||||
spine_animation_state_dispose_track_entry(
|
spine_animation_state_dispose_track_entry(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), entry?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), entry?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets an animation by name.
|
/// Sets an animation by name.
|
||||||
///
|
///
|
||||||
/// See setAnimation(int, Animation, bool).
|
/// See setAnimation(int, Animation, bool).
|
||||||
public func setAnimation(_ trackIndex: Int, _ animationName: String, _ loop: Bool) -> TrackEntry {
|
public func setAnimation(_ trackIndex: Int, _ animationName: String, _ loop: Bool) -> TrackEntry {
|
||||||
let result = spine_animation_state_set_animation_1(
|
let result = spine_animation_state_set_animation_1(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animationName, loop)
|
||||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animationName, loop)
|
|
||||||
return TrackEntry(fromPointer: result!)
|
return TrackEntry(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,9 +206,7 @@ public class AnimationState: NSObject {
|
|||||||
///
|
///
|
||||||
/// - Returns: A track entry to allow further customization of animation playback. References to the track entry must not be kept after AnimationState.Dispose.
|
/// - Returns: A track entry to allow further customization of animation playback. References to the track entry must not be kept after AnimationState.Dispose.
|
||||||
public func setAnimation2(_ trackIndex: Int, _ animation: Animation, _ loop: Bool) -> TrackEntry {
|
public func setAnimation2(_ trackIndex: Int, _ animation: Animation, _ loop: Bool) -> TrackEntry {
|
||||||
let result = spine_animation_state_set_animation_2(
|
let result = spine_animation_state_set_animation_2(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animation._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), loop)
|
||||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex,
|
|
||||||
animation._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), loop)
|
|
||||||
return TrackEntry(fromPointer: result!)
|
return TrackEntry(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,8 +214,7 @@ public class AnimationState: NSObject {
|
|||||||
///
|
///
|
||||||
/// See addAnimation(int, Animation, bool, float).
|
/// See addAnimation(int, Animation, bool, float).
|
||||||
public func addAnimation(_ trackIndex: Int, _ animationName: String, _ loop: Bool, _ delay: Float) -> TrackEntry {
|
public func addAnimation(_ trackIndex: Int, _ animationName: String, _ loop: Bool, _ delay: Float) -> TrackEntry {
|
||||||
let result = spine_animation_state_add_animation_1(
|
let result = spine_animation_state_add_animation_1(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animationName, loop, delay)
|
||||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animationName, loop, delay)
|
|
||||||
return TrackEntry(fromPointer: result!)
|
return TrackEntry(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,9 +225,7 @@ public class AnimationState: NSObject {
|
|||||||
///
|
///
|
||||||
/// - Returns: A track entry to allow further customization of animation playback. References to the track entry must not be kept after AnimationState.Dispose
|
/// - Returns: A track entry to allow further customization of animation playback. References to the track entry must not be kept after AnimationState.Dispose
|
||||||
public func addAnimation2(_ trackIndex: Int, _ animation: Animation, _ loop: Bool, _ delay: Float) -> TrackEntry {
|
public func addAnimation2(_ trackIndex: Int, _ animation: Animation, _ loop: Bool, _ delay: Float) -> TrackEntry {
|
||||||
let result = spine_animation_state_add_animation_2(
|
let result = spine_animation_state_add_animation_2(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animation._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), loop, delay)
|
||||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex,
|
|
||||||
animation._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), loop, delay)
|
|
||||||
return TrackEntry(fromPointer: result!)
|
return TrackEntry(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,7 @@ public class AnimationStateData: NSObject {
|
|||||||
public var defaultMix: Float {
|
public var defaultMix: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_animation_state_data_get_default_mix(_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self))
|
let result = spine_animation_state_data_get_default_mix(_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_animation_state_data_set_default_mix(_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self), newValue)
|
spine_animation_state_data_set_default_mix(_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self), newValue)
|
||||||
@ -69,9 +69,7 @@ public class AnimationStateData: NSObject {
|
|||||||
/// The mix duration to use when changing from the specified animation to the other, or the
|
/// The mix duration to use when changing from the specified animation to the other, or the
|
||||||
/// DefaultMix if no mix duration has been set.
|
/// DefaultMix if no mix duration has been set.
|
||||||
public func getMix(_ from: Animation, _ to: Animation) -> Float {
|
public func getMix(_ from: Animation, _ to: Animation) -> Float {
|
||||||
let result = spine_animation_state_data_get_mix(
|
let result = spine_animation_state_data_get_mix(_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self), from._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), to._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self), from._ptr.assumingMemoryBound(to: spine_animation_wrapper.self),
|
|
||||||
to._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,9 +86,7 @@ public class AnimationStateData: NSObject {
|
|||||||
/// Sets a mix duration when changing from the specified animation to the other. See
|
/// Sets a mix duration when changing from the specified animation to the other. See
|
||||||
/// TrackEntry.MixDuration.
|
/// TrackEntry.MixDuration.
|
||||||
public func setMix2(_ from: Animation, _ to: Animation, _ duration: Float) {
|
public func setMix2(_ from: Animation, _ to: Animation, _ duration: Float) {
|
||||||
spine_animation_state_data_set_mix_2(
|
spine_animation_state_data_set_mix_2(_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self), from._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), to._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), duration)
|
||||||
_ptr.assumingMemoryBound(to: spine_animation_state_data_wrapper.self), from._ptr.assumingMemoryBound(to: spine_animation_wrapper.self),
|
|
||||||
to._ptr.assumingMemoryBound(to: spine_animation_wrapper.self), duration)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -52,44 +52,32 @@ public class AtlasAttachmentLoader: NSObject, AttachmentLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func newRegionAttachment(_ skin: Skin, _ name: String, _ path: String, _ sequence: Sequence?) -> RegionAttachment? {
|
public func newRegionAttachment(_ skin: Skin, _ name: String, _ path: String, _ sequence: Sequence?) -> RegionAttachment? {
|
||||||
let result = spine_atlas_attachment_loader_new_region_attachment(
|
let result = spine_atlas_attachment_loader_new_region_attachment(_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name, path, sequence?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self),
|
|
||||||
name, path, sequence?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
|
||||||
return result.map { RegionAttachment(fromPointer: $0) }
|
return result.map { RegionAttachment(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
public func newMeshAttachment(_ skin: Skin, _ name: String, _ path: String, _ sequence: Sequence?) -> MeshAttachment? {
|
public func newMeshAttachment(_ skin: Skin, _ name: String, _ path: String, _ sequence: Sequence?) -> MeshAttachment? {
|
||||||
let result = spine_atlas_attachment_loader_new_mesh_attachment(
|
let result = spine_atlas_attachment_loader_new_mesh_attachment(_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name, path, sequence?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self),
|
|
||||||
name, path, sequence?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
|
||||||
return result.map { MeshAttachment(fromPointer: $0) }
|
return result.map { MeshAttachment(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
public func newBoundingBoxAttachment(_ skin: Skin, _ name: String) -> BoundingBoxAttachment? {
|
public func newBoundingBoxAttachment(_ skin: Skin, _ name: String) -> BoundingBoxAttachment? {
|
||||||
let result = spine_atlas_attachment_loader_new_bounding_box_attachment(
|
let result = spine_atlas_attachment_loader_new_bounding_box_attachment(_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name)
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name
|
|
||||||
)
|
|
||||||
return result.map { BoundingBoxAttachment(fromPointer: $0) }
|
return result.map { BoundingBoxAttachment(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
public func newPathAttachment(_ skin: Skin, _ name: String) -> PathAttachment? {
|
public func newPathAttachment(_ skin: Skin, _ name: String) -> PathAttachment? {
|
||||||
let result = spine_atlas_attachment_loader_new_path_attachment(
|
let result = spine_atlas_attachment_loader_new_path_attachment(_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name)
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name
|
|
||||||
)
|
|
||||||
return result.map { PathAttachment(fromPointer: $0) }
|
return result.map { PathAttachment(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
public func newPointAttachment(_ skin: Skin, _ name: String) -> PointAttachment? {
|
public func newPointAttachment(_ skin: Skin, _ name: String) -> PointAttachment? {
|
||||||
let result = spine_atlas_attachment_loader_new_point_attachment(
|
let result = spine_atlas_attachment_loader_new_point_attachment(_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name)
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name
|
|
||||||
)
|
|
||||||
return result.map { PointAttachment(fromPointer: $0) }
|
return result.map { PointAttachment(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
public func newClippingAttachment(_ skin: Skin, _ name: String) -> ClippingAttachment? {
|
public func newClippingAttachment(_ skin: Skin, _ name: String) -> ClippingAttachment? {
|
||||||
let result = spine_atlas_attachment_loader_new_clipping_attachment(
|
let result = spine_atlas_attachment_loader_new_clipping_attachment(_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name)
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_attachment_loader_wrapper.self), skin._ptr.assumingMemoryBound(to: spine_skin_wrapper.self), name
|
|
||||||
)
|
|
||||||
return result.map { ClippingAttachment(fromPointer: $0) }
|
return result.map { ClippingAttachment(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class AtlasPage: NSObject {
|
|||||||
public var name: String {
|
public var name: String {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_page_get_name(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
let result = spine_atlas_page_get_name(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_page_set_name(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
|
spine_atlas_page_set_name(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
|
||||||
@ -61,7 +61,7 @@ public class AtlasPage: NSObject {
|
|||||||
public var texturePath: String {
|
public var texturePath: String {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_page_get_texture_path(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
let result = spine_atlas_page_get_texture_path(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_page_set_texture_path(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
|
spine_atlas_page_set_texture_path(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
|
||||||
@ -71,62 +71,57 @@ public class AtlasPage: NSObject {
|
|||||||
public var format: Format {
|
public var format: Format {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_page_get_format(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
let result = spine_atlas_page_get_format(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||||
return Format(rawValue: Int32(result.rawValue))!
|
return Format(rawValue: Int32(result.rawValue))!
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_page_set_format(
|
spine_atlas_page_set_format(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_format(rawValue: UInt32(newValue.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_format(rawValue: UInt32(newValue.rawValue)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var minFilter: TextureFilter {
|
public var minFilter: TextureFilter {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_page_get_min_filter(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
let result = spine_atlas_page_get_min_filter(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||||
return TextureFilter(rawValue: Int32(result.rawValue))!
|
return TextureFilter(rawValue: Int32(result.rawValue))!
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_page_set_min_filter(
|
spine_atlas_page_set_min_filter(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_filter(rawValue: UInt32(newValue.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_filter(rawValue: UInt32(newValue.rawValue)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var magFilter: TextureFilter {
|
public var magFilter: TextureFilter {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_page_get_mag_filter(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
let result = spine_atlas_page_get_mag_filter(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||||
return TextureFilter(rawValue: Int32(result.rawValue))!
|
return TextureFilter(rawValue: Int32(result.rawValue))!
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_page_set_mag_filter(
|
spine_atlas_page_set_mag_filter(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_filter(rawValue: UInt32(newValue.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_filter(rawValue: UInt32(newValue.rawValue)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var uWrap: TextureWrap {
|
public var uWrap: TextureWrap {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_page_get_u_wrap(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
let result = spine_atlas_page_get_u_wrap(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||||
return TextureWrap(rawValue: Int32(result.rawValue))!
|
return TextureWrap(rawValue: Int32(result.rawValue))!
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_page_set_u_wrap(
|
spine_atlas_page_set_u_wrap(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_wrap(rawValue: UInt32(newValue.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_wrap(rawValue: UInt32(newValue.rawValue)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var vWrap: TextureWrap {
|
public var vWrap: TextureWrap {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_page_get_v_wrap(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
let result = spine_atlas_page_get_v_wrap(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||||
return TextureWrap(rawValue: Int32(result.rawValue))!
|
return TextureWrap(rawValue: Int32(result.rawValue))!
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_page_set_v_wrap(
|
spine_atlas_page_set_v_wrap(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_wrap(rawValue: UInt32(newValue.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_wrap(rawValue: UInt32(newValue.rawValue)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var width: Int32 {
|
public var width: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_page_get_width(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
let result = spine_atlas_page_get_width(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_page_set_width(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
|
spine_atlas_page_set_width(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
|
||||||
@ -136,7 +131,7 @@ public class AtlasPage: NSObject {
|
|||||||
public var height: Int32 {
|
public var height: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_page_get_height(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
let result = spine_atlas_page_get_height(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_page_set_height(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
|
spine_atlas_page_set_height(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
|
||||||
@ -146,7 +141,7 @@ public class AtlasPage: NSObject {
|
|||||||
public var pma: Bool {
|
public var pma: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_page_get_pma(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
let result = spine_atlas_page_get_pma(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_page_set_pma(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
|
spine_atlas_page_set_pma(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
|
||||||
@ -156,7 +151,7 @@ public class AtlasPage: NSObject {
|
|||||||
public var index: Int32 {
|
public var index: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_page_get_index(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
let result = spine_atlas_page_get_index(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_page_set_index(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
|
spine_atlas_page_set_index(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), newValue)
|
||||||
|
|||||||
@ -49,18 +49,17 @@ public class AtlasRegion: TextureRegion {
|
|||||||
public var page: AtlasPage? {
|
public var page: AtlasPage? {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_page(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_page(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return result.map { AtlasPage(fromPointer: $0) }
|
return result.map { AtlasPage(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_page(
|
spine_atlas_region_set_page(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var name: String {
|
public var name: String {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_name(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_name(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_name(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
spine_atlas_region_set_name(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
||||||
@ -70,7 +69,7 @@ public class AtlasRegion: TextureRegion {
|
|||||||
public var index: Int32 {
|
public var index: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_index(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_index(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_index(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
spine_atlas_region_set_index(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
||||||
@ -80,7 +79,7 @@ public class AtlasRegion: TextureRegion {
|
|||||||
public var x: Int32 {
|
public var x: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_x(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_x(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_x(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
spine_atlas_region_set_x(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
||||||
@ -90,7 +89,7 @@ public class AtlasRegion: TextureRegion {
|
|||||||
public var y: Int32 {
|
public var y: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_y(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_y(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_y(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
spine_atlas_region_set_y(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
||||||
@ -100,7 +99,7 @@ public class AtlasRegion: TextureRegion {
|
|||||||
public var offsetX: Float {
|
public var offsetX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_offset_x(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_offset_x(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_offset_x(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
spine_atlas_region_set_offset_x(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
||||||
@ -110,7 +109,7 @@ public class AtlasRegion: TextureRegion {
|
|||||||
public var offsetY: Float {
|
public var offsetY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_offset_y(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_offset_y(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_offset_y(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
spine_atlas_region_set_offset_y(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
||||||
@ -120,7 +119,7 @@ public class AtlasRegion: TextureRegion {
|
|||||||
public var packedWidth: Int32 {
|
public var packedWidth: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_packed_width(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_packed_width(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_packed_width(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
spine_atlas_region_set_packed_width(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
||||||
@ -130,7 +129,7 @@ public class AtlasRegion: TextureRegion {
|
|||||||
public var packedHeight: Int32 {
|
public var packedHeight: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_packed_height(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_packed_height(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_packed_height(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
spine_atlas_region_set_packed_height(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
||||||
@ -140,7 +139,7 @@ public class AtlasRegion: TextureRegion {
|
|||||||
public var originalWidth: Int32 {
|
public var originalWidth: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_original_width(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_original_width(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_original_width(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
spine_atlas_region_set_original_width(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
||||||
@ -150,7 +149,7 @@ public class AtlasRegion: TextureRegion {
|
|||||||
public var originalHeight: Int32 {
|
public var originalHeight: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_original_height(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_original_height(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_original_height(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
spine_atlas_region_set_original_height(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
||||||
@ -160,7 +159,7 @@ public class AtlasRegion: TextureRegion {
|
|||||||
public var rotate: Bool {
|
public var rotate: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_rotate(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_rotate(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_rotate(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
spine_atlas_region_set_rotate(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
||||||
@ -170,7 +169,7 @@ public class AtlasRegion: TextureRegion {
|
|||||||
public var degrees: Int32 {
|
public var degrees: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_degrees(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_degrees(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_degrees(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
spine_atlas_region_set_degrees(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue)
|
||||||
@ -180,33 +179,30 @@ public class AtlasRegion: TextureRegion {
|
|||||||
public var splits: ArrayInt {
|
public var splits: ArrayInt {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_splits(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_splits(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return ArrayInt(fromPointer: result!)
|
return ArrayInt(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_splits(
|
spine_atlas_region_set_splits(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var pads: ArrayInt {
|
public var pads: ArrayInt {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_pads(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_pads(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return ArrayInt(fromPointer: result!)
|
return ArrayInt(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_pads(
|
spine_atlas_region_set_pads(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var values: ArrayFloat {
|
public var values: ArrayFloat {
|
||||||
get {
|
get {
|
||||||
let result = spine_atlas_region_get_values(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
let result = spine_atlas_region_get_values(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||||
return ArrayFloat(fromPointer: result!)
|
return ArrayFloat(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_atlas_region_set_values(
|
spine_atlas_region_set_values(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ public class AttachmentTimeline: Timeline, SlotTimeline {
|
|||||||
public var slotIndex: Int32 {
|
public var slotIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_attachment_timeline_get_slot_index(_ptr.assumingMemoryBound(to: spine_attachment_timeline_wrapper.self))
|
let result = spine_attachment_timeline_get_slot_index(_ptr.assumingMemoryBound(to: spine_attachment_timeline_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_attachment_timeline_set_slot_index(_ptr.assumingMemoryBound(to: spine_attachment_timeline_wrapper.self), newValue)
|
spine_attachment_timeline_set_slot_index(_ptr.assumingMemoryBound(to: spine_attachment_timeline_wrapper.self), newValue)
|
||||||
|
|||||||
@ -61,7 +61,7 @@ public class BoneData: PosedData {
|
|||||||
public var length: Float {
|
public var length: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_data_get_length(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
let result = spine_bone_data_get_length(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_data_set_length(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), newValue)
|
spine_bone_data_set_length(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), newValue)
|
||||||
@ -76,7 +76,7 @@ public class BoneData: PosedData {
|
|||||||
public var icon: String {
|
public var icon: String {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_data_get_icon(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
let result = spine_bone_data_get_icon(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_data_set_icon(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), newValue)
|
spine_bone_data_set_icon(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), newValue)
|
||||||
@ -86,7 +86,7 @@ public class BoneData: PosedData {
|
|||||||
public var visible: Bool {
|
public var visible: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_data_get_visible(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
let result = spine_bone_data_get_visible(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_data_set_visible(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), newValue)
|
spine_bone_data_set_visible(_ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), newValue)
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public class BoneLocal: NSObject {
|
|||||||
public var x: Float {
|
public var x: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_local_get_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
let result = spine_bone_local_get_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_local_set_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
spine_bone_local_set_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
||||||
@ -63,7 +63,7 @@ public class BoneLocal: NSObject {
|
|||||||
public var y: Float {
|
public var y: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_local_get_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
let result = spine_bone_local_get_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_local_set_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
spine_bone_local_set_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
||||||
@ -74,7 +74,7 @@ public class BoneLocal: NSObject {
|
|||||||
public var rotation: Float {
|
public var rotation: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_local_get_rotation(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
let result = spine_bone_local_get_rotation(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_local_set_rotation(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
spine_bone_local_set_rotation(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
||||||
@ -85,7 +85,7 @@ public class BoneLocal: NSObject {
|
|||||||
public var scaleX: Float {
|
public var scaleX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_local_get_scale_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
let result = spine_bone_local_get_scale_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_local_set_scale_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
spine_bone_local_set_scale_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
||||||
@ -96,7 +96,7 @@ public class BoneLocal: NSObject {
|
|||||||
public var scaleY: Float {
|
public var scaleY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_local_get_scale_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
let result = spine_bone_local_get_scale_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_local_set_scale_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
spine_bone_local_set_scale_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
||||||
@ -107,7 +107,7 @@ public class BoneLocal: NSObject {
|
|||||||
public var shearX: Float {
|
public var shearX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_local_get_shear_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
let result = spine_bone_local_get_shear_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_local_set_shear_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
spine_bone_local_set_shear_x(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
||||||
@ -118,7 +118,7 @@ public class BoneLocal: NSObject {
|
|||||||
public var shearY: Float {
|
public var shearY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_local_get_shear_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
let result = spine_bone_local_get_shear_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_local_set_shear_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
spine_bone_local_set_shear_y(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), newValue)
|
||||||
@ -129,11 +129,10 @@ public class BoneLocal: NSObject {
|
|||||||
public var inherit: Inherit {
|
public var inherit: Inherit {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_local_get_inherit(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
let result = spine_bone_local_get_inherit(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
||||||
return Inherit(rawValue: Int32(result.rawValue))!
|
return Inherit(rawValue: Int32(result.rawValue))!
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_local_set_inherit(
|
spine_bone_local_set_inherit(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), spine_inherit(rawValue: UInt32(newValue.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), spine_inherit(rawValue: UInt32(newValue.rawValue)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,8 +144,7 @@ public class BoneLocal: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func set(_ pose: BoneLocal) {
|
public func set(_ pose: BoneLocal) {
|
||||||
spine_bone_local_set(
|
spine_bone_local_set(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func setPosition(_ x: Float, _ y: Float) {
|
public func setPosition(_ x: Float, _ y: Float) {
|
||||||
|
|||||||
@ -57,7 +57,7 @@ public class BonePose: BoneLocal, Update {
|
|||||||
public var a: Float {
|
public var a: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_pose_get_a(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
let result = spine_bone_pose_get_a(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_pose_set_a(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
|
spine_bone_pose_set_a(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
|
||||||
@ -69,7 +69,7 @@ public class BonePose: BoneLocal, Update {
|
|||||||
public var b: Float {
|
public var b: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_pose_get_b(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
let result = spine_bone_pose_get_b(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_pose_set_b(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
|
spine_bone_pose_set_b(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
|
||||||
@ -81,7 +81,7 @@ public class BonePose: BoneLocal, Update {
|
|||||||
public var c: Float {
|
public var c: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_pose_get_c(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
let result = spine_bone_pose_get_c(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_pose_set_c(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
|
spine_bone_pose_set_c(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
|
||||||
@ -93,7 +93,7 @@ public class BonePose: BoneLocal, Update {
|
|||||||
public var d: Float {
|
public var d: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_pose_get_d(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
let result = spine_bone_pose_get_d(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_pose_set_d(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
|
spine_bone_pose_set_d(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
|
||||||
@ -104,7 +104,7 @@ public class BonePose: BoneLocal, Update {
|
|||||||
public var worldX: Float {
|
public var worldX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_pose_get_world_x(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
let result = spine_bone_pose_get_world_x(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_pose_set_world_x(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
|
spine_bone_pose_set_world_x(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
|
||||||
@ -115,7 +115,7 @@ public class BonePose: BoneLocal, Update {
|
|||||||
public var worldY: Float {
|
public var worldY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_pose_get_world_y(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
let result = spine_bone_pose_get_world_y(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_pose_set_world_y(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
|
spine_bone_pose_set_world_y(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), newValue)
|
||||||
@ -148,9 +148,7 @@ public class BonePose: BoneLocal, Update {
|
|||||||
|
|
||||||
/// Called by Skeleton::updateCache() to compute the world transform, if needed.
|
/// Called by Skeleton::updateCache() to compute the world transform, if needed.
|
||||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||||
spine_bone_pose_update(
|
spine_bone_pose_update(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
|
||||||
spine_physics(rawValue: UInt32(physics.rawValue)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Computes the world transform using the parent bone's applied pose and this pose. Child bones
|
/// Computes the world transform using the parent bone's applied pose and this pose. Child bones
|
||||||
@ -158,8 +156,7 @@ public class BonePose: BoneLocal, Update {
|
|||||||
///
|
///
|
||||||
/// See World transforms in the Spine Runtimes Guide.
|
/// See World transforms in the Spine Runtimes Guide.
|
||||||
public func updateWorldTransform(_ skeleton: Skeleton) {
|
public func updateWorldTransform(_ skeleton: Skeleton) {
|
||||||
spine_bone_pose_update_world_transform(
|
spine_bone_pose_update_world_transform(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Computes the local transform values from the world transform.
|
/// Computes the local transform values from the world transform.
|
||||||
@ -167,25 +164,22 @@ public class BonePose: BoneLocal, Update {
|
|||||||
/// If the world transform is modified (by a constraint, rotateWorld(), etc) then this method
|
/// If the world transform is modified (by a constraint, rotateWorld(), etc) then this method
|
||||||
/// should be called so the local transform matches the world transform. The local transform may
|
/// should be called so the local transform matches the world transform. The local transform may
|
||||||
/// be needed by other code (eg to apply another constraint).
|
/// be needed by other code (eg to apply another constraint).
|
||||||
///
|
///
|
||||||
/// Some information is ambiguous in the world transform, such as -1,-1 scale versus 180
|
/// Some information is ambiguous in the world transform, such as -1,-1 scale versus 180
|
||||||
/// rotation. The local transform after calling this method is equivalent to the local transform
|
/// rotation. The local transform after calling this method is equivalent to the local transform
|
||||||
/// used to compute the world transform, but may not be identical.
|
/// used to compute the world transform, but may not be identical.
|
||||||
public func updateLocalTransform(_ skeleton: Skeleton) {
|
public func updateLocalTransform(_ skeleton: Skeleton) {
|
||||||
spine_bone_pose_update_local_transform(
|
spine_bone_pose_update_local_transform(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// If the world transform has been modified and the local transform no longer matches,
|
/// If the world transform has been modified and the local transform no longer matches,
|
||||||
/// updateLocalTransform() is called.
|
/// updateLocalTransform() is called.
|
||||||
public func validateLocalTransform(_ skeleton: Skeleton) {
|
public func validateLocalTransform(_ skeleton: Skeleton) {
|
||||||
spine_bone_pose_validate_local_transform(
|
spine_bone_pose_validate_local_transform(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func modifyLocal(_ skeleton: Skeleton) {
|
public func modifyLocal(_ skeleton: Skeleton) {
|
||||||
spine_bone_pose_modify_local(
|
spine_bone_pose_modify_local(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func modifyWorld(_ update: Int32) {
|
public func modifyWorld(_ update: Int32) {
|
||||||
|
|||||||
@ -44,7 +44,7 @@ open class BoneTimeline1: CurveTimeline1, BoneTimeline {
|
|||||||
public var boneIndex: Int32 {
|
public var boneIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_timeline1_get_bone_index(_ptr.assumingMemoryBound(to: spine_bone_timeline1_wrapper.self))
|
let result = spine_bone_timeline1_get_bone_index(_ptr.assumingMemoryBound(to: spine_bone_timeline1_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_timeline1_set_bone_index(_ptr.assumingMemoryBound(to: spine_bone_timeline1_wrapper.self), newValue)
|
spine_bone_timeline1_set_bone_index(_ptr.assumingMemoryBound(to: spine_bone_timeline1_wrapper.self), newValue)
|
||||||
|
|||||||
@ -44,7 +44,7 @@ open class BoneTimeline2: CurveTimeline, BoneTimeline {
|
|||||||
public var boneIndex: Int32 {
|
public var boneIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_bone_timeline2_get_bone_index(_ptr.assumingMemoryBound(to: spine_bone_timeline2_wrapper.self))
|
let result = spine_bone_timeline2_get_bone_index(_ptr.assumingMemoryBound(to: spine_bone_timeline2_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_bone_timeline2_set_bone_index(_ptr.assumingMemoryBound(to: spine_bone_timeline2_wrapper.self), newValue)
|
spine_bone_timeline2_set_bone_index(_ptr.assumingMemoryBound(to: spine_bone_timeline2_wrapper.self), newValue)
|
||||||
|
|||||||
@ -49,12 +49,10 @@ public class ClippingAttachment: VertexAttachment {
|
|||||||
public var endSlot: SlotData? {
|
public var endSlot: SlotData? {
|
||||||
get {
|
get {
|
||||||
let result = spine_clipping_attachment_get_end_slot(_ptr.assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
let result = spine_clipping_attachment_get_end_slot(_ptr.assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||||
return result.map { SlotData(fromPointer: $0) }
|
return result.map { SlotData(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_clipping_attachment_set_end_slot(
|
spine_clipping_attachment_set_end_slot(_ptr.assumingMemoryBound(to: spine_clipping_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_clipping_attachment_wrapper.self),
|
|
||||||
newValue?._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@ open class ConstraintTimeline1: CurveTimeline1, ConstraintTimeline {
|
|||||||
public var constraintIndex: Int32 {
|
public var constraintIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_constraint_timeline1_get_constraint_index(_ptr.assumingMemoryBound(to: spine_constraint_timeline1_wrapper.self))
|
let result = spine_constraint_timeline1_get_constraint_index(_ptr.assumingMemoryBound(to: spine_constraint_timeline1_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_constraint_timeline1_set_constraint_index(_ptr.assumingMemoryBound(to: spine_constraint_timeline1_wrapper.self), newValue)
|
spine_constraint_timeline1_set_constraint_index(_ptr.assumingMemoryBound(to: spine_constraint_timeline1_wrapper.self), newValue)
|
||||||
|
|||||||
@ -60,17 +60,12 @@ open class CurveTimeline: Timeline {
|
|||||||
return ArrayFloat(fromPointer: result!)
|
return ArrayFloat(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func setBezier(
|
public func setBezier(_ bezier: Int, _ frame: Int, _ value: Float, _ time1: Float, _ value1: Float, _ cx1: Float, _ cy1: Float, _ cx2: Float, _ cy2: Float, _ time2: Float, _ value2: Float) {
|
||||||
_ bezier: Int, _ frame: Int, _ value: Float, _ time1: Float, _ value1: Float, _ cx1: Float, _ cy1: Float, _ cx2: Float, _ cy2: Float,
|
spine_curve_timeline_set_bezier(_ptr.assumingMemoryBound(to: spine_curve_timeline_wrapper.self), bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2)
|
||||||
_ time2: Float, _ value2: Float
|
|
||||||
) {
|
|
||||||
spine_curve_timeline_set_bezier(
|
|
||||||
_ptr.assumingMemoryBound(to: spine_curve_timeline_wrapper.self), bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func getBezierValue(_ time: Float, _ frame: Int, _ valueOffset: Int, _ i: Int) -> Float {
|
public func getBezierValue(_ time: Float, _ frame: Int, _ valueOffset: Int, _ i: Int) -> Float {
|
||||||
let result = spine_curve_timeline_get_bezier_value(
|
let result = spine_curve_timeline_get_bezier_value(_ptr.assumingMemoryBound(to: spine_curve_timeline_wrapper.self), time, frame, valueOffset, i)
|
||||||
_ptr.assumingMemoryBound(to: spine_curve_timeline_wrapper.self), time, frame, valueOffset, i)
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -56,31 +56,22 @@ open class CurveTimeline1: CurveTimeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func getRelativeValue(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ current: Float, _ setup: Float) -> Float {
|
public func getRelativeValue(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ current: Float, _ setup: Float) -> Float {
|
||||||
let result = spine_curve_timeline1_get_relative_value(
|
let result = spine_curve_timeline1_get_relative_value(_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), current, setup)
|
||||||
_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), current,
|
|
||||||
setup)
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public func getScaleValue(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ direction: MixDirection, _ current: Float, _ setup: Float) -> Float
|
public func getScaleValue(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ direction: MixDirection, _ current: Float, _ setup: Float) -> Float {
|
||||||
{
|
let result = spine_curve_timeline1_get_scale_value(_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), spine_mix_direction(rawValue: UInt32(direction.rawValue)), current, setup)
|
||||||
let result = spine_curve_timeline1_get_scale_value(
|
|
||||||
_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)),
|
|
||||||
spine_mix_direction(rawValue: UInt32(direction.rawValue)), current, setup)
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public func getAbsoluteValue(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ current: Float, _ setup: Float) -> Float {
|
public func getAbsoluteValue(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ current: Float, _ setup: Float) -> Float {
|
||||||
let result = spine_curve_timeline1_get_absolute_value_1(
|
let result = spine_curve_timeline1_get_absolute_value_1(_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), current, setup)
|
||||||
_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), current,
|
|
||||||
setup)
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public func getAbsoluteValue2(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ current: Float, _ setup: Float, _ value: Float) -> Float {
|
public func getAbsoluteValue2(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ current: Float, _ setup: Float, _ value: Float) -> Float {
|
||||||
let result = spine_curve_timeline1_get_absolute_value_2(
|
let result = spine_curve_timeline1_get_absolute_value_2(_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), current, setup, value)
|
||||||
_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), current,
|
|
||||||
setup, value)
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,8 +42,7 @@ public class DeformTimeline: SlotCurveTimeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public convenience init(_ frameCount: Int, _ bezierCount: Int, _ slotIndex: Int32, _ attachment: VertexAttachment) {
|
public convenience init(_ frameCount: Int, _ bezierCount: Int, _ slotIndex: Int32, _ attachment: VertexAttachment) {
|
||||||
let ptr = spine_deform_timeline_create(
|
let ptr = spine_deform_timeline_create(frameCount, bezierCount, slotIndex, attachment._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||||
frameCount, bezierCount, slotIndex, attachment._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
|
||||||
self.init(fromPointer: ptr!)
|
self.init(fromPointer: ptr!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,37 +50,33 @@ public class DeformTimeline: SlotCurveTimeline {
|
|||||||
public var attachment: VertexAttachment {
|
public var attachment: VertexAttachment {
|
||||||
get {
|
get {
|
||||||
let result = spine_deform_timeline_get_attachment(_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self))
|
let result = spine_deform_timeline_get_attachment(_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self))
|
||||||
let rtti = spine_vertex_attachment_get_rtti(result!)
|
let rtti = spine_vertex_attachment_get_rtti(result!)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
case "BoundingBoxAttachment":
|
case "BoundingBoxAttachment":
|
||||||
let castedPtr = spine_vertex_attachment_cast_to_bounding_box_attachment(result!)
|
let castedPtr = spine_vertex_attachment_cast_to_bounding_box_attachment(result!)
|
||||||
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
||||||
case "ClippingAttachment":
|
case "ClippingAttachment":
|
||||||
let castedPtr = spine_vertex_attachment_cast_to_clipping_attachment(result!)
|
let castedPtr = spine_vertex_attachment_cast_to_clipping_attachment(result!)
|
||||||
return ClippingAttachment(fromPointer: castedPtr!)
|
return ClippingAttachment(fromPointer: castedPtr!)
|
||||||
case "MeshAttachment":
|
case "MeshAttachment":
|
||||||
let castedPtr = spine_vertex_attachment_cast_to_mesh_attachment(result!)
|
let castedPtr = spine_vertex_attachment_cast_to_mesh_attachment(result!)
|
||||||
return MeshAttachment(fromPointer: castedPtr!)
|
return MeshAttachment(fromPointer: castedPtr!)
|
||||||
case "PathAttachment":
|
case "PathAttachment":
|
||||||
let castedPtr = spine_vertex_attachment_cast_to_path_attachment(result!)
|
let castedPtr = spine_vertex_attachment_cast_to_path_attachment(result!)
|
||||||
return PathAttachment(fromPointer: castedPtr!)
|
return PathAttachment(fromPointer: castedPtr!)
|
||||||
default:
|
default:
|
||||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class VertexAttachment")
|
fatalError("Unknown concrete type: \(rttiClassName) for abstract class VertexAttachment")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_deform_timeline_set_attachment(
|
spine_deform_timeline_set_attachment(_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self),
|
|
||||||
newValue._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the time and vertices for the specified frame.
|
/// Sets the time and vertices for the specified frame.
|
||||||
public func setFrame(_ frameIndex: Int32, _ time: Float, _ vertices: ArrayFloat) {
|
public func setFrame(_ frameIndex: Int32, _ time: Float, _ vertices: ArrayFloat) {
|
||||||
spine_deform_timeline_set_frame(
|
spine_deform_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self), frameIndex, time, vertices._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self), frameIndex, time,
|
|
||||||
vertices._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func getCurvePercent(_ time: Float, _ frame: Int32) -> Float {
|
public func getCurvePercent(_ time: Float, _ frame: Int32) -> Float {
|
||||||
|
|||||||
@ -52,9 +52,7 @@ public class DrawOrderTimeline: Timeline {
|
|||||||
/// - Parameter time: The frame time in seconds.
|
/// - Parameter time: The frame time in seconds.
|
||||||
/// - Parameter drawOrder: For each slot in Skeleton::slots, the index of the slot in the new draw order. May be null to use setup pose draw order.
|
/// - Parameter drawOrder: For each slot in Skeleton::slots, the index of the slot in the new draw order. May be null to use setup pose draw order.
|
||||||
public func setFrame(_ frame: Int, _ time: Float, _ drawOrder: ArrayInt?) {
|
public func setFrame(_ frame: Int, _ time: Float, _ drawOrder: ArrayInt?) {
|
||||||
spine_draw_order_timeline_set_frame(
|
spine_draw_order_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_draw_order_timeline_wrapper.self), frame, time, drawOrder?._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_draw_order_timeline_wrapper.self), frame, time,
|
|
||||||
drawOrder?._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -57,7 +57,7 @@ public class EventData: NSObject {
|
|||||||
public var intValue: Int32 {
|
public var intValue: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_data_get_int(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
let result = spine_event_data_get_int(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_data_set_int(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
|
spine_event_data_set_int(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
|
||||||
@ -67,7 +67,7 @@ public class EventData: NSObject {
|
|||||||
public var floatValue: Float {
|
public var floatValue: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_data_get_float(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
let result = spine_event_data_get_float(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_data_set_float(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
|
spine_event_data_set_float(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
|
||||||
@ -77,7 +77,7 @@ public class EventData: NSObject {
|
|||||||
public var stringValue: String {
|
public var stringValue: String {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_data_get_string(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
let result = spine_event_data_get_string(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_data_set_string(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
|
spine_event_data_set_string(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
|
||||||
@ -87,7 +87,7 @@ public class EventData: NSObject {
|
|||||||
public var audioPath: String {
|
public var audioPath: String {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_data_get_audio_path(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
let result = spine_event_data_get_audio_path(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_data_set_audio_path(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
|
spine_event_data_set_audio_path(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
|
||||||
@ -97,7 +97,7 @@ public class EventData: NSObject {
|
|||||||
public var volume: Float {
|
public var volume: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_data_get_volume(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
let result = spine_event_data_get_volume(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_data_set_volume(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
|
spine_event_data_set_volume(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
|
||||||
@ -107,7 +107,7 @@ public class EventData: NSObject {
|
|||||||
public var balance: Float {
|
public var balance: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_data_get_balance(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
let result = spine_event_data_get_balance(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_data_set_balance(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
|
spine_event_data_set_balance(_ptr.assumingMemoryBound(to: spine_event_data_wrapper.self), newValue)
|
||||||
|
|||||||
@ -44,43 +44,37 @@ public class EventQueueEntry: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public convenience init(_ eventType: EventType, _ trackEntry: TrackEntry?, _ event: Event?) {
|
public convenience init(_ eventType: EventType, _ trackEntry: TrackEntry?, _ event: Event?) {
|
||||||
let ptr = spine_event_queue_entry_create(
|
let ptr = spine_event_queue_entry_create(spine_event_type(rawValue: UInt32(eventType.rawValue)), trackEntry?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), event?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||||
spine_event_type(rawValue: UInt32(eventType.rawValue)), trackEntry?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self),
|
|
||||||
event?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
|
||||||
self.init(fromPointer: ptr!)
|
self.init(fromPointer: ptr!)
|
||||||
}
|
}
|
||||||
|
|
||||||
public var type: EventType {
|
public var type: EventType {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_queue_entry_get__type(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self))
|
let result = spine_event_queue_entry_get__type(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self))
|
||||||
return EventType(rawValue: Int32(result.rawValue))!
|
return EventType(rawValue: Int32(result.rawValue))!
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_queue_entry_set__type(
|
spine_event_queue_entry_set__type(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), spine_event_type(rawValue: UInt32(newValue.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), spine_event_type(rawValue: UInt32(newValue.rawValue)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var entry: TrackEntry? {
|
public var entry: TrackEntry? {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_queue_entry_get__entry(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self))
|
let result = spine_event_queue_entry_get__entry(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self))
|
||||||
return result.map { TrackEntry(fromPointer: $0) }
|
return result.map { TrackEntry(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_queue_entry_set__entry(
|
spine_event_queue_entry_set__entry(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self),
|
|
||||||
newValue?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var event: Event? {
|
public var event: Event? {
|
||||||
get {
|
get {
|
||||||
let result = spine_event_queue_entry_get__event(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self))
|
let result = spine_event_queue_entry_get__event(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self))
|
||||||
return result.map { Event(fromPointer: $0) }
|
return result.map { Event(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_event_queue_entry_set__event(
|
spine_event_queue_entry_set__event(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -56,8 +56,7 @@ public class EventTimeline: Timeline {
|
|||||||
///
|
///
|
||||||
/// - Parameter frame: Between 0 and frameCount, inclusive.
|
/// - Parameter frame: Between 0 and frameCount, inclusive.
|
||||||
public func setFrame(_ frame: Int, _ event: Event) {
|
public func setFrame(_ frame: Int, _ event: Event) {
|
||||||
spine_event_timeline_set_frame(
|
spine_event_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_event_timeline_wrapper.self), frame, event._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_event_timeline_wrapper.self), frame, event._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -51,7 +51,7 @@ open class FromProperty: NSObject {
|
|||||||
public var offset: Float {
|
public var offset: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_from_property_get__offset(_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
|
let result = spine_from_property_get__offset(_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_from_property_set__offset(_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self), newValue)
|
spine_from_property_set__offset(_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self), newValue)
|
||||||
@ -61,12 +61,10 @@ open class FromProperty: NSObject {
|
|||||||
public var to: ArrayToProperty? {
|
public var to: ArrayToProperty? {
|
||||||
get {
|
get {
|
||||||
let result = spine_from_property_get__to(_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
|
let result = spine_from_property_get__to(_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
|
||||||
return result.map { ArrayToProperty(fromPointer: $0) }
|
return result.map { ArrayToProperty(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_from_property_set__to(
|
spine_from_property_set__to(_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_array_to_property_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self),
|
|
||||||
newValue?._ptr.assumingMemoryBound(to: spine_array_to_property_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,9 +42,7 @@ public class IkConstraint: IkConstraintBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public convenience init(_ data: IkConstraintData, _ skeleton: Skeleton) {
|
public convenience init(_ data: IkConstraintData, _ skeleton: Skeleton) {
|
||||||
let ptr = spine_ik_constraint_create(
|
let ptr = spine_ik_constraint_create(data._ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
data._ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self),
|
|
||||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
self.init(fromPointer: ptr!)
|
self.init(fromPointer: ptr!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,41 +54,30 @@ public class IkConstraint: IkConstraintBase {
|
|||||||
public var target: Bone {
|
public var target: Bone {
|
||||||
get {
|
get {
|
||||||
let result = spine_ik_constraint_get_target(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
let result = spine_ik_constraint_get_target(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||||
return Bone(fromPointer: result!)
|
return Bone(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_ik_constraint_set_target(
|
spine_ik_constraint_set_target(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func copyAttachment(_ skeleton: Skeleton) -> IkConstraint {
|
public func copyAttachment(_ skeleton: Skeleton) -> IkConstraint {
|
||||||
let result = spine_ik_constraint_copy(
|
let result = spine_ik_constraint_copy(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
return IkConstraint(fromPointer: result!)
|
return IkConstraint(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adjusts the bone rotation so the tip is as close to the target position as possible. The
|
/// Adjusts the bone rotation so the tip is as close to the target position as possible. The
|
||||||
/// target is specified in the world coordinate system.
|
/// target is specified in the world coordinate system.
|
||||||
public static func apply(
|
public static func apply(_ skeleton: Skeleton, _ bone: BonePose, _ targetX: Float, _ targetY: Float, _ compress: Bool, _ stretch: Bool, _ uniform: Bool, _ mix: Float) {
|
||||||
_ skeleton: Skeleton, _ bone: BonePose, _ targetX: Float, _ targetY: Float, _ compress: Bool, _ stretch: Bool, _ uniform: Bool, _ mix: Float
|
spine_ik_constraint_apply_1(skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), bone._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), targetX, targetY, compress, stretch, uniform, mix)
|
||||||
) {
|
|
||||||
spine_ik_constraint_apply_1(
|
|
||||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), bone._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self),
|
|
||||||
targetX, targetY, compress, stretch, uniform, mix)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Adjusts the parent and child bone rotations so the tip of the child is as close to the
|
/// Adjusts the parent and child bone rotations so the tip of the child is as close to the
|
||||||
/// target position as possible. The target is specified in the world coordinate system.
|
/// target position as possible. The target is specified in the world coordinate system.
|
||||||
///
|
///
|
||||||
/// - Parameter child: A direct descendant of the parent bone.
|
/// - Parameter child: A direct descendant of the parent bone.
|
||||||
public static func apply2(
|
public static func apply2(_ skeleton: Skeleton, _ parent: BonePose, _ child: BonePose, _ targetX: Float, _ targetY: Float, _ bendDirection: Int32, _ stretch: Bool, _ uniform: Bool, _ softness: Float, _ mix: Float) {
|
||||||
_ skeleton: Skeleton, _ parent: BonePose, _ child: BonePose, _ targetX: Float, _ targetY: Float, _ bendDirection: Int32, _ stretch: Bool,
|
spine_ik_constraint_apply_2(skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), parent._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), child._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), targetX, targetY, bendDirection, stretch, uniform, softness, mix)
|
||||||
_ uniform: Bool, _ softness: Float, _ mix: Float
|
|
||||||
) {
|
|
||||||
spine_ik_constraint_apply_2(
|
|
||||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), parent._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self),
|
|
||||||
child._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), targetX, targetY, bendDirection, stretch, uniform, softness, mix)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func dispose() {
|
public override func dispose() {
|
||||||
|
|||||||
@ -80,15 +80,12 @@ open class IkConstraintBase: PosedActive, Posed, Constraint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func sort(_ skeleton: Skeleton) {
|
public func sort(_ skeleton: Skeleton) {
|
||||||
spine_ik_constraint_base_sort(
|
spine_ik_constraint_base_sort(_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inherited from Update
|
/// Inherited from Update
|
||||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||||
spine_ik_constraint_base_update(
|
spine_ik_constraint_base_update(_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
|
||||||
spine_physics(rawValue: UInt32(physics.rawValue)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func rttiStatic() -> Rtti {
|
public static func rttiStatic() -> Rtti {
|
||||||
|
|||||||
@ -61,12 +61,10 @@ public class IkConstraintData: PosedData, ConstraintData {
|
|||||||
public var target: BoneData {
|
public var target: BoneData {
|
||||||
get {
|
get {
|
||||||
let result = spine_ik_constraint_data_get_target(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self))
|
let result = spine_ik_constraint_data_get_target(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self))
|
||||||
return BoneData(fromPointer: result!)
|
return BoneData(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_ik_constraint_data_set_target(
|
spine_ik_constraint_data_set_target(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self),
|
|
||||||
newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +73,7 @@ public class IkConstraintData: PosedData, ConstraintData {
|
|||||||
public var uniform: Bool {
|
public var uniform: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_ik_constraint_data_get_uniform(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self))
|
let result = spine_ik_constraint_data_get_uniform(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_ik_constraint_data_set_uniform(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), newValue)
|
spine_ik_constraint_data_set_uniform(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), newValue)
|
||||||
@ -88,8 +86,7 @@ public class IkConstraintData: PosedData, ConstraintData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||||
let result = spine_ik_constraint_data_create_method(
|
let result = spine_ik_constraint_data_create_method(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
let rtti = spine_constraint_get_rtti(result!)
|
let rtti = spine_constraint_get_rtti(result!)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
|
|||||||
@ -55,7 +55,7 @@ public class IkConstraintPose: NSObject {
|
|||||||
public var mix: Float {
|
public var mix: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_ik_constraint_pose_get_mix(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
let result = spine_ik_constraint_pose_get_mix(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_ik_constraint_pose_set_mix(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
|
spine_ik_constraint_pose_set_mix(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
|
||||||
@ -68,7 +68,7 @@ public class IkConstraintPose: NSObject {
|
|||||||
public var softness: Float {
|
public var softness: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_ik_constraint_pose_get_softness(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
let result = spine_ik_constraint_pose_get_softness(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_ik_constraint_pose_set_softness(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
|
spine_ik_constraint_pose_set_softness(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
|
||||||
@ -79,7 +79,7 @@ public class IkConstraintPose: NSObject {
|
|||||||
public var bendDirection: Int32 {
|
public var bendDirection: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_ik_constraint_pose_get_bend_direction(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
let result = spine_ik_constraint_pose_get_bend_direction(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_ik_constraint_pose_set_bend_direction(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
|
spine_ik_constraint_pose_set_bend_direction(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
|
||||||
@ -90,7 +90,7 @@ public class IkConstraintPose: NSObject {
|
|||||||
public var compress: Bool {
|
public var compress: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_ik_constraint_pose_get_compress(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
let result = spine_ik_constraint_pose_get_compress(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_ik_constraint_pose_set_compress(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
|
spine_ik_constraint_pose_set_compress(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
|
||||||
@ -105,7 +105,7 @@ public class IkConstraintPose: NSObject {
|
|||||||
public var stretch: Bool {
|
public var stretch: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_ik_constraint_pose_get_stretch(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
let result = spine_ik_constraint_pose_get_stretch(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_ik_constraint_pose_set_stretch(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
|
spine_ik_constraint_pose_set_stretch(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), newValue)
|
||||||
@ -113,9 +113,7 @@ public class IkConstraintPose: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func set(_ pose: IkConstraintPose) {
|
public func set(_ pose: IkConstraintPose) {
|
||||||
spine_ik_constraint_pose_set(
|
spine_ik_constraint_pose_set(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self),
|
|
||||||
pose._ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class IkConstraintTimeline: CurveTimeline, ConstraintTimeline {
|
|||||||
public var constraintIndex: Int32 {
|
public var constraintIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_ik_constraint_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self))
|
let result = spine_ik_constraint_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_ik_constraint_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self), newValue)
|
spine_ik_constraint_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self), newValue)
|
||||||
@ -64,8 +64,7 @@ public class IkConstraintTimeline: CurveTimeline, ConstraintTimeline {
|
|||||||
/// - Parameter time: The frame time in seconds.
|
/// - Parameter time: The frame time in seconds.
|
||||||
/// - Parameter bendDirection: 1 or -1.
|
/// - Parameter bendDirection: 1 or -1.
|
||||||
public func setFrame(_ frame: Int32, _ time: Float, _ mix: Float, _ softness: Float, _ bendDirection: Int32, _ compress: Bool, _ stretch: Bool) {
|
public func setFrame(_ frame: Int32, _ time: Float, _ mix: Float, _ softness: Float, _ bendDirection: Int32, _ compress: Bool, _ stretch: Bool) {
|
||||||
spine_ik_constraint_timeline_set_frame(
|
spine_ik_constraint_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self), frame, time, mix, softness, bendDirection, compress, stretch)
|
||||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self), frame, time, mix, softness, bendDirection, compress, stretch)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -49,7 +49,7 @@ public class InheritTimeline: Timeline, BoneTimeline {
|
|||||||
public var boneIndex: Int32 {
|
public var boneIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_inherit_timeline_get_bone_index(_ptr.assumingMemoryBound(to: spine_inherit_timeline_wrapper.self))
|
let result = spine_inherit_timeline_get_bone_index(_ptr.assumingMemoryBound(to: spine_inherit_timeline_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_inherit_timeline_set_bone_index(_ptr.assumingMemoryBound(to: spine_inherit_timeline_wrapper.self), newValue)
|
spine_inherit_timeline_set_bone_index(_ptr.assumingMemoryBound(to: spine_inherit_timeline_wrapper.self), newValue)
|
||||||
@ -61,8 +61,7 @@ public class InheritTimeline: Timeline, BoneTimeline {
|
|||||||
/// - Parameter frame: Between 0 and frameCount, inclusive.
|
/// - Parameter frame: Between 0 and frameCount, inclusive.
|
||||||
/// - Parameter time: The frame time in seconds.
|
/// - Parameter time: The frame time in seconds.
|
||||||
public func setFrame(_ frame: Int32, _ time: Float, _ inherit: Inherit) {
|
public func setFrame(_ frame: Int32, _ time: Float, _ inherit: Inherit) {
|
||||||
spine_inherit_timeline_set_frame(
|
spine_inherit_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_inherit_timeline_wrapper.self), frame, time, spine_inherit(rawValue: UInt32(inherit.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_inherit_timeline_wrapper.self), frame, time, spine_inherit(rawValue: UInt32(inherit.rawValue)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -41,49 +41,53 @@ public class MeshAttachment: VertexAttachment {
|
|||||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||||
}
|
}
|
||||||
|
|
||||||
public convenience init(_ name: String) {
|
public convenience init(_ name: String, _ sequence: Sequence?) {
|
||||||
let ptr = spine_mesh_attachment_create(name)
|
let ptr = spine_mesh_attachment_create(name, sequence?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||||
self.init(fromPointer: ptr!)
|
self.init(fromPointer: ptr!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public var regionUVs: ArrayFloat {
|
||||||
|
get {
|
||||||
|
let result = spine_mesh_attachment_get_region_u_vs(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||||
|
return ArrayFloat(fromPointer: result!)
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
spine_mesh_attachment_set_region_u_vs(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public var triangles: ArrayUnsignedShort {
|
||||||
|
get {
|
||||||
|
let result = spine_mesh_attachment_get_triangles(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||||
|
return ArrayUnsignedShort(fromPointer: result!)
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
spine_mesh_attachment_set_triangles(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_unsigned_short_wrapper.self))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public var hullLength: Int32 {
|
public var hullLength: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_mesh_attachment_get_hull_length(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
let result = spine_mesh_attachment_get_hull_length(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_mesh_attachment_set_hull_length(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue)
|
spine_mesh_attachment_set_hull_length(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var regionUVs: ArrayFloat {
|
public var sequence: Sequence {
|
||||||
get {
|
let result = spine_mesh_attachment_get_sequence(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||||
let result = spine_mesh_attachment_get_region_u_vs(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
return Sequence(fromPointer: result!)
|
||||||
return ArrayFloat(fromPointer: result!)
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
spine_mesh_attachment_set_region_u_vs(
|
|
||||||
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
|
|
||||||
newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The UV pair for each vertex, normalized within the entire texture. See also
|
public var path: String {
|
||||||
/// MeshAttachment::updateRegion
|
|
||||||
public var uVs: ArrayFloat {
|
|
||||||
let result = spine_mesh_attachment_get_u_vs(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
|
||||||
return ArrayFloat(fromPointer: result!)
|
|
||||||
}
|
|
||||||
|
|
||||||
public var triangles: ArrayUnsignedShort {
|
|
||||||
get {
|
get {
|
||||||
let result = spine_mesh_attachment_get_triangles(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
let result = spine_mesh_attachment_get_path(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||||
return ArrayUnsignedShort(fromPointer: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_mesh_attachment_set_triangles(
|
spine_mesh_attachment_set_path(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue)
|
||||||
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
|
|
||||||
newValue._ptr.assumingMemoryBound(to: spine_array_unsigned_short_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,68 +96,30 @@ public class MeshAttachment: VertexAttachment {
|
|||||||
return Color(fromPointer: result!)
|
return Color(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
public var path: String {
|
|
||||||
get {
|
|
||||||
let result = spine_mesh_attachment_get_path(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
|
||||||
return String(cString: result!)
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
spine_mesh_attachment_set_path(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public var region: TextureRegion? {
|
|
||||||
get {
|
|
||||||
let result = spine_mesh_attachment_get_region(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
|
||||||
return result.map { TextureRegion(fromPointer: $0) }
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
spine_mesh_attachment_set_region(
|
|
||||||
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
|
|
||||||
newValue?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public var sequence: Sequence? {
|
|
||||||
get {
|
|
||||||
let result = spine_mesh_attachment_get_sequence(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
|
||||||
return result.map { Sequence(fromPointer: $0) }
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
spine_mesh_attachment_set_sequence(
|
|
||||||
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public var parentMesh: MeshAttachment? {
|
public var parentMesh: MeshAttachment? {
|
||||||
get {
|
get {
|
||||||
let result = spine_mesh_attachment_get_parent_mesh(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
let result = spine_mesh_attachment_get_parent_mesh(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||||
return result.map { MeshAttachment(fromPointer: $0) }
|
return result.map { MeshAttachment(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_mesh_attachment_set_parent_mesh(
|
spine_mesh_attachment_set_parent_mesh(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
|
|
||||||
newValue?._ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Nonessential.
|
|
||||||
public var edges: ArrayUnsignedShort {
|
public var edges: ArrayUnsignedShort {
|
||||||
get {
|
get {
|
||||||
let result = spine_mesh_attachment_get_edges(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
let result = spine_mesh_attachment_get_edges(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||||
return ArrayUnsignedShort(fromPointer: result!)
|
return ArrayUnsignedShort(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_mesh_attachment_set_edges(
|
spine_mesh_attachment_set_edges(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_unsigned_short_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
|
|
||||||
newValue._ptr.assumingMemoryBound(to: spine_array_unsigned_short_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var width: Float {
|
public var width: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_mesh_attachment_get_width(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
let result = spine_mesh_attachment_get_width(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_mesh_attachment_set_width(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue)
|
spine_mesh_attachment_set_width(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue)
|
||||||
@ -163,15 +129,15 @@ public class MeshAttachment: VertexAttachment {
|
|||||||
public var height: Float {
|
public var height: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_mesh_attachment_get_height(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
let result = spine_mesh_attachment_get_height(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_mesh_attachment_set_height(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue)
|
spine_mesh_attachment_set_height(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func updateRegion() {
|
public func updateSequence() {
|
||||||
spine_mesh_attachment_update_region(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
spine_mesh_attachment_update_sequence(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||||
}
|
}
|
||||||
|
|
||||||
public func newLinkedMesh() -> MeshAttachment {
|
public func newLinkedMesh() -> MeshAttachment {
|
||||||
@ -179,6 +145,13 @@ public class MeshAttachment: VertexAttachment {
|
|||||||
return MeshAttachment(fromPointer: result!)
|
return MeshAttachment(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Computes UVs for a mesh attachment.
|
||||||
|
///
|
||||||
|
/// - Parameter uvs: Output array for the computed UVs, same length as regionUVs.
|
||||||
|
public static func computeUVs(_ region: TextureRegion?, _ regionUVs: ArrayFloat, _ uvs: ArrayFloat) {
|
||||||
|
spine_mesh_attachment_compute_u_vs(region?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), regionUVs._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self), uvs._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||||
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
spine_mesh_attachment_dispose(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
spine_mesh_attachment_dispose(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,19 +50,17 @@ public class PathAttachment: VertexAttachment {
|
|||||||
public var lengths: ArrayFloat {
|
public var lengths: ArrayFloat {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_attachment_get_lengths(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
let result = spine_path_attachment_get_lengths(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||||
return ArrayFloat(fromPointer: result!)
|
return ArrayFloat(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_attachment_set_lengths(
|
spine_path_attachment_set_lengths(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self),
|
|
||||||
newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var closed: Bool {
|
public var closed: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_attachment_get_closed(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
let result = spine_path_attachment_get_closed(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_attachment_set_closed(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self), newValue)
|
spine_path_attachment_set_closed(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self), newValue)
|
||||||
@ -72,7 +70,7 @@ public class PathAttachment: VertexAttachment {
|
|||||||
public var constantSpeed: Bool {
|
public var constantSpeed: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_attachment_get_constant_speed(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
let result = spine_path_attachment_get_constant_speed(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_attachment_set_constant_speed(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self), newValue)
|
spine_path_attachment_set_constant_speed(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self), newValue)
|
||||||
|
|||||||
@ -42,9 +42,7 @@ public class PathConstraint: PathConstraintBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public convenience init(_ data: PathConstraintData, _ skeleton: Skeleton) {
|
public convenience init(_ data: PathConstraintData, _ skeleton: Skeleton) {
|
||||||
let ptr = spine_path_constraint_create(
|
let ptr = spine_path_constraint_create(data._ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
data._ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self),
|
|
||||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
self.init(fromPointer: ptr!)
|
self.init(fromPointer: ptr!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,17 +56,15 @@ public class PathConstraint: PathConstraintBase {
|
|||||||
public var slot: Slot {
|
public var slot: Slot {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_constraint_get_slot(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
let result = spine_path_constraint_get_slot(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||||
return Slot(fromPointer: result!)
|
return Slot(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_constraint_set_slot(
|
spine_path_constraint_set_slot(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func copyAttachment(_ skeleton: Skeleton) -> PathConstraint {
|
public func copyAttachment(_ skeleton: Skeleton) -> PathConstraint {
|
||||||
let result = spine_path_constraint_copy(
|
let result = spine_path_constraint_copy(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
return PathConstraint(fromPointer: result!)
|
return PathConstraint(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -84,15 +84,12 @@ open class PathConstraintBase: PosedActive, Posed, Constraint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func sort(_ skeleton: Skeleton) {
|
public func sort(_ skeleton: Skeleton) {
|
||||||
spine_path_constraint_base_sort(
|
spine_path_constraint_base_sort(_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inherited from Update
|
/// Inherited from Update
|
||||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||||
spine_path_constraint_base_update(
|
spine_path_constraint_base_update(_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
|
||||||
spine_physics(rawValue: UInt32(physics.rawValue)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func rttiStatic() -> Rtti {
|
public static func rttiStatic() -> Rtti {
|
||||||
|
|||||||
@ -64,12 +64,10 @@ public class PathConstraintData: PosedData, ConstraintData {
|
|||||||
public var slot: SlotData {
|
public var slot: SlotData {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_constraint_data_get_slot(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
|
let result = spine_path_constraint_data_get_slot(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
|
||||||
return SlotData(fromPointer: result!)
|
return SlotData(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_constraint_data_set_slot(
|
spine_path_constraint_data_set_slot(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self),
|
|
||||||
newValue._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,11 +75,10 @@ public class PathConstraintData: PosedData, ConstraintData {
|
|||||||
public var positionMode: PositionMode {
|
public var positionMode: PositionMode {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_constraint_data_get_position_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
|
let result = spine_path_constraint_data_get_position_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
|
||||||
return PositionMode(rawValue: Int32(result.rawValue))!
|
return PositionMode(rawValue: Int32(result.rawValue))!
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_constraint_data_set_position_mode(
|
spine_path_constraint_data_set_position_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_position_mode(rawValue: UInt32(newValue.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_position_mode(rawValue: UInt32(newValue.rawValue)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,11 +86,10 @@ public class PathConstraintData: PosedData, ConstraintData {
|
|||||||
public var spacingMode: SpacingMode {
|
public var spacingMode: SpacingMode {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_constraint_data_get_spacing_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
|
let result = spine_path_constraint_data_get_spacing_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
|
||||||
return SpacingMode(rawValue: Int32(result.rawValue))!
|
return SpacingMode(rawValue: Int32(result.rawValue))!
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_constraint_data_set_spacing_mode(
|
spine_path_constraint_data_set_spacing_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_spacing_mode(rawValue: UInt32(newValue.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_spacing_mode(rawValue: UInt32(newValue.rawValue)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,11 +97,10 @@ public class PathConstraintData: PosedData, ConstraintData {
|
|||||||
public var rotateMode: RotateMode {
|
public var rotateMode: RotateMode {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_constraint_data_get_rotate_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
|
let result = spine_path_constraint_data_get_rotate_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
|
||||||
return RotateMode(rawValue: Int32(result.rawValue))!
|
return RotateMode(rawValue: Int32(result.rawValue))!
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_constraint_data_set_rotate_mode(
|
spine_path_constraint_data_set_rotate_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_rotate_mode(rawValue: UInt32(newValue.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_rotate_mode(rawValue: UInt32(newValue.rawValue)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +108,7 @@ public class PathConstraintData: PosedData, ConstraintData {
|
|||||||
public var offsetRotation: Float {
|
public var offsetRotation: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_constraint_data_get_offset_rotation(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
|
let result = spine_path_constraint_data_get_offset_rotation(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_constraint_data_set_offset_rotation(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), newValue)
|
spine_path_constraint_data_set_offset_rotation(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), newValue)
|
||||||
@ -126,8 +121,7 @@ public class PathConstraintData: PosedData, ConstraintData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||||
let result = spine_path_constraint_data_create_method(
|
let result = spine_path_constraint_data_create_method(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
let rtti = spine_constraint_get_rtti(result!)
|
let rtti = spine_constraint_get_rtti(result!)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
|
|||||||
@ -49,13 +49,11 @@ public class PathConstraintMixTimeline: CurveTimeline, ConstraintTimeline {
|
|||||||
|
|
||||||
public var constraintIndex: Int32 {
|
public var constraintIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_constraint_mix_timeline_get_constraint_index(
|
let result = spine_path_constraint_mix_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self))
|
return result
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_constraint_mix_timeline_set_constraint_index(
|
spine_path_constraint_mix_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self), newValue)
|
||||||
_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self), newValue)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,8 +62,7 @@ public class PathConstraintMixTimeline: CurveTimeline, ConstraintTimeline {
|
|||||||
/// - Parameter frame: Between 0 and frameCount, inclusive.
|
/// - Parameter frame: Between 0 and frameCount, inclusive.
|
||||||
/// - Parameter time: The frame time in seconds.
|
/// - Parameter time: The frame time in seconds.
|
||||||
public func setFrame(_ frame: Int32, _ time: Float, _ mixRotate: Float, _ mixX: Float, _ mixY: Float) {
|
public func setFrame(_ frame: Int32, _ time: Float, _ mixRotate: Float, _ mixX: Float, _ mixY: Float) {
|
||||||
spine_path_constraint_mix_timeline_set_frame(
|
spine_path_constraint_mix_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self), frame, time, mixRotate, mixX, mixY)
|
||||||
_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self), frame, time, mixRotate, mixX, mixY)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public class PathConstraintPose: NSObject {
|
|||||||
public var position: Float {
|
public var position: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_constraint_pose_get_position(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
let result = spine_path_constraint_pose_get_position(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_constraint_pose_set_position(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
|
spine_path_constraint_pose_set_position(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
|
||||||
@ -63,7 +63,7 @@ public class PathConstraintPose: NSObject {
|
|||||||
public var spacing: Float {
|
public var spacing: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_constraint_pose_get_spacing(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
let result = spine_path_constraint_pose_get_spacing(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_constraint_pose_set_spacing(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
|
spine_path_constraint_pose_set_spacing(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
|
||||||
@ -74,7 +74,7 @@ public class PathConstraintPose: NSObject {
|
|||||||
public var mixRotate: Float {
|
public var mixRotate: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_constraint_pose_get_mix_rotate(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
let result = spine_path_constraint_pose_get_mix_rotate(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_constraint_pose_set_mix_rotate(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
|
spine_path_constraint_pose_set_mix_rotate(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
|
||||||
@ -86,7 +86,7 @@ public class PathConstraintPose: NSObject {
|
|||||||
public var mixX: Float {
|
public var mixX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_constraint_pose_get_mix_x(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
let result = spine_path_constraint_pose_get_mix_x(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_constraint_pose_set_mix_x(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
|
spine_path_constraint_pose_set_mix_x(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
|
||||||
@ -98,7 +98,7 @@ public class PathConstraintPose: NSObject {
|
|||||||
public var mixY: Float {
|
public var mixY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_path_constraint_pose_get_mix_y(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
let result = spine_path_constraint_pose_get_mix_y(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_path_constraint_pose_set_mix_y(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
|
spine_path_constraint_pose_set_mix_y(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), newValue)
|
||||||
@ -106,9 +106,7 @@ public class PathConstraintPose: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func set(_ pose: PathConstraintPose) {
|
public func set(_ pose: PathConstraintPose) {
|
||||||
spine_path_constraint_pose_set(
|
spine_path_constraint_pose_set(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self),
|
|
||||||
pose._ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -42,9 +42,7 @@ public class PhysicsConstraint: PhysicsConstraintBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public convenience init(_ data: PhysicsConstraintData, _ skeleton: Skeleton) {
|
public convenience init(_ data: PhysicsConstraintData, _ skeleton: Skeleton) {
|
||||||
let ptr = spine_physics_constraint_create(
|
let ptr = spine_physics_constraint_create(data._ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
data._ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self),
|
|
||||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
self.init(fromPointer: ptr!)
|
self.init(fromPointer: ptr!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,24 +50,20 @@ public class PhysicsConstraint: PhysicsConstraintBase {
|
|||||||
public var bone: BonePose {
|
public var bone: BonePose {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_get_bone(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
let result = spine_physics_constraint_get_bone(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||||
return BonePose(fromPointer: result!)
|
return BonePose(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_set_bone(
|
spine_physics_constraint_set_bone(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self),
|
|
||||||
newValue._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func copyAttachment(_ skeleton: Skeleton) -> PhysicsConstraint {
|
public func copyAttachment(_ skeleton: Skeleton) -> PhysicsConstraint {
|
||||||
let result = spine_physics_constraint_copy(
|
let result = spine_physics_constraint_copy(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
return PhysicsConstraint(fromPointer: result!)
|
return PhysicsConstraint(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func reset(_ skeleton: Skeleton) {
|
public func reset(_ skeleton: Skeleton) {
|
||||||
spine_physics_constraint_reset(
|
spine_physics_constraint_reset(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Translates the physics constraint so next update() forces are applied as if the bone moved
|
/// Translates the physics constraint so next update() forces are applied as if the bone moved
|
||||||
|
|||||||
@ -83,16 +83,12 @@ open class PhysicsConstraintBase: PosedActive, Posed, Constraint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func sort(_ skeleton: Skeleton) {
|
public func sort(_ skeleton: Skeleton) {
|
||||||
spine_physics_constraint_base_sort(
|
spine_physics_constraint_base_sort(_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self),
|
|
||||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inherited from Update
|
/// Inherited from Update
|
||||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||||
spine_physics_constraint_base_update(
|
spine_physics_constraint_base_update(_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self),
|
|
||||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func rttiStatic() -> Rtti {
|
public static func rttiStatic() -> Rtti {
|
||||||
|
|||||||
@ -58,19 +58,17 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var bone: BoneData {
|
public var bone: BoneData {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_bone(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_bone(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return BoneData(fromPointer: result!)
|
return BoneData(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_bone(
|
spine_physics_constraint_data_set_bone(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self),
|
|
||||||
newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var step: Float {
|
public var step: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_step(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_step(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_step(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_step(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -80,7 +78,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var x: Float {
|
public var x: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -90,7 +88,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var y: Float {
|
public var y: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_y(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_y(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_y(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_y(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -100,7 +98,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var rotate: Float {
|
public var rotate: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_rotate(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_rotate(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_rotate(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_rotate(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -110,7 +108,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var scaleX: Float {
|
public var scaleX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_scale_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_scale_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_scale_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_scale_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -120,7 +118,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var shearX: Float {
|
public var shearX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_shear_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_shear_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_shear_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_shear_x(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -130,7 +128,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var limit: Float {
|
public var limit: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_limit(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_limit(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_limit(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_limit(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -140,7 +138,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var inertiaGlobal: Bool {
|
public var inertiaGlobal: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_inertia_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_inertia_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_inertia_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_inertia_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -150,7 +148,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var strengthGlobal: Bool {
|
public var strengthGlobal: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_strength_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_strength_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_strength_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_strength_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -160,7 +158,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var dampingGlobal: Bool {
|
public var dampingGlobal: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_damping_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_damping_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_damping_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_damping_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -170,7 +168,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var massGlobal: Bool {
|
public var massGlobal: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_mass_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_mass_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_mass_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_mass_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -180,7 +178,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var windGlobal: Bool {
|
public var windGlobal: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_wind_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_wind_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_wind_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_wind_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -190,7 +188,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var gravityGlobal: Bool {
|
public var gravityGlobal: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_gravity_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_gravity_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_gravity_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_gravity_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -200,7 +198,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
public var mixGlobal: Bool {
|
public var mixGlobal: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_data_get_mix_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
let result = spine_physics_constraint_data_get_mix_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_data_set_mix_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
spine_physics_constraint_data_set_mix_global(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue)
|
||||||
@ -213,9 +211,7 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||||
let result = spine_physics_constraint_data_create_method(
|
let result = spine_physics_constraint_data_create_method(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self),
|
|
||||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
let rtti = spine_constraint_get_rtti(result!)
|
let rtti = spine_constraint_get_rtti(result!)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class PhysicsConstraintPose: NSObject {
|
|||||||
public var inertia: Float {
|
public var inertia: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_pose_get_inertia(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
let result = spine_physics_constraint_pose_get_inertia(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_pose_set_inertia(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
spine_physics_constraint_pose_set_inertia(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
||||||
@ -61,7 +61,7 @@ public class PhysicsConstraintPose: NSObject {
|
|||||||
public var strength: Float {
|
public var strength: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_pose_get_strength(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
let result = spine_physics_constraint_pose_get_strength(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_pose_set_strength(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
spine_physics_constraint_pose_set_strength(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
||||||
@ -71,7 +71,7 @@ public class PhysicsConstraintPose: NSObject {
|
|||||||
public var damping: Float {
|
public var damping: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_pose_get_damping(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
let result = spine_physics_constraint_pose_get_damping(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_pose_set_damping(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
spine_physics_constraint_pose_set_damping(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
||||||
@ -81,7 +81,7 @@ public class PhysicsConstraintPose: NSObject {
|
|||||||
public var massInverse: Float {
|
public var massInverse: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_pose_get_mass_inverse(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
let result = spine_physics_constraint_pose_get_mass_inverse(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_pose_set_mass_inverse(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
spine_physics_constraint_pose_set_mass_inverse(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
||||||
@ -91,7 +91,7 @@ public class PhysicsConstraintPose: NSObject {
|
|||||||
public var wind: Float {
|
public var wind: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_pose_get_wind(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
let result = spine_physics_constraint_pose_get_wind(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_pose_set_wind(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
spine_physics_constraint_pose_set_wind(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
||||||
@ -101,7 +101,7 @@ public class PhysicsConstraintPose: NSObject {
|
|||||||
public var gravity: Float {
|
public var gravity: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_pose_get_gravity(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
let result = spine_physics_constraint_pose_get_gravity(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_pose_set_gravity(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
spine_physics_constraint_pose_set_gravity(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
||||||
@ -112,7 +112,7 @@ public class PhysicsConstraintPose: NSObject {
|
|||||||
public var mix: Float {
|
public var mix: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_pose_get_mix(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
let result = spine_physics_constraint_pose_get_mix(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_pose_set_mix(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
spine_physics_constraint_pose_set_mix(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), newValue)
|
||||||
@ -120,9 +120,7 @@ public class PhysicsConstraintPose: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func set(_ pose: PhysicsConstraintPose) {
|
public func set(_ pose: PhysicsConstraintPose) {
|
||||||
spine_physics_constraint_pose_set(
|
spine_physics_constraint_pose_set(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self),
|
|
||||||
pose._ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -49,20 +49,17 @@ public class PhysicsConstraintResetTimeline: Timeline, ConstraintTimeline {
|
|||||||
|
|
||||||
public var constraintIndex: Int32 {
|
public var constraintIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_reset_timeline_get_constraint_index(
|
let result = spine_physics_constraint_reset_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self))
|
return result
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_reset_timeline_set_constraint_index(
|
spine_physics_constraint_reset_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self), newValue)
|
||||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self), newValue)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the time for the specified frame.
|
/// Sets the time for the specified frame.
|
||||||
public func setFrame(_ frame: Int32, _ time: Float) {
|
public func setFrame(_ frame: Int32, _ time: Float) {
|
||||||
spine_physics_constraint_reset_timeline_set_frame(
|
spine_physics_constraint_reset_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self), frame, time)
|
||||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self), frame, time)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -43,13 +43,11 @@ open class PhysicsConstraintTimeline: CurveTimeline1, ConstraintTimeline {
|
|||||||
|
|
||||||
public var constraintIndex: Int32 {
|
public var constraintIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_physics_constraint_timeline_get_constraint_index(
|
let result = spine_physics_constraint_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self))
|
return result
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_physics_constraint_timeline_set_constraint_index(
|
spine_physics_constraint_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self), newValue)
|
||||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self), newValue)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ public class PointAttachment: Attachment {
|
|||||||
public var x: Float {
|
public var x: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_point_attachment_get_x(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
let result = spine_point_attachment_get_x(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_point_attachment_set_x(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self), newValue)
|
spine_point_attachment_set_x(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self), newValue)
|
||||||
@ -63,7 +63,7 @@ public class PointAttachment: Attachment {
|
|||||||
public var y: Float {
|
public var y: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_point_attachment_get_y(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
let result = spine_point_attachment_get_y(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_point_attachment_set_y(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self), newValue)
|
spine_point_attachment_set_y(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self), newValue)
|
||||||
@ -73,7 +73,7 @@ public class PointAttachment: Attachment {
|
|||||||
public var rotation: Float {
|
public var rotation: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_point_attachment_get_rotation(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
let result = spine_point_attachment_get_rotation(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_point_attachment_set_rotation(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self), newValue)
|
spine_point_attachment_set_rotation(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self), newValue)
|
||||||
@ -86,8 +86,7 @@ public class PointAttachment: Attachment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func computeWorldRotation(_ bone: BonePose) -> Float {
|
public func computeWorldRotation(_ bone: BonePose) -> Float {
|
||||||
let result = spine_point_attachment_compute_world_rotation(
|
let result = spine_point_attachment_compute_world_rotation(_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self), bone._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_point_attachment_wrapper.self), bone._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -62,7 +62,7 @@ public class PosedData: NSObject {
|
|||||||
public var skinRequired: Bool {
|
public var skinRequired: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_posed_data_get_skin_required(_ptr.assumingMemoryBound(to: spine_posed_data_wrapper.self))
|
let result = spine_posed_data_get_skin_required(_ptr.assumingMemoryBound(to: spine_posed_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_posed_data_set_skin_required(_ptr.assumingMemoryBound(to: spine_posed_data_wrapper.self), newValue)
|
spine_posed_data_set_skin_required(_ptr.assumingMemoryBound(to: spine_posed_data_wrapper.self), newValue)
|
||||||
|
|||||||
@ -53,17 +53,17 @@ public enum Property: Int32, CaseIterable {
|
|||||||
case pathConstraintPosition = 131072
|
case pathConstraintPosition = 131072
|
||||||
case pathConstraintSpacing = 262144
|
case pathConstraintSpacing = 262144
|
||||||
case pathConstraintMix = 524288
|
case pathConstraintMix = 524288
|
||||||
case physicsConstraintInertia = 1_048_576
|
case physicsConstraintInertia = 1048576
|
||||||
case physicsConstraintStrength = 2_097_152
|
case physicsConstraintStrength = 2097152
|
||||||
case physicsConstraintDamping = 4_194_304
|
case physicsConstraintDamping = 4194304
|
||||||
case physicsConstraintMass = 8_388_608
|
case physicsConstraintMass = 8388608
|
||||||
case physicsConstraintWind = 16_777_216
|
case physicsConstraintWind = 16777216
|
||||||
case physicsConstraintGravity = 33_554_432
|
case physicsConstraintGravity = 33554432
|
||||||
case physicsConstraintMix = 67_108_864
|
case physicsConstraintMix = 67108864
|
||||||
case physicsConstraintReset = 134_217_728
|
case physicsConstraintReset = 134217728
|
||||||
case sequence = 268_435_456
|
case sequence = 268435456
|
||||||
case sliderTime = 536_870_912
|
case sliderTime = 536870912
|
||||||
case sliderMix = 1_073_741_824
|
case sliderMix = 1073741824
|
||||||
|
|
||||||
public static func fromValue(_ value: Int32) -> Property? {
|
public static func fromValue(_ value: Int32) -> Property? {
|
||||||
return Property(rawValue: value)
|
return Property(rawValue: value)
|
||||||
|
|||||||
@ -41,15 +41,15 @@ public class RegionAttachment: Attachment {
|
|||||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_attachment_wrapper.self))
|
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||||
}
|
}
|
||||||
|
|
||||||
public convenience init(_ name: String) {
|
public convenience init(_ name: String, _ sequence: Sequence?) {
|
||||||
let ptr = spine_region_attachment_create(name)
|
let ptr = spine_region_attachment_create(name, sequence?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||||
self.init(fromPointer: ptr!)
|
self.init(fromPointer: ptr!)
|
||||||
}
|
}
|
||||||
|
|
||||||
public var x: Float {
|
public var x: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_region_attachment_get_x(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
let result = spine_region_attachment_get_x(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_region_attachment_set_x(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
spine_region_attachment_set_x(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
||||||
@ -59,27 +59,17 @@ public class RegionAttachment: Attachment {
|
|||||||
public var y: Float {
|
public var y: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_region_attachment_get_y(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
let result = spine_region_attachment_get_y(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_region_attachment_set_y(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
spine_region_attachment_set_y(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var rotation: Float {
|
|
||||||
get {
|
|
||||||
let result = spine_region_attachment_get_rotation(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
spine_region_attachment_set_rotation(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public var scaleX: Float {
|
public var scaleX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_region_attachment_get_scale_x(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
let result = spine_region_attachment_get_scale_x(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_region_attachment_set_scale_x(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
spine_region_attachment_set_scale_x(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
||||||
@ -89,17 +79,27 @@ public class RegionAttachment: Attachment {
|
|||||||
public var scaleY: Float {
|
public var scaleY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_region_attachment_get_scale_y(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
let result = spine_region_attachment_get_scale_y(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_region_attachment_set_scale_y(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
spine_region_attachment_set_scale_y(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public var rotation: Float {
|
||||||
|
get {
|
||||||
|
let result = spine_region_attachment_get_rotation(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
spine_region_attachment_set_rotation(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public var width: Float {
|
public var width: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_region_attachment_get_width(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
let result = spine_region_attachment_get_width(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_region_attachment_set_width(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
spine_region_attachment_set_width(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
||||||
@ -109,70 +109,53 @@ public class RegionAttachment: Attachment {
|
|||||||
public var height: Float {
|
public var height: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_region_attachment_get_height(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
let result = spine_region_attachment_get_height(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_region_attachment_set_height(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
spine_region_attachment_set_height(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public var sequence: Sequence {
|
||||||
|
let result = spine_region_attachment_get_sequence(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||||
|
return Sequence(fromPointer: result!)
|
||||||
|
}
|
||||||
|
|
||||||
|
public var path: String {
|
||||||
|
get {
|
||||||
|
let result = spine_region_attachment_get_path(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||||
|
return String(cString: result!)
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
spine_region_attachment_set_path(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public var color: Color {
|
public var color: Color {
|
||||||
let result = spine_region_attachment_get_color(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
let result = spine_region_attachment_get_color(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||||
return Color(fromPointer: result!)
|
return Color(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
public var path: String {
|
/// Returns the vertex offsets for the specified slot pose.
|
||||||
get {
|
public func getOffsets(_ pose: SlotPose) -> ArrayFloat {
|
||||||
let result = spine_region_attachment_get_path(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
let result = spine_region_attachment_get_offsets(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self))
|
||||||
return String(cString: result!)
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
spine_region_attachment_set_path(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), newValue)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public var region: TextureRegion? {
|
|
||||||
get {
|
|
||||||
let result = spine_region_attachment_get_region(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
|
||||||
return result.map { TextureRegion(fromPointer: $0) }
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
spine_region_attachment_set_region(
|
|
||||||
_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self),
|
|
||||||
newValue?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public var sequence: Sequence? {
|
|
||||||
get {
|
|
||||||
let result = spine_region_attachment_get_sequence(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
|
||||||
return result.map { Sequence(fromPointer: $0) }
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
spine_region_attachment_set_sequence(
|
|
||||||
_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self),
|
|
||||||
newValue?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public var offset: ArrayFloat {
|
|
||||||
let result = spine_region_attachment_get_offset(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
|
||||||
return ArrayFloat(fromPointer: result!)
|
return ArrayFloat(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
public var uVs: ArrayFloat {
|
public func updateSequence() {
|
||||||
let result = spine_region_attachment_get_u_vs(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
spine_region_attachment_update_sequence(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||||
return ArrayFloat(fromPointer: result!)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func updateRegion() {
|
/// Computes UVs and offsets for a region attachment.
|
||||||
spine_region_attachment_update_region(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
///
|
||||||
|
/// - Parameter uvs: Output array for the computed UVs, length of 8.
|
||||||
|
/// - Parameter offset: Output array for the computed vertex offsets, length of 8.
|
||||||
|
public static func computeUVs(_ region: TextureRegion?, _ x: Float, _ y: Float, _ scaleX: Float, _ scaleY: Float, _ rotation: Float, _ width: Float, _ height: Float, _ offset: ArrayFloat, _ uvs: ArrayFloat) {
|
||||||
|
spine_region_attachment_compute_u_vs(region?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), x, y, scaleX, scaleY, rotation, width, height, offset._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self), uvs._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||||
}
|
}
|
||||||
|
|
||||||
public func computeWorldVertices(_ slot: Slot, _ worldVertices: ArrayFloat, _ offset: Int, _ stride: Int) {
|
public func computeWorldVertices(_ slot: Slot, _ vertexOffsets: ArrayFloat, _ worldVertices: ArrayFloat, _ offset: Int, _ stride: Int) {
|
||||||
spine_region_attachment_compute_world_vertices_2(
|
spine_region_attachment_compute_world_vertices_2(_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), slot._ptr.assumingMemoryBound(to: spine_slot_wrapper.self), vertexOffsets._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self), worldVertices._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self), offset, stride)
|
||||||
_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self), slot._ptr.assumingMemoryBound(to: spine_slot_wrapper.self),
|
|
||||||
worldVertices._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self), offset, stride)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -77,7 +77,7 @@ public class SequenceTimeline: Timeline, SlotTimeline {
|
|||||||
public var slotIndex: Int32 {
|
public var slotIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_sequence_timeline_get_slot_index(_ptr.assumingMemoryBound(to: spine_sequence_timeline_wrapper.self))
|
let result = spine_sequence_timeline_get_slot_index(_ptr.assumingMemoryBound(to: spine_sequence_timeline_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_sequence_timeline_set_slot_index(_ptr.assumingMemoryBound(to: spine_sequence_timeline_wrapper.self), newValue)
|
spine_sequence_timeline_set_slot_index(_ptr.assumingMemoryBound(to: spine_sequence_timeline_wrapper.self), newValue)
|
||||||
@ -89,9 +89,7 @@ public class SequenceTimeline: Timeline, SlotTimeline {
|
|||||||
/// - Parameter frame: Between 0 and frameCount, inclusive.
|
/// - Parameter frame: Between 0 and frameCount, inclusive.
|
||||||
/// - Parameter delay: Seconds between frames.
|
/// - Parameter delay: Seconds between frames.
|
||||||
public func setFrame(_ frame: Int32, _ time: Float, _ mode: SequenceMode, _ index: Int32, _ delay: Float) {
|
public func setFrame(_ frame: Int32, _ time: Float, _ mode: SequenceMode, _ index: Int32, _ delay: Float) {
|
||||||
spine_sequence_timeline_set_frame(
|
spine_sequence_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_sequence_timeline_wrapper.self), frame, time, spine_sequence_mode(rawValue: UInt32(mode.rawValue)), index, delay)
|
||||||
_ptr.assumingMemoryBound(to: spine_sequence_timeline_wrapper.self), frame, time, spine_sequence_mode(rawValue: UInt32(mode.rawValue)),
|
|
||||||
index, delay)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -104,9 +104,7 @@ public class SkeletonBounds: NSObject {
|
|||||||
/// - Parameter skeleton: The skeleton.
|
/// - Parameter skeleton: The skeleton.
|
||||||
/// - Parameter updateAabb: If true, the axis aligned bounding box containing all the polygons is computed. If false, the SkeletonBounds AABB methods will always return true.
|
/// - Parameter updateAabb: If true, the axis aligned bounding box containing all the polygons is computed. If false, the SkeletonBounds AABB methods will always return true.
|
||||||
public func update(_ skeleton: Skeleton, _ updateAabb: Bool) {
|
public func update(_ skeleton: Skeleton, _ updateAabb: Bool) {
|
||||||
spine_skeleton_bounds_update(
|
spine_skeleton_bounds_update(_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), updateAabb)
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
|
||||||
updateAabb)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if the axis aligned bounding box contains the point.
|
/// Returns true if the axis aligned bounding box contains the point.
|
||||||
@ -124,31 +122,26 @@ public class SkeletonBounds: NSObject {
|
|||||||
/// Returns true if the axis aligned bounding box intersects the axis aligned bounding box of
|
/// Returns true if the axis aligned bounding box intersects the axis aligned bounding box of
|
||||||
/// the specified bounds.
|
/// the specified bounds.
|
||||||
public func aabbIntersectsSkeleton(_ bounds: SkeletonBounds) -> Bool {
|
public func aabbIntersectsSkeleton(_ bounds: SkeletonBounds) -> Bool {
|
||||||
let result = spine_skeleton_bounds_aabb_intersects_skeleton(
|
let result = spine_skeleton_bounds_aabb_intersects_skeleton(_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), bounds._ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), bounds._ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self))
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the polygon for the given bounding box attachment or null if no polygon can be found
|
/// Returns the polygon for the given bounding box attachment or null if no polygon can be found
|
||||||
/// for the attachment. Requires a call to update() first.
|
/// for the attachment. Requires a call to update() first.
|
||||||
public func getPolygon(_ attachment: BoundingBoxAttachment?) -> Polygon? {
|
public func getPolygon(_ attachment: BoundingBoxAttachment?) -> Polygon? {
|
||||||
let result = spine_skeleton_bounds_get_polygon(
|
let result = spine_skeleton_bounds_get_polygon(_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), attachment?._ptr.assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self),
|
|
||||||
attachment?._ptr.assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
|
||||||
return result.map { Polygon(fromPointer: $0) }
|
return result.map { Polygon(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the bounding box for the given polygon or null. Requires a call to update() first.
|
/// Returns the bounding box for the given polygon or null. Requires a call to update() first.
|
||||||
public func getBoundingBox(_ polygon: Polygon?) -> BoundingBoxAttachment? {
|
public func getBoundingBox(_ polygon: Polygon?) -> BoundingBoxAttachment? {
|
||||||
let result = spine_skeleton_bounds_get_bounding_box(
|
let result = spine_skeleton_bounds_get_bounding_box(_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), polygon?._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), polygon?._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
|
|
||||||
return result.map { BoundingBoxAttachment(fromPointer: $0) }
|
return result.map { BoundingBoxAttachment(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if the polygon contains the point.
|
/// Returns true if the polygon contains the point.
|
||||||
public func containsPoint(_ polygon: Polygon, _ x: Float, _ y: Float) -> Bool {
|
public func containsPoint(_ polygon: Polygon, _ x: Float, _ y: Float) -> Bool {
|
||||||
let result = spine_skeleton_bounds_contains_point_1(
|
let result = spine_skeleton_bounds_contains_point_1(_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), polygon._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self), x, y)
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), polygon._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self), x, y)
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,9 +163,7 @@ public class SkeletonBounds: NSObject {
|
|||||||
|
|
||||||
/// Returns true if the polygon contains any part of the line segment.
|
/// Returns true if the polygon contains any part of the line segment.
|
||||||
public func intersectsSegment2(_ polygon: Polygon, _ x1: Float, _ y1: Float, _ x2: Float, _ y2: Float) -> Bool {
|
public func intersectsSegment2(_ polygon: Polygon, _ x1: Float, _ y1: Float, _ x2: Float, _ y2: Float) -> Bool {
|
||||||
let result = spine_skeleton_bounds_intersects_segment_2(
|
let result = spine_skeleton_bounds_intersects_segment_2(_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), polygon._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self), x1, y1, x2, y2)
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), polygon._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self), x1,
|
|
||||||
y1, x2, y2)
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -69,15 +69,12 @@ public class SkeletonClipping: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func clipStart(_ skeleton: Skeleton, _ slot: Slot, _ clip: ClippingAttachment?) -> Int {
|
public func clipStart(_ skeleton: Skeleton, _ slot: Slot, _ clip: ClippingAttachment?) -> Int {
|
||||||
let result = spine_skeleton_clipping_clip_start(
|
let result = spine_skeleton_clipping_clip_start(_ptr.assumingMemoryBound(to: spine_skeleton_clipping_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), slot._ptr.assumingMemoryBound(to: spine_slot_wrapper.self), clip?._ptr.assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_clipping_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
|
||||||
slot._ptr.assumingMemoryBound(to: spine_slot_wrapper.self), clip?._ptr.assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
public func clipEnd(_ slot: Slot) {
|
public func clipEnd(_ slot: Slot) {
|
||||||
spine_skeleton_clipping_clip_end_1(
|
spine_skeleton_clipping_clip_end_1(_ptr.assumingMemoryBound(to: spine_skeleton_clipping_wrapper.self), slot._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_clipping_wrapper.self), slot._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func clipEnd2() {
|
public func clipEnd2() {
|
||||||
@ -85,10 +82,7 @@ public class SkeletonClipping: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func clipTriangles(_ vertices: ArrayFloat, _ triangles: ArrayUnsignedShort, _ uvs: ArrayFloat, _ stride: Int) -> Bool {
|
public func clipTriangles(_ vertices: ArrayFloat, _ triangles: ArrayUnsignedShort, _ uvs: ArrayFloat, _ stride: Int) -> Bool {
|
||||||
let result = spine_skeleton_clipping_clip_triangles_3(
|
let result = spine_skeleton_clipping_clip_triangles_3(_ptr.assumingMemoryBound(to: spine_skeleton_clipping_wrapper.self), vertices._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self), triangles._ptr.assumingMemoryBound(to: spine_array_unsigned_short_wrapper.self), uvs._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self), stride)
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_clipping_wrapper.self), vertices._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self),
|
|
||||||
triangles._ptr.assumingMemoryBound(to: spine_array_unsigned_short_wrapper.self),
|
|
||||||
uvs._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self), stride)
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ public class SkeletonData: NSObject {
|
|||||||
public var name: String {
|
public var name: String {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_data_get_name(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
let result = spine_skeleton_data_get_name(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_data_set_name(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
spine_skeleton_data_set_name(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
||||||
@ -87,11 +87,10 @@ public class SkeletonData: NSObject {
|
|||||||
public var defaultSkin: Skin? {
|
public var defaultSkin: Skin? {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_data_get_default_skin(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
let result = spine_skeleton_data_get_default_skin(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
||||||
return result.map { Skin(fromPointer: $0) }
|
return result.map { Skin(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_data_set_default_skin(
|
spine_skeleton_data_set_default_skin(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,7 +116,7 @@ public class SkeletonData: NSObject {
|
|||||||
public var x: Float {
|
public var x: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_data_get_x(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
let result = spine_skeleton_data_get_x(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_data_set_x(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
spine_skeleton_data_set_x(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
||||||
@ -128,7 +127,7 @@ public class SkeletonData: NSObject {
|
|||||||
public var y: Float {
|
public var y: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_data_get_y(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
let result = spine_skeleton_data_get_y(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_data_set_y(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
spine_skeleton_data_set_y(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
||||||
@ -139,7 +138,7 @@ public class SkeletonData: NSObject {
|
|||||||
public var width: Float {
|
public var width: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_data_get_width(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
let result = spine_skeleton_data_get_width(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_data_set_width(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
spine_skeleton_data_set_width(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
||||||
@ -150,7 +149,7 @@ public class SkeletonData: NSObject {
|
|||||||
public var height: Float {
|
public var height: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_data_get_height(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
let result = spine_skeleton_data_get_height(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_data_set_height(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
spine_skeleton_data_set_height(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
||||||
@ -162,7 +161,7 @@ public class SkeletonData: NSObject {
|
|||||||
public var referenceScale: Float {
|
public var referenceScale: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_data_get_reference_scale(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
let result = spine_skeleton_data_get_reference_scale(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_data_set_reference_scale(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
spine_skeleton_data_set_reference_scale(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
||||||
@ -173,7 +172,7 @@ public class SkeletonData: NSObject {
|
|||||||
public var version: String {
|
public var version: String {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_data_get_version(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
let result = spine_skeleton_data_get_version(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_data_set_version(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
spine_skeleton_data_set_version(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
||||||
@ -184,7 +183,7 @@ public class SkeletonData: NSObject {
|
|||||||
public var hashString: String {
|
public var hashString: String {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_data_get_hash(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
let result = spine_skeleton_data_get_hash(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_data_set_hash(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
spine_skeleton_data_set_hash(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
||||||
@ -196,7 +195,7 @@ public class SkeletonData: NSObject {
|
|||||||
public var imagesPath: String {
|
public var imagesPath: String {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_data_get_images_path(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
let result = spine_skeleton_data_get_images_path(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_data_set_images_path(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
spine_skeleton_data_set_images_path(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
||||||
@ -208,7 +207,7 @@ public class SkeletonData: NSObject {
|
|||||||
public var audioPath: String {
|
public var audioPath: String {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_data_get_audio_path(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
let result = spine_skeleton_data_get_audio_path(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_data_set_audio_path(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
spine_skeleton_data_set_audio_path(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
||||||
@ -219,7 +218,7 @@ public class SkeletonData: NSObject {
|
|||||||
public var fps: Float {
|
public var fps: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_skeleton_data_get_fps(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
let result = spine_skeleton_data_get_fps(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_skeleton_data_set_fps(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
spine_skeleton_data_set_fps(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue)
|
||||||
|
|||||||
@ -49,8 +49,7 @@ public class SkeletonRenderer: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func render(_ skeleton: Skeleton) -> RenderCommand? {
|
public func render(_ skeleton: Skeleton) -> RenderCommand? {
|
||||||
let result = spine_skeleton_renderer_render(
|
let result = spine_skeleton_renderer_render(_ptr.assumingMemoryBound(to: spine_skeleton_renderer_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_skeleton_renderer_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
return result.map { RenderCommand(fromPointer: $0) }
|
return result.map { RenderCommand(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -83,15 +83,12 @@ open class SliderBase: PosedActive, Posed, Constraint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func sort(_ skeleton: Skeleton) {
|
public func sort(_ skeleton: Skeleton) {
|
||||||
spine_slider_base_sort(
|
spine_slider_base_sort(_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inherited from Update
|
/// Inherited from Update
|
||||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||||
spine_slider_base_update(
|
spine_slider_base_update(_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
|
||||||
spine_physics(rawValue: UInt32(physics.rawValue)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func rttiStatic() -> Rtti {
|
public static func rttiStatic() -> Rtti {
|
||||||
|
|||||||
@ -54,18 +54,17 @@ public class SliderData: PosedData, ConstraintData {
|
|||||||
public var animation: Animation {
|
public var animation: Animation {
|
||||||
get {
|
get {
|
||||||
let result = spine_slider_data_get_animation(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
let result = spine_slider_data_get_animation(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
||||||
return Animation(fromPointer: result!)
|
return Animation(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slider_data_set_animation(
|
spine_slider_data_set_animation(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var additive: Bool {
|
public var additive: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_slider_data_get_additive(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
let result = spine_slider_data_get_additive(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slider_data_set_additive(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue)
|
spine_slider_data_set_additive(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue)
|
||||||
@ -75,7 +74,7 @@ public class SliderData: PosedData, ConstraintData {
|
|||||||
public var loop: Bool {
|
public var loop: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_slider_data_get_loop(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
let result = spine_slider_data_get_loop(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slider_data_set_loop(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue)
|
spine_slider_data_set_loop(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue)
|
||||||
@ -85,54 +84,51 @@ public class SliderData: PosedData, ConstraintData {
|
|||||||
public var bone: BoneData? {
|
public var bone: BoneData? {
|
||||||
get {
|
get {
|
||||||
let result = spine_slider_data_get_bone(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
let result = spine_slider_data_get_bone(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
||||||
return result.map { BoneData(fromPointer: $0) }
|
return result.map { BoneData(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slider_data_set_bone(
|
spine_slider_data_set_bone(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var property: FromProperty? {
|
public var property: FromProperty? {
|
||||||
get {
|
get {
|
||||||
let result = spine_slider_data_get_property(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
let result = spine_slider_data_get_property(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
||||||
guard let ptr = result else { return nil }
|
guard let ptr = result else { return nil }
|
||||||
let rtti = spine_from_property_get_rtti(ptr)
|
let rtti = spine_from_property_get_rtti(ptr)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
case "FromRotate":
|
case "FromRotate":
|
||||||
let castedPtr = spine_from_property_cast_to_from_rotate(ptr)
|
let castedPtr = spine_from_property_cast_to_from_rotate(ptr)
|
||||||
return FromRotate(fromPointer: castedPtr!)
|
return FromRotate(fromPointer: castedPtr!)
|
||||||
case "FromScaleX":
|
case "FromScaleX":
|
||||||
let castedPtr = spine_from_property_cast_to_from_scale_x(ptr)
|
let castedPtr = spine_from_property_cast_to_from_scale_x(ptr)
|
||||||
return FromScaleX(fromPointer: castedPtr!)
|
return FromScaleX(fromPointer: castedPtr!)
|
||||||
case "FromScaleY":
|
case "FromScaleY":
|
||||||
let castedPtr = spine_from_property_cast_to_from_scale_y(ptr)
|
let castedPtr = spine_from_property_cast_to_from_scale_y(ptr)
|
||||||
return FromScaleY(fromPointer: castedPtr!)
|
return FromScaleY(fromPointer: castedPtr!)
|
||||||
case "FromShearY":
|
case "FromShearY":
|
||||||
let castedPtr = spine_from_property_cast_to_from_shear_y(ptr)
|
let castedPtr = spine_from_property_cast_to_from_shear_y(ptr)
|
||||||
return FromShearY(fromPointer: castedPtr!)
|
return FromShearY(fromPointer: castedPtr!)
|
||||||
case "FromX":
|
case "FromX":
|
||||||
let castedPtr = spine_from_property_cast_to_from_x(ptr)
|
let castedPtr = spine_from_property_cast_to_from_x(ptr)
|
||||||
return FromX(fromPointer: castedPtr!)
|
return FromX(fromPointer: castedPtr!)
|
||||||
case "FromY":
|
case "FromY":
|
||||||
let castedPtr = spine_from_property_cast_to_from_y(ptr)
|
let castedPtr = spine_from_property_cast_to_from_y(ptr)
|
||||||
return FromY(fromPointer: castedPtr!)
|
return FromY(fromPointer: castedPtr!)
|
||||||
default:
|
default:
|
||||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class FromProperty")
|
fatalError("Unknown concrete type: \(rttiClassName) for abstract class FromProperty")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slider_data_set_property(
|
spine_slider_data_set_property(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_from_property_wrapper.self)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var scale: Float {
|
public var scale: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_slider_data_get_scale(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
let result = spine_slider_data_get_scale(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slider_data_set_scale(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue)
|
spine_slider_data_set_scale(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue)
|
||||||
@ -142,7 +138,7 @@ public class SliderData: PosedData, ConstraintData {
|
|||||||
public var offset: Float {
|
public var offset: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_slider_data_get_offset(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
let result = spine_slider_data_get_offset(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slider_data_set_offset(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue)
|
spine_slider_data_set_offset(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue)
|
||||||
@ -152,7 +148,7 @@ public class SliderData: PosedData, ConstraintData {
|
|||||||
public var local: Bool {
|
public var local: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_slider_data_get_local(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
let result = spine_slider_data_get_local(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slider_data_set_local(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue)
|
spine_slider_data_set_local(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue)
|
||||||
@ -166,8 +162,7 @@ public class SliderData: PosedData, ConstraintData {
|
|||||||
|
|
||||||
/// Creates a slider instance.
|
/// Creates a slider instance.
|
||||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||||
let result = spine_slider_data_create_method(
|
let result = spine_slider_data_create_method(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
let rtti = spine_constraint_get_rtti(result!)
|
let rtti = spine_constraint_get_rtti(result!)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class SliderPose: NSObject {
|
|||||||
public var time: Float {
|
public var time: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_slider_pose_get_time(_ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self))
|
let result = spine_slider_pose_get_time(_ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slider_pose_set_time(_ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self), newValue)
|
spine_slider_pose_set_time(_ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self), newValue)
|
||||||
@ -61,7 +61,7 @@ public class SliderPose: NSObject {
|
|||||||
public var mix: Float {
|
public var mix: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_slider_pose_get_mix(_ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self))
|
let result = spine_slider_pose_get_mix(_ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slider_pose_set_mix(_ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self), newValue)
|
spine_slider_pose_set_mix(_ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self), newValue)
|
||||||
@ -69,8 +69,7 @@ public class SliderPose: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func set(_ pose: SliderPose) {
|
public func set(_ pose: SliderPose) {
|
||||||
spine_slider_pose_set(
|
spine_slider_pose_set(_ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -44,7 +44,7 @@ open class SlotCurveTimeline: CurveTimeline, SlotTimeline {
|
|||||||
public var slotIndex: Int32 {
|
public var slotIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_slot_curve_timeline_get_slot_index(_ptr.assumingMemoryBound(to: spine_slot_curve_timeline_wrapper.self))
|
let result = spine_slot_curve_timeline_get_slot_index(_ptr.assumingMemoryBound(to: spine_slot_curve_timeline_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slot_curve_timeline_set_slot_index(_ptr.assumingMemoryBound(to: spine_slot_curve_timeline_wrapper.self), newValue)
|
spine_slot_curve_timeline_set_slot_index(_ptr.assumingMemoryBound(to: spine_slot_curve_timeline_wrapper.self), newValue)
|
||||||
|
|||||||
@ -63,7 +63,7 @@ public class SlotData: PosedData {
|
|||||||
public var attachmentName: String {
|
public var attachmentName: String {
|
||||||
get {
|
get {
|
||||||
let result = spine_slot_data_get_attachment_name(_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
let result = spine_slot_data_get_attachment_name(_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
||||||
return String(cString: result!)
|
return String(cString: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slot_data_set_attachment_name(_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), newValue)
|
spine_slot_data_set_attachment_name(_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), newValue)
|
||||||
@ -74,11 +74,10 @@ public class SlotData: PosedData {
|
|||||||
public var blendMode: BlendMode {
|
public var blendMode: BlendMode {
|
||||||
get {
|
get {
|
||||||
let result = spine_slot_data_get_blend_mode(_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
let result = spine_slot_data_get_blend_mode(_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
||||||
return BlendMode(rawValue: Int32(result.rawValue))!
|
return BlendMode(rawValue: Int32(result.rawValue))!
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slot_data_set_blend_mode(
|
spine_slot_data_set_blend_mode(_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), spine_blend_mode(rawValue: UInt32(newValue.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), spine_blend_mode(rawValue: UInt32(newValue.rawValue)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +86,7 @@ public class SlotData: PosedData {
|
|||||||
public var visible: Bool {
|
public var visible: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_slot_data_get_visible(_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
let result = spine_slot_data_get_visible(_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slot_data_set_visible(_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), newValue)
|
spine_slot_data_set_visible(_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), newValue)
|
||||||
|
|||||||
@ -66,7 +66,7 @@ public class SlotPose: NSObject {
|
|||||||
public var hasDarkColor: Bool {
|
public var hasDarkColor: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_slot_pose_has_dark_color(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self))
|
let result = spine_slot_pose_has_dark_color(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slot_pose_set_has_dark_color(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), newValue)
|
spine_slot_pose_set_has_dark_color(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), newValue)
|
||||||
@ -77,35 +77,34 @@ public class SlotPose: NSObject {
|
|||||||
public var attachment: Attachment? {
|
public var attachment: Attachment? {
|
||||||
get {
|
get {
|
||||||
let result = spine_slot_pose_get_attachment(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self))
|
let result = spine_slot_pose_get_attachment(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self))
|
||||||
guard let ptr = result else { return nil }
|
guard let ptr = result else { return nil }
|
||||||
let rtti = spine_attachment_get_rtti(ptr)
|
let rtti = spine_attachment_get_rtti(ptr)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
case "BoundingBoxAttachment":
|
case "BoundingBoxAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(ptr)
|
||||||
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
||||||
case "ClippingAttachment":
|
case "ClippingAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_clipping_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_clipping_attachment(ptr)
|
||||||
return ClippingAttachment(fromPointer: castedPtr!)
|
return ClippingAttachment(fromPointer: castedPtr!)
|
||||||
case "MeshAttachment":
|
case "MeshAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_mesh_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_mesh_attachment(ptr)
|
||||||
return MeshAttachment(fromPointer: castedPtr!)
|
return MeshAttachment(fromPointer: castedPtr!)
|
||||||
case "PathAttachment":
|
case "PathAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_path_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_path_attachment(ptr)
|
||||||
return PathAttachment(fromPointer: castedPtr!)
|
return PathAttachment(fromPointer: castedPtr!)
|
||||||
case "PointAttachment":
|
case "PointAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_point_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_point_attachment(ptr)
|
||||||
return PointAttachment(fromPointer: castedPtr!)
|
return PointAttachment(fromPointer: castedPtr!)
|
||||||
case "RegionAttachment":
|
case "RegionAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_region_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_region_attachment(ptr)
|
||||||
return RegionAttachment(fromPointer: castedPtr!)
|
return RegionAttachment(fromPointer: castedPtr!)
|
||||||
default:
|
default:
|
||||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slot_pose_set_attachment(
|
spine_slot_pose_set_attachment(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +113,7 @@ public class SlotPose: NSObject {
|
|||||||
public var sequenceIndex: Int32 {
|
public var sequenceIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_slot_pose_get_sequence_index(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self))
|
let result = spine_slot_pose_get_sequence_index(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_slot_pose_set_sequence_index(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), newValue)
|
spine_slot_pose_set_sequence_index(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), newValue)
|
||||||
@ -132,8 +131,7 @@ public class SlotPose: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func set(_ pose: SlotPose) {
|
public func set(_ pose: SlotPose) {
|
||||||
spine_slot_pose_set(
|
spine_slot_pose_set(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -56,7 +56,7 @@ public class TextureRegion: NSObject {
|
|||||||
public var u: Float {
|
public var u: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_texture_region_get_u(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
let result = spine_texture_region_get_u(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_texture_region_set_u(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), newValue)
|
spine_texture_region_set_u(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), newValue)
|
||||||
@ -66,7 +66,7 @@ public class TextureRegion: NSObject {
|
|||||||
public var v: Float {
|
public var v: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_texture_region_get_v(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
let result = spine_texture_region_get_v(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_texture_region_set_v(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), newValue)
|
spine_texture_region_set_v(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), newValue)
|
||||||
@ -76,7 +76,7 @@ public class TextureRegion: NSObject {
|
|||||||
public var u2: Float {
|
public var u2: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_texture_region_get_u2(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
let result = spine_texture_region_get_u2(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_texture_region_set_u2(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), newValue)
|
spine_texture_region_set_u2(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), newValue)
|
||||||
@ -86,7 +86,7 @@ public class TextureRegion: NSObject {
|
|||||||
public var v2: Float {
|
public var v2: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_texture_region_get_v2(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
let result = spine_texture_region_get_v2(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_texture_region_set_v2(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), newValue)
|
spine_texture_region_set_v2(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), newValue)
|
||||||
@ -96,7 +96,7 @@ public class TextureRegion: NSObject {
|
|||||||
public var regionWidth: Int32 {
|
public var regionWidth: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_texture_region_get_region_width(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
let result = spine_texture_region_get_region_width(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_texture_region_set_region_width(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), newValue)
|
spine_texture_region_set_region_width(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), newValue)
|
||||||
@ -106,7 +106,7 @@ public class TextureRegion: NSObject {
|
|||||||
public var regionHeight: Int32 {
|
public var regionHeight: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_texture_region_get_region_height(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
let result = spine_texture_region_get_region_height(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_texture_region_set_region_height(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), newValue)
|
spine_texture_region_set_region_height(_ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self), newValue)
|
||||||
|
|||||||
@ -51,7 +51,7 @@ open class ToProperty: NSObject {
|
|||||||
public var offset: Float {
|
public var offset: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_to_property_get__offset(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self))
|
let result = spine_to_property_get__offset(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_to_property_set__offset(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self), newValue)
|
spine_to_property_set__offset(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self), newValue)
|
||||||
@ -61,7 +61,7 @@ open class ToProperty: NSObject {
|
|||||||
public var max: Float {
|
public var max: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_to_property_get__max(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self))
|
let result = spine_to_property_get__max(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_to_property_set__max(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self), newValue)
|
spine_to_property_set__max(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self), newValue)
|
||||||
@ -71,7 +71,7 @@ open class ToProperty: NSObject {
|
|||||||
public var scale: Float {
|
public var scale: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_to_property_get__scale(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self))
|
let result = spine_to_property_get__scale(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_to_property_set__scale(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self), newValue)
|
spine_to_property_set__scale(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self), newValue)
|
||||||
@ -80,18 +80,13 @@ open class ToProperty: NSObject {
|
|||||||
|
|
||||||
/// Reads the mix for this property from the specified pose.
|
/// Reads the mix for this property from the specified pose.
|
||||||
public func mix(_ pose: TransformConstraintPose) -> Float {
|
public func mix(_ pose: TransformConstraintPose) -> Float {
|
||||||
let result = spine_to_property_mix(
|
let result = spine_to_property_mix(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self),
|
|
||||||
pose._ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Applies the value to this property.
|
/// Applies the value to this property.
|
||||||
public func apply(_ skeleton: Skeleton, _ pose: TransformConstraintPose, _ bone: BonePose, _ value: Float, _ local: Bool, _ additive: Bool) {
|
public func apply(_ skeleton: Skeleton, _ pose: TransformConstraintPose, _ bone: BonePose, _ value: Float, _ local: Bool, _ additive: Bool) {
|
||||||
spine_to_property_apply(
|
spine_to_property_apply(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), bone._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), value, local, additive)
|
||||||
_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
|
||||||
pose._ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self),
|
|
||||||
bone._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), value, local, additive)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func rttiStatic() -> Rtti {
|
public static func rttiStatic() -> Rtti {
|
||||||
|
|||||||
@ -58,11 +58,10 @@ public class TrackEntry: NSObject {
|
|||||||
public var animation: Animation {
|
public var animation: Animation {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_animation(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_animation(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return Animation(fromPointer: result!)
|
return Animation(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_animation(
|
spine_track_entry_set_animation(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +75,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var loop: Bool {
|
public var loop: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_loop(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_loop(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_loop(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_loop(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -92,13 +91,13 @@ public class TrackEntry: NSObject {
|
|||||||
/// from 0% to 100%. Setting holdPrevious to true applies the first animation at 100% during the
|
/// from 0% to 100%. Setting holdPrevious to true applies the first animation at 100% during the
|
||||||
/// mix so the lower track value is overwritten. Such dipping does not occur on the lowest track
|
/// mix so the lower track value is overwritten. Such dipping does not occur on the lowest track
|
||||||
/// which keys the property, only when a higher track also keys the property.
|
/// which keys the property, only when a higher track also keys the property.
|
||||||
///
|
///
|
||||||
/// Snapping will occur if holdPrevious is true and this animation does not key all the same
|
/// Snapping will occur if holdPrevious is true and this animation does not key all the same
|
||||||
/// properties as the previous animation.
|
/// properties as the previous animation.
|
||||||
public var holdPrevious: Bool {
|
public var holdPrevious: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_hold_previous(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_hold_previous(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_hold_previous(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_hold_previous(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -108,7 +107,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var reverse: Bool {
|
public var reverse: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_reverse(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_reverse(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_reverse(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_reverse(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -118,7 +117,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var shortestRotation: Bool {
|
public var shortestRotation: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_shortest_rotation(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_shortest_rotation(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_shortest_rotation(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_shortest_rotation(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -132,14 +131,14 @@ public class TrackEntry: NSObject {
|
|||||||
/// >= this track entry's delay).
|
/// >= this track entry's delay).
|
||||||
///
|
///
|
||||||
/// getTimeScale() affects the delay.
|
/// getTimeScale() affects the delay.
|
||||||
///
|
///
|
||||||
/// When passing delay < = 0 to AnimationState::addAnimation(int, Animation, bool, float) this
|
/// When passing delay < = 0 to AnimationState::addAnimation(int, Animation, bool, float) this
|
||||||
/// delay is set using a mix duration from AnimationStateData. To change the getMixDuration()
|
/// delay is set using a mix duration from AnimationStateData. To change the getMixDuration()
|
||||||
/// afterward, use setMixDuration(float, float) so this delay is adjusted.
|
/// afterward, use setMixDuration(float, float) so this delay is adjusted.
|
||||||
public var delay: Float {
|
public var delay: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_delay(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_delay(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_delay(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_delay(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -152,7 +151,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var trackTime: Float {
|
public var trackTime: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_track_time(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_track_time(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_track_time(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_track_time(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -171,7 +170,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var trackEnd: Float {
|
public var trackEnd: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_track_end(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_track_end(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_track_end(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_track_end(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -185,7 +184,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var animationStart: Float {
|
public var animationStart: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_animation_start(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_animation_start(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_animation_start(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_animation_start(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -198,7 +197,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var animationEnd: Float {
|
public var animationEnd: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_animation_end(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_animation_end(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_animation_end(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_animation_end(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -212,7 +211,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var animationLast: Float {
|
public var animationLast: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_animation_last(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_animation_last(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_animation_last(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_animation_last(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -234,19 +233,19 @@ public class TrackEntry: NSObject {
|
|||||||
/// animation to pass slower or faster. Defaults to 1.
|
/// animation to pass slower or faster. Defaults to 1.
|
||||||
///
|
///
|
||||||
/// Values < 0 are not supported. To play an animation in reverse, use getReverse().
|
/// Values < 0 are not supported. To play an animation in reverse, use getReverse().
|
||||||
///
|
///
|
||||||
/// getMixTime() is not affected by track entry time scale, so getMixDuration() may need to be
|
/// getMixTime() is not affected by track entry time scale, so getMixDuration() may need to be
|
||||||
/// adjusted to match the animation speed.
|
/// adjusted to match the animation speed.
|
||||||
///
|
///
|
||||||
/// When using AnimationState::addAnimation(int, Animation, bool, float) with a delay < = 0, the
|
/// When using AnimationState::addAnimation(int, Animation, bool, float) with a delay < = 0, the
|
||||||
/// getDelay() is set using the mix duration from the AnimationStateData, assuming time scale to
|
/// getDelay() is set using the mix duration from the AnimationStateData, assuming time scale to
|
||||||
/// be 1. If the time scale is not 1, the delay may need to be adjusted.
|
/// be 1. If the time scale is not 1, the delay may need to be adjusted.
|
||||||
///
|
///
|
||||||
/// See AnimationState getTimeScale() for affecting all animations.
|
/// See AnimationState getTimeScale() for affecting all animations.
|
||||||
public var timeScale: Float {
|
public var timeScale: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_time_scale(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_time_scale(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_time_scale(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_time_scale(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -262,7 +261,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var alpha: Float {
|
public var alpha: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_alpha(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_alpha(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_alpha(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_alpha(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -275,7 +274,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var eventThreshold: Float {
|
public var eventThreshold: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_event_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_event_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_event_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_event_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -288,7 +287,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var mixAttachmentThreshold: Float {
|
public var mixAttachmentThreshold: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_mix_attachment_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_mix_attachment_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_mix_attachment_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_mix_attachment_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -300,7 +299,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var alphaAttachmentThreshold: Float {
|
public var alphaAttachmentThreshold: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_alpha_attachment_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_alpha_attachment_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_alpha_attachment_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_alpha_attachment_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -313,7 +312,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var mixDrawOrderThreshold: Float {
|
public var mixDrawOrderThreshold: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_mix_draw_order_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_mix_draw_order_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_mix_draw_order_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_mix_draw_order_threshold(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -337,7 +336,7 @@ public class TrackEntry: NSObject {
|
|||||||
public var mixTime: Float {
|
public var mixTime: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_mix_time(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_mix_time(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_mix_time(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
spine_track_entry_set_mix_time(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue)
|
||||||
@ -350,7 +349,7 @@ public class TrackEntry: NSObject {
|
|||||||
/// The mix duration can be set manually rather than use the value from
|
/// The mix duration can be set manually rather than use the value from
|
||||||
/// AnimationStateData.GetMix. In that case, the mixDuration must be set before
|
/// AnimationStateData.GetMix. In that case, the mixDuration must be set before
|
||||||
/// AnimationState.update(float) is next called.
|
/// AnimationState.update(float) is next called.
|
||||||
///
|
///
|
||||||
/// When using AnimationState::addAnimation(int, Animation, bool, float) with a delay less than
|
/// When using AnimationState::addAnimation(int, Animation, bool, float) with a delay less than
|
||||||
/// or equal to 0, note the Delay is set using the mix duration from the AnimationStateData
|
/// or equal to 0, note the Delay is set using the mix duration from the AnimationStateData
|
||||||
public var mixDuration: Float {
|
public var mixDuration: Float {
|
||||||
@ -361,11 +360,10 @@ public class TrackEntry: NSObject {
|
|||||||
public var mixBlend: MixBlend {
|
public var mixBlend: MixBlend {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_mix_blend(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_mix_blend(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return MixBlend(rawValue: Int32(result.rawValue))!
|
return MixBlend(rawValue: Int32(result.rawValue))!
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_mix_blend(
|
spine_track_entry_set_mix_blend(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), spine_mix_blend(rawValue: UInt32(newValue.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), spine_mix_blend(rawValue: UInt32(newValue.rawValue)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,12 +414,10 @@ public class TrackEntry: NSObject {
|
|||||||
public var animationState: AnimationState? {
|
public var animationState: AnimationState? {
|
||||||
get {
|
get {
|
||||||
let result = spine_track_entry_get_animation_state(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
let result = spine_track_entry_get_animation_state(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||||
return result.map { AnimationState(fromPointer: $0) }
|
return result.map { AnimationState(fromPointer: $0) }
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_track_entry_set_animation_state(
|
spine_track_entry_set_animation_state(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self),
|
|
||||||
newValue?._ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,9 +42,7 @@ public class TransformConstraint: TransformConstraintBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public convenience init(_ data: TransformConstraintData, _ skeleton: Skeleton) {
|
public convenience init(_ data: TransformConstraintData, _ skeleton: Skeleton) {
|
||||||
let ptr = spine_transform_constraint_create(
|
let ptr = spine_transform_constraint_create(data._ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
data._ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self),
|
|
||||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
self.init(fromPointer: ptr!)
|
self.init(fromPointer: ptr!)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,17 +56,15 @@ public class TransformConstraint: TransformConstraintBase {
|
|||||||
public var source: Bone {
|
public var source: Bone {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_get_source(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
let result = spine_transform_constraint_get_source(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||||
return Bone(fromPointer: result!)
|
return Bone(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_set_source(
|
spine_transform_constraint_set_source(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func copyAttachment(_ skeleton: Skeleton) -> TransformConstraint {
|
public func copyAttachment(_ skeleton: Skeleton) -> TransformConstraint {
|
||||||
let result = spine_transform_constraint_copy(
|
let result = spine_transform_constraint_copy(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
return TransformConstraint(fromPointer: result!)
|
return TransformConstraint(fromPointer: result!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -57,8 +57,7 @@ open class TransformConstraintBase: PosedActive, Posed, Constraint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public var isPoseEqualToApplied: Bool {
|
public var isPoseEqualToApplied: Bool {
|
||||||
let result = spine_transform_constraint_base_is_pose_equal_to_applied(
|
let result = spine_transform_constraint_base_is_pose_equal_to_applied(_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self))
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,16 +80,12 @@ open class TransformConstraintBase: PosedActive, Posed, Constraint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func sort(_ skeleton: Skeleton) {
|
public func sort(_ skeleton: Skeleton) {
|
||||||
spine_transform_constraint_base_sort(
|
spine_transform_constraint_base_sort(_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self),
|
|
||||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inherited from Update
|
/// Inherited from Update
|
||||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||||
spine_transform_constraint_base_update(
|
spine_transform_constraint_base_update(_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self),
|
|
||||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static func rttiStatic() -> Rtti {
|
public static func rttiStatic() -> Rtti {
|
||||||
|
|||||||
@ -64,21 +64,18 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
|||||||
public var source: BoneData {
|
public var source: BoneData {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_data_get_source(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
let result = spine_transform_constraint_data_get_source(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||||
return BoneData(fromPointer: result!)
|
return BoneData(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_data_set_source(
|
spine_transform_constraint_data_set_source(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self),
|
|
||||||
newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An offset added to the constrained bone rotation.
|
/// An offset added to the constrained bone rotation.
|
||||||
public var offsetRotation: Float {
|
public var offsetRotation: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_data_get_offset_rotation(
|
let result = spine_transform_constraint_data_get_offset_rotation(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
return result
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_data_set_offset_rotation(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
spine_transform_constraint_data_set_offset_rotation(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
||||||
@ -89,7 +86,7 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
|||||||
public var offsetX: Float {
|
public var offsetX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_data_get_offset_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
let result = spine_transform_constraint_data_get_offset_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_data_set_offset_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
spine_transform_constraint_data_set_offset_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
||||||
@ -100,7 +97,7 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
|||||||
public var offsetY: Float {
|
public var offsetY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_data_get_offset_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
let result = spine_transform_constraint_data_get_offset_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_data_set_offset_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
spine_transform_constraint_data_set_offset_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
||||||
@ -110,9 +107,8 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
|||||||
/// An offset added to the constrained bone scaleX.
|
/// An offset added to the constrained bone scaleX.
|
||||||
public var offsetScaleX: Float {
|
public var offsetScaleX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_data_get_offset_scale_x(
|
let result = spine_transform_constraint_data_get_offset_scale_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
return result
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_data_set_offset_scale_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
spine_transform_constraint_data_set_offset_scale_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
||||||
@ -122,9 +118,8 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
|||||||
/// An offset added to the constrained bone scaleY.
|
/// An offset added to the constrained bone scaleY.
|
||||||
public var offsetScaleY: Float {
|
public var offsetScaleY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_data_get_offset_scale_y(
|
let result = spine_transform_constraint_data_get_offset_scale_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
return result
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_data_set_offset_scale_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
spine_transform_constraint_data_set_offset_scale_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
||||||
@ -134,9 +129,8 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
|||||||
/// An offset added to the constrained bone shearY.
|
/// An offset added to the constrained bone shearY.
|
||||||
public var offsetShearY: Float {
|
public var offsetShearY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_data_get_offset_shear_y(
|
let result = spine_transform_constraint_data_get_offset_shear_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
return result
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_data_set_offset_shear_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
spine_transform_constraint_data_set_offset_shear_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
||||||
@ -147,7 +141,7 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
|||||||
public var localSource: Bool {
|
public var localSource: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_data_get_local_source(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
let result = spine_transform_constraint_data_get_local_source(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_data_set_local_source(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
spine_transform_constraint_data_set_local_source(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
||||||
@ -158,7 +152,7 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
|||||||
public var localTarget: Bool {
|
public var localTarget: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_data_get_local_target(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
let result = spine_transform_constraint_data_get_local_target(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_data_set_local_target(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
spine_transform_constraint_data_set_local_target(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
||||||
@ -169,7 +163,7 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
|||||||
public var additive: Bool {
|
public var additive: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_data_get_additive(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
let result = spine_transform_constraint_data_get_additive(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_data_set_additive(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
spine_transform_constraint_data_set_additive(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
||||||
@ -180,7 +174,7 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
|||||||
public var clamp: Bool {
|
public var clamp: Bool {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_data_get_clamp(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
let result = spine_transform_constraint_data_get_clamp(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_data_set_clamp(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
spine_transform_constraint_data_set_clamp(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue)
|
||||||
@ -199,9 +193,7 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||||
let result = spine_transform_constraint_data_create_method(
|
let result = spine_transform_constraint_data_create_method(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self),
|
|
||||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
|
||||||
let rtti = spine_constraint_get_rtti(result!)
|
let rtti = spine_constraint_get_rtti(result!)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public class TransformConstraintPose: NSObject {
|
|||||||
public var mixRotate: Float {
|
public var mixRotate: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_pose_get_mix_rotate(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
let result = spine_transform_constraint_pose_get_mix_rotate(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_pose_set_mix_rotate(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), newValue)
|
spine_transform_constraint_pose_set_mix_rotate(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), newValue)
|
||||||
@ -64,7 +64,7 @@ public class TransformConstraintPose: NSObject {
|
|||||||
public var mixX: Float {
|
public var mixX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_pose_get_mix_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
let result = spine_transform_constraint_pose_get_mix_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_pose_set_mix_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), newValue)
|
spine_transform_constraint_pose_set_mix_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), newValue)
|
||||||
@ -76,7 +76,7 @@ public class TransformConstraintPose: NSObject {
|
|||||||
public var mixY: Float {
|
public var mixY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_pose_get_mix_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
let result = spine_transform_constraint_pose_get_mix_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_pose_set_mix_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), newValue)
|
spine_transform_constraint_pose_set_mix_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), newValue)
|
||||||
@ -87,7 +87,7 @@ public class TransformConstraintPose: NSObject {
|
|||||||
public var mixScaleX: Float {
|
public var mixScaleX: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_pose_get_mix_scale_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
let result = spine_transform_constraint_pose_get_mix_scale_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_pose_set_mix_scale_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), newValue)
|
spine_transform_constraint_pose_set_mix_scale_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), newValue)
|
||||||
@ -98,7 +98,7 @@ public class TransformConstraintPose: NSObject {
|
|||||||
public var mixScaleY: Float {
|
public var mixScaleY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_pose_get_mix_scale_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
let result = spine_transform_constraint_pose_get_mix_scale_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_pose_set_mix_scale_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), newValue)
|
spine_transform_constraint_pose_set_mix_scale_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), newValue)
|
||||||
@ -109,7 +109,7 @@ public class TransformConstraintPose: NSObject {
|
|||||||
public var mixShearY: Float {
|
public var mixShearY: Float {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_pose_get_mix_shear_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
let result = spine_transform_constraint_pose_get_mix_shear_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_pose_set_mix_shear_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), newValue)
|
spine_transform_constraint_pose_set_mix_shear_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), newValue)
|
||||||
@ -117,9 +117,7 @@ public class TransformConstraintPose: NSObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func set(_ pose: TransformConstraintPose) {
|
public func set(_ pose: TransformConstraintPose) {
|
||||||
spine_transform_constraint_pose_set(
|
spine_transform_constraint_pose_set(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self),
|
|
||||||
pose._ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -51,13 +51,11 @@ public class TransformConstraintTimeline: CurveTimeline, ConstraintTimeline {
|
|||||||
|
|
||||||
public var constraintIndex: Int32 {
|
public var constraintIndex: Int32 {
|
||||||
get {
|
get {
|
||||||
let result = spine_transform_constraint_timeline_get_constraint_index(
|
let result = spine_transform_constraint_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self))
|
return result
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_transform_constraint_timeline_set_constraint_index(
|
spine_transform_constraint_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self), newValue)
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self), newValue)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,12 +63,8 @@ public class TransformConstraintTimeline: CurveTimeline, ConstraintTimeline {
|
|||||||
///
|
///
|
||||||
/// - Parameter frame: Between 0 and frameCount, inclusive.
|
/// - Parameter frame: Between 0 and frameCount, inclusive.
|
||||||
/// - Parameter time: The frame time in seconds.
|
/// - Parameter time: The frame time in seconds.
|
||||||
public func setFrame(
|
public func setFrame(_ frame: Int32, _ time: Float, _ mixRotate: Float, _ mixX: Float, _ mixY: Float, _ mixScaleX: Float, _ mixScaleY: Float, _ mixShearY: Float) {
|
||||||
_ frame: Int32, _ time: Float, _ mixRotate: Float, _ mixX: Float, _ mixY: Float, _ mixScaleX: Float, _ mixScaleY: Float, _ mixShearY: Float
|
spine_transform_constraint_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self), frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY)
|
||||||
) {
|
|
||||||
spine_transform_constraint_timeline_set_frame(
|
|
||||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self), frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY,
|
|
||||||
mixShearY)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func dispose() {
|
public func dispose() {
|
||||||
|
|||||||
@ -51,31 +51,27 @@ open class VertexAttachment: Attachment {
|
|||||||
public var bones: ArrayInt {
|
public var bones: ArrayInt {
|
||||||
get {
|
get {
|
||||||
let result = spine_vertex_attachment_get_bones(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
let result = spine_vertex_attachment_get_bones(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||||
return ArrayInt(fromPointer: result!)
|
return ArrayInt(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_vertex_attachment_set_bones(
|
spine_vertex_attachment_set_bones(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self),
|
|
||||||
newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var vertices: ArrayFloat {
|
public var vertices: ArrayFloat {
|
||||||
get {
|
get {
|
||||||
let result = spine_vertex_attachment_get_vertices(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
let result = spine_vertex_attachment_get_vertices(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||||
return ArrayFloat(fromPointer: result!)
|
return ArrayFloat(fromPointer: result!)
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_vertex_attachment_set_vertices(
|
spine_vertex_attachment_set_vertices(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self),
|
|
||||||
newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public var worldVerticesLength: Int {
|
public var worldVerticesLength: Int {
|
||||||
get {
|
get {
|
||||||
let result = spine_vertex_attachment_get_world_vertices_length(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
let result = spine_vertex_attachment_get_world_vertices_length(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_vertex_attachment_set_world_vertices_length(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self), newValue)
|
spine_vertex_attachment_set_world_vertices_length(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self), newValue)
|
||||||
@ -85,52 +81,43 @@ open class VertexAttachment: Attachment {
|
|||||||
public var timelineAttachment: Attachment? {
|
public var timelineAttachment: Attachment? {
|
||||||
get {
|
get {
|
||||||
let result = spine_vertex_attachment_get_timeline_attachment(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
let result = spine_vertex_attachment_get_timeline_attachment(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||||
guard let ptr = result else { return nil }
|
guard let ptr = result else { return nil }
|
||||||
let rtti = spine_attachment_get_rtti(ptr)
|
let rtti = spine_attachment_get_rtti(ptr)
|
||||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||||
switch rttiClassName {
|
switch rttiClassName {
|
||||||
case "BoundingBoxAttachment":
|
case "BoundingBoxAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(ptr)
|
||||||
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
||||||
case "ClippingAttachment":
|
case "ClippingAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_clipping_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_clipping_attachment(ptr)
|
||||||
return ClippingAttachment(fromPointer: castedPtr!)
|
return ClippingAttachment(fromPointer: castedPtr!)
|
||||||
case "MeshAttachment":
|
case "MeshAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_mesh_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_mesh_attachment(ptr)
|
||||||
return MeshAttachment(fromPointer: castedPtr!)
|
return MeshAttachment(fromPointer: castedPtr!)
|
||||||
case "PathAttachment":
|
case "PathAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_path_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_path_attachment(ptr)
|
||||||
return PathAttachment(fromPointer: castedPtr!)
|
return PathAttachment(fromPointer: castedPtr!)
|
||||||
case "PointAttachment":
|
case "PointAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_point_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_point_attachment(ptr)
|
||||||
return PointAttachment(fromPointer: castedPtr!)
|
return PointAttachment(fromPointer: castedPtr!)
|
||||||
case "RegionAttachment":
|
case "RegionAttachment":
|
||||||
let castedPtr = spine_attachment_cast_to_region_attachment(ptr)
|
let castedPtr = spine_attachment_cast_to_region_attachment(ptr)
|
||||||
return RegionAttachment(fromPointer: castedPtr!)
|
return RegionAttachment(fromPointer: castedPtr!)
|
||||||
default:
|
default:
|
||||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
spine_vertex_attachment_set_timeline_attachment(
|
spine_vertex_attachment_set_timeline_attachment(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self),
|
|
||||||
newValue?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public func copyTo(_ other: VertexAttachment) {
|
public func copyTo(_ other: VertexAttachment) {
|
||||||
spine_vertex_attachment_copy_to(
|
spine_vertex_attachment_copy_to(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self), other._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||||
_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self),
|
|
||||||
other._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func computeWorldVertices(
|
public func computeWorldVertices(_ skeleton: Skeleton, _ slot: Slot, _ start: Int, _ count: Int, _ worldVertices: ArrayFloat, _ offset: Int, _ stride: Int) {
|
||||||
_ skeleton: Skeleton, _ slot: Slot, _ start: Int, _ count: Int, _ worldVertices: ArrayFloat, _ offset: Int, _ stride: Int
|
spine_vertex_attachment_compute_world_vertices_2(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), slot._ptr.assumingMemoryBound(to: spine_slot_wrapper.self), start, count, worldVertices._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self), offset, stride)
|
||||||
) {
|
|
||||||
spine_vertex_attachment_compute_world_vertices_2(
|
|
||||||
_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
|
||||||
slot._ptr.assumingMemoryBound(to: spine_slot_wrapper.self), start, count,
|
|
||||||
worldVertices._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self), offset, stride)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -48,8 +48,9 @@ import Foundation
|
|||||||
backgroundColor: UIColor,
|
backgroundColor: UIColor,
|
||||||
scaleFactor: CGFloat = 1
|
scaleFactor: CGFloat = 1
|
||||||
) throws -> CGImage? {
|
) throws -> CGImage? {
|
||||||
|
let controller = SpineController(disposeDrawableOnDeInit: false) // Doesn't own the drawable
|
||||||
let spineView = SpineUIView(
|
let spineView = SpineUIView(
|
||||||
controller: SpineController(disposeDrawableOnDeInit: false), // Doesn't own the drawable
|
controller: controller,
|
||||||
boundsProvider: boundsProvider,
|
boundsProvider: boundsProvider,
|
||||||
backgroundColor: backgroundColor
|
backgroundColor: backgroundColor
|
||||||
)
|
)
|
||||||
@ -59,6 +60,12 @@ import Foundation
|
|||||||
spineView.framebufferOnly = false
|
spineView.framebufferOnly = false
|
||||||
spineView.contentScaleFactor = scaleFactor
|
spineView.contentScaleFactor = scaleFactor
|
||||||
|
|
||||||
|
defer {
|
||||||
|
controller.drawable = nil
|
||||||
|
spineView.delegate = nil
|
||||||
|
spineView.renderer = nil
|
||||||
|
}
|
||||||
|
|
||||||
try spineView.load(drawable: self)
|
try spineView.load(drawable: self)
|
||||||
spineView.renderer?.waitUntilCompleted = true
|
spineView.renderer?.waitUntilCompleted = true
|
||||||
|
|
||||||
|
|||||||
440
spine-ios/codegen/package-lock.json
generated
440
spine-ios/codegen/package-lock.json
generated
@ -25,6 +25,74 @@
|
|||||||
"typescript-formatter": "^7.2.2"
|
"typescript-formatter": "^7.2.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@esbuild/aix-ppc64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-urAvrUedIqEiFR3FYSLTWQgLu5tb+m0qZw0NBEasUeo6wuqatkMDaRT+1uABiGXEu5vqgPd7FGE1BhsAIy9QVA==",
|
||||||
|
"cpu": [
|
||||||
|
"ppc64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"aix"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/android-arm": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-RONsAvGCz5oWyePVnLdZY/HHwA++nxYWIX1atInlaW6SEkwq6XkP3+cb825EUcRs5Vss/lGh/2YxAb5xqc07Uw==",
|
||||||
|
"cpu": [
|
||||||
|
"arm"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"android"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/android-arm64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-OD3p7LYzWpLhZEyATcTSJ67qB5D+20vbtr6vHlHWSQYhKtzUYrETuWThmzFpZtFsBIxRvhO07+UgVA9m0i/O1w==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"android"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/android-x64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-yJAVPklM5+4+9dTeKwHOaA+LQkmrKFX96BM0A/2zQrbS6ENCmxc4OVoBs5dPkCCak2roAD+jKCdnmOqKszPkjA==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"android"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@esbuild/darwin-arm64": {
|
"node_modules/@esbuild/darwin-arm64": {
|
||||||
"version": "0.25.8",
|
"version": "0.25.8",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.8.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.8.tgz",
|
||||||
@ -42,6 +110,363 @@
|
|||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@esbuild/darwin-x64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-Vh2gLxxHnuoQ+GjPNvDSDRpoBCUzY4Pu0kBqMBDlK4fuWbKgGtmDIeEC081xi26PPjn+1tct+Bh8FjyLlw1Zlg==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/freebsd-arm64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-YPJ7hDQ9DnNe5vxOm6jaie9QsTwcKedPvizTVlqWG9GBSq+BuyWEDazlGaDTC5NGU4QJd666V0yqCBL2oWKPfA==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"freebsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/freebsd-x64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-MmaEXxQRdXNFsRN/KcIimLnSJrk2r5H8v+WVafRWz5xdSVmWLoITZQXcgehI2ZE6gioE6HirAEToM/RvFBeuhw==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"freebsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-arm": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-FuzEP9BixzZohl1kLf76KEVOsxtIBFwCaLupVuk4eFVnOZfU+Wsn+x5Ryam7nILV2pkq2TqQM9EZPsOBuMC+kg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-arm64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-WIgg00ARWv/uYLU7lsuDK00d/hHSfES5BzdWAdAig1ioV5kaFNrtK8EqGcUBJhYqotlUByUKz5Qo6u8tt7iD/w==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-ia32": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-A1D9YzRX1i+1AJZuFFUMP1E9fMaYY+GnSQil9Tlw05utlE86EKTUA7RjwHDkEitmLYiFsRd9HwKBPEftNdBfjg==",
|
||||||
|
"cpu": [
|
||||||
|
"ia32"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-loong64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-O7k1J/dwHkY1RMVvglFHl1HzutGEFFZ3kNiDMSOyUrB7WcoHGf96Sh+64nTRT26l3GMbCW01Ekh/ThKM5iI7hQ==",
|
||||||
|
"cpu": [
|
||||||
|
"loong64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-mips64el": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-uv+dqfRazte3BzfMp8PAQXmdGHQt2oC/y2ovwpTteqrMx2lwaksiFZ/bdkXJC19ttTvNXBuWH53zy/aTj1FgGw==",
|
||||||
|
"cpu": [
|
||||||
|
"mips64el"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-ppc64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-GyG0KcMi1GBavP5JgAkkstMGyMholMDybAf8wF5A70CALlDM2p/f7YFE7H92eDeH/VBtFJA5MT4nRPDGg4JuzQ==",
|
||||||
|
"cpu": [
|
||||||
|
"ppc64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-riscv64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-rAqDYFv3yzMrq7GIcen3XP7TUEG/4LK86LUPMIz6RT8A6pRIDn0sDcvjudVZBiiTcZCY9y2SgYX2lgK3AF+1eg==",
|
||||||
|
"cpu": [
|
||||||
|
"riscv64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-s390x": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-Xutvh6VjlbcHpsIIbwY8GVRbwoviWT19tFhgdA7DlenLGC/mbc3lBoVb7jxj9Z+eyGqvcnSyIltYUrkKzWqSvg==",
|
||||||
|
"cpu": [
|
||||||
|
"s390x"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/linux-x64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-ASFQhgY4ElXh3nDcOMTkQero4b1lgubskNlhIfJrsH5OKZXDpUAKBlNS0Kx81jwOBp+HCeZqmoJuihTv57/jvQ==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/netbsd-arm64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-d1KfruIeohqAi6SA+gENMuObDbEjn22olAR7egqnkCD9DGBG0wsEARotkLgXDu6c4ncgWTZJtN5vcgxzWRMzcw==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"netbsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/netbsd-x64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-nVDCkrvx2ua+XQNyfrujIG38+YGyuy2Ru9kKVNyh5jAys6n+l44tTtToqHjino2My8VAY6Lw9H7RI73XFi66Cg==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"netbsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/openbsd-arm64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-j8HgrDuSJFAujkivSMSfPQSAa5Fxbvk4rgNAS5i3K+r8s1X0p1uOO2Hl2xNsGFppOeHOLAVgYwDVlmxhq5h+SQ==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"openbsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/openbsd-x64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-1h8MUAwa0VhNCDp6Af0HToI2TJFAn1uqT9Al6DJVzdIBAd21m/G0Yfc77KDM3uF3T/YaOgQq3qTJHPbTOInaIQ==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"openbsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/openharmony-arm64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-r2nVa5SIK9tSWd0kJd9HCffnDHKchTGikb//9c7HX+r+wHYCpQrSgxhlY6KWV1nFo1l4KFbsMlHk+L6fekLsUg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"openharmony"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/sunos-x64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-zUlaP2S12YhQ2UzUfcCuMDHQFJyKABkAjvO5YSndMiIkMimPmxA+BYSBikWgsRpvyxuRnow4nS5NPnf9fpv41w==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"sunos"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/win32-arm64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-YEGFFWESlPva8hGL+zvj2z/SaK+pH0SwOM0Nc/d+rVnW7GSTFlLBGzZkuSU9kFIGIo8q9X3ucpZhu8PDN5A2sQ==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/win32-ia32": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-hiGgGC6KZ5LZz58OL/+qVVoZiuZlUYlYHNAmczOm7bs2oE1XriPFi5ZHHrS8ACpV5EjySrnoCKmcbQMN+ojnHg==",
|
||||||
|
"cpu": [
|
||||||
|
"ia32"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@esbuild/win32-x64": {
|
||||||
|
"version": "0.25.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.8.tgz",
|
||||||
|
"integrity": "sha512-cn3Yr7+OaaZq1c+2pe+8yxC8E144SReCQjN6/2ynubzYjvyqZjTXfQJpAcQpsdJq3My7XADANiYGHoFC69pLQw==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.19.9",
|
"version": "20.19.9",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.9.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.9.tgz",
|
||||||
@ -94,6 +519,21 @@
|
|||||||
"@esbuild/win32-x64": "0.25.8"
|
"@esbuild/win32-x64": "0.25.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/fsevents": {
|
||||||
|
"version": "2.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||||
|
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||||
|
"dev": true,
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/get-tsconfig": {
|
"node_modules/get-tsconfig": {
|
||||||
"version": "4.10.1",
|
"version": "4.10.1",
|
||||||
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.1.tgz",
|
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.1.tgz",
|
||||||
|
|||||||
@ -4,8 +4,8 @@ import SpineC
|
|||||||
func runSkeletonDrawableTest() {
|
func runSkeletonDrawableTest() {
|
||||||
print("Testing SkeletonDrawable and event listeners...")
|
print("Testing SkeletonDrawable and event listeners...")
|
||||||
|
|
||||||
// Enable debug extension if needed
|
// Enable debug extension for leak detection
|
||||||
spine_enable_debug_extension(false)
|
spine_enable_debug_extension(true)
|
||||||
|
|
||||||
// Load atlas and skeleton data
|
// Load atlas and skeleton data
|
||||||
let atlasPath = "../../spine-ts/assets/spineboy.atlas"
|
let atlasPath = "../../spine-ts/assets/spineboy.atlas"
|
||||||
|
|||||||
@ -5,130 +5,132 @@ func runSkeletonDrawableTestSwift() {
|
|||||||
print("Testing SkeletonDrawable with SpineSwift API...")
|
print("Testing SkeletonDrawable with SpineSwift API...")
|
||||||
|
|
||||||
print("Step 1: Enable debug extension")
|
print("Step 1: Enable debug extension")
|
||||||
// Enable debug extension if needed
|
// Enable debug extension for leak detection
|
||||||
enableDebugExtension(false)
|
enableDebugExtension(true)
|
||||||
print(" Debug extension configured")
|
print(" Debug extension configured")
|
||||||
|
|
||||||
print("Step 2: Load file paths")
|
|
||||||
// Load atlas and skeleton data
|
|
||||||
let atlasPath = "../../spine-ts/assets/spineboy.atlas"
|
|
||||||
let jsonPath = "../../spine-ts/assets/spineboy-pro.json"
|
|
||||||
|
|
||||||
print("Step 3: Read atlas file")
|
|
||||||
// Read atlas file
|
|
||||||
guard let atlasData = try? String(contentsOfFile: atlasPath, encoding: .utf8) else {
|
|
||||||
print("❌ Failed to read atlas file: \(atlasPath)")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
print(" Atlas file read successfully")
|
|
||||||
|
|
||||||
print("Step 4: Load atlas with SpineSwift API")
|
|
||||||
// Load atlas
|
|
||||||
let atlas: Atlas
|
|
||||||
do {
|
do {
|
||||||
atlas = try loadAtlas(atlasData)
|
print("Step 2: Load file paths")
|
||||||
print("✓ Atlas loaded successfully")
|
// Load atlas and skeleton data
|
||||||
} catch {
|
let atlasPath = "../../spine-ts/assets/spineboy.atlas"
|
||||||
print("❌ Failed to load atlas: \(error)")
|
let jsonPath = "../../spine-ts/assets/spineboy-pro.json"
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read skeleton JSON
|
print("Step 3: Read atlas file")
|
||||||
guard let skeletonJson = try? String(contentsOfFile: jsonPath, encoding: .utf8) else {
|
// Read atlas file
|
||||||
print("❌ Failed to read skeleton JSON file: \(jsonPath)")
|
guard let atlasData = try? String(contentsOfFile: atlasPath, encoding: .utf8) else {
|
||||||
// atlas will be freed when out of scope
|
print("❌ Failed to read atlas file: \(atlasPath)")
|
||||||
return
|
return
|
||||||
}
|
|
||||||
|
|
||||||
// Load skeleton data
|
|
||||||
let skeletonData: SkeletonData
|
|
||||||
do {
|
|
||||||
skeletonData = try loadSkeletonDataJson(atlas: atlas, jsonData: skeletonJson, path: jsonPath)
|
|
||||||
print("✓ Skeleton data loaded successfully")
|
|
||||||
} catch {
|
|
||||||
print("❌ Failed to load skeleton data: \(error)")
|
|
||||||
// atlas will be freed when out of scope
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create skeleton drawable
|
|
||||||
let drawable = SkeletonDrawable(skeletonData: skeletonData)
|
|
||||||
print("✓ SkeletonDrawable created successfully")
|
|
||||||
|
|
||||||
// Test skeleton bounds
|
|
||||||
print("\nTesting skeleton bounds:")
|
|
||||||
let initialBounds = drawable.skeleton.bounds
|
|
||||||
print(" Initial bounds: x=\(initialBounds.x), y=\(initialBounds.y), width=\(initialBounds.width), height=\(initialBounds.height)")
|
|
||||||
|
|
||||||
// Set skeleton to pose and update bounds
|
|
||||||
drawable.skeleton.setupPose()
|
|
||||||
drawable.skeleton.updateWorldTransform(Physics.none)
|
|
||||||
|
|
||||||
let boundsAfterPose = drawable.skeleton.bounds
|
|
||||||
print(
|
|
||||||
" Bounds after setupPose: x=\(boundsAfterPose.x), y=\(boundsAfterPose.y), width=\(boundsAfterPose.width), height=\(boundsAfterPose.height)")
|
|
||||||
|
|
||||||
// Test position
|
|
||||||
let position = drawable.skeleton.getPosition()
|
|
||||||
print(" Skeleton position: x=\(position.x), y=\(position.y)")
|
|
||||||
|
|
||||||
// Set up animation state listener
|
|
||||||
var eventCount = 0
|
|
||||||
drawable.animationState.setListener { type, trackEntry, event in
|
|
||||||
eventCount += 1
|
|
||||||
print(" AnimationState event #\(eventCount): type=\(type), track=\(trackEntry.trackIndex)")
|
|
||||||
if let event = event {
|
|
||||||
print(" Event name: \(event.data.name)")
|
|
||||||
}
|
}
|
||||||
}
|
print(" Atlas file read successfully")
|
||||||
|
|
||||||
// Set an animation
|
print("Step 4: Load atlas with SpineSwift API")
|
||||||
let trackEntry = drawable.animationState.setAnimation(0, "walk", true)
|
// Load atlas
|
||||||
print("✓ Set animation: walk")
|
let atlas: Atlas
|
||||||
|
do {
|
||||||
// Set track entry listener
|
atlas = try loadAtlas(atlasData)
|
||||||
trackEntry.setListener { type, entry, event in
|
print("✓ Atlas loaded successfully")
|
||||||
print(" TrackEntry event: type=\(type)")
|
} catch {
|
||||||
if let event = event {
|
print("❌ Failed to load atlas: \(error)")
|
||||||
print(" Event data: \(event.data.name)")
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Update several times to trigger events
|
// Read skeleton JSON
|
||||||
print("\nUpdating animation state...")
|
guard let skeletonJson = try? String(contentsOfFile: jsonPath, encoding: .utf8) else {
|
||||||
for i in 0..<5 {
|
print("❌ Failed to read skeleton JSON file: \(jsonPath)")
|
||||||
drawable.update(0.016) // ~60fps
|
// atlas will be freed when out of scope
|
||||||
print(" Frame \(i): updated")
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test switching animations
|
// Load skeleton data
|
||||||
print("\nSwitching to run animation...")
|
let skeletonData: SkeletonData
|
||||||
_ = drawable.animationState.setAnimation(0, "run", true)
|
do {
|
||||||
|
skeletonData = try loadSkeletonDataJson(atlas: atlas, jsonData: skeletonJson, path: jsonPath)
|
||||||
|
print("✓ Skeleton data loaded successfully")
|
||||||
|
} catch {
|
||||||
|
print("❌ Failed to load skeleton data: \(error)")
|
||||||
|
// atlas will be freed when out of scope
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// Update a few more times
|
do {
|
||||||
for i in 0..<3 {
|
// Create skeleton drawable
|
||||||
drawable.update(0.016)
|
let drawable = SkeletonDrawable(skeletonData: skeletonData)
|
||||||
print(" Frame \(i): updated after switching")
|
print("✓ SkeletonDrawable created successfully")
|
||||||
}
|
|
||||||
|
|
||||||
// Test bounds after animation updates
|
// Test skeleton bounds
|
||||||
print("\nTesting bounds after animation:")
|
print("\nTesting skeleton bounds:")
|
||||||
drawable.skeleton.updateWorldTransform(Physics.none)
|
let initialBounds = drawable.skeleton.bounds
|
||||||
let boundsAfterAnimation = drawable.skeleton.bounds
|
print(" Initial bounds: x=\(initialBounds.x), y=\(initialBounds.y), width=\(initialBounds.width), height=\(initialBounds.height)")
|
||||||
print(
|
|
||||||
" Bounds after animation: x=\(boundsAfterAnimation.x), y=\(boundsAfterAnimation.y), width=\(boundsAfterAnimation.width), height=\(boundsAfterAnimation.height)"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Test with different animations that might have different bounds
|
// Set skeleton to pose and update bounds
|
||||||
print("\nTesting bounds with jump animation:")
|
drawable.skeleton.setupPose()
|
||||||
_ = drawable.animationState.setAnimation(0, "jump", false)
|
drawable.skeleton.updateWorldTransform(Physics.none)
|
||||||
drawable.update(0.5) // Update to middle of jump
|
|
||||||
|
|
||||||
let boundsAfterJump = drawable.skeleton.bounds
|
let boundsAfterPose = drawable.skeleton.bounds
|
||||||
print(" Bounds during jump: x=\(boundsAfterJump.x), y=\(boundsAfterJump.y), width=\(boundsAfterJump.width), height=\(boundsAfterJump.height)")
|
print(
|
||||||
|
" Bounds after setupPose: x=\(boundsAfterPose.x), y=\(boundsAfterPose.y), width=\(boundsAfterPose.width), height=\(boundsAfterPose.height)")
|
||||||
|
|
||||||
// Test skin entries
|
// Test position
|
||||||
print("\nTesting skin entries:")
|
let position = drawable.skeleton.getPosition()
|
||||||
|
print(" Skeleton position: x=\(position.x), y=\(position.y)")
|
||||||
|
|
||||||
|
// Set up animation state listener
|
||||||
|
var eventCount = 0
|
||||||
|
drawable.animationState.setListener { type, trackEntry, event in
|
||||||
|
eventCount += 1
|
||||||
|
print(" AnimationState event #\(eventCount): type=\(type), track=\(trackEntry.trackIndex)")
|
||||||
|
if let event = event {
|
||||||
|
print(" Event name: \(event.data.name)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set an animation
|
||||||
|
let trackEntry = drawable.animationState.setAnimation(0, "walk", true)
|
||||||
|
print("✓ Set animation: walk")
|
||||||
|
|
||||||
|
// Set track entry listener
|
||||||
|
trackEntry.setListener { type, entry, event in
|
||||||
|
print(" TrackEntry event: type=\(type)")
|
||||||
|
if let event = event {
|
||||||
|
print(" Event data: \(event.data.name)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update several times to trigger events
|
||||||
|
print("\nUpdating animation state...")
|
||||||
|
for i in 0..<5 {
|
||||||
|
drawable.update(0.016) // ~60fps
|
||||||
|
print(" Frame \(i): updated")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test switching animations
|
||||||
|
print("\nSwitching to run animation...")
|
||||||
|
_ = drawable.animationState.setAnimation(0, "run", true)
|
||||||
|
|
||||||
|
// Update a few more times
|
||||||
|
for i in 0..<3 {
|
||||||
|
drawable.update(0.016)
|
||||||
|
print(" Frame \(i): updated after switching")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Test bounds after animation updates
|
||||||
|
print("\nTesting bounds after animation:")
|
||||||
|
drawable.skeleton.updateWorldTransform(Physics.none)
|
||||||
|
let boundsAfterAnimation = drawable.skeleton.bounds
|
||||||
|
print(
|
||||||
|
" Bounds after animation: x=\(boundsAfterAnimation.x), y=\(boundsAfterAnimation.y), width=\(boundsAfterAnimation.width), height=\(boundsAfterAnimation.height)"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Test with different animations that might have different bounds
|
||||||
|
print("\nTesting bounds with jump animation:")
|
||||||
|
_ = drawable.animationState.setAnimation(0, "jump", false)
|
||||||
|
drawable.update(0.5) // Update to middle of jump
|
||||||
|
|
||||||
|
let boundsAfterJump = drawable.skeleton.bounds
|
||||||
|
print(" Bounds during jump: x=\(boundsAfterJump.x), y=\(boundsAfterJump.y), width=\(boundsAfterJump.width), height=\(boundsAfterJump.height)")
|
||||||
|
|
||||||
|
// Test skin entries
|
||||||
|
print("\nTesting skin entries:")
|
||||||
|
|
||||||
// First, check available skins
|
// First, check available skins
|
||||||
let skins = skeletonData.skins
|
let skins = skeletonData.skins
|
||||||
@ -303,16 +305,18 @@ func runSkeletonDrawableTestSwift() {
|
|||||||
print(" Could not find bone 'rear-shin'")
|
print(" Could not find bone 'rear-shin'")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear listener before cleanup
|
// Clear listener before cleanup
|
||||||
// drawable.animationState.setListener(nil)
|
// drawable.animationState.setListener(nil)
|
||||||
|
}
|
||||||
|
|
||||||
// Cleanup happens automatically via deinit
|
skeletonData.dispose()
|
||||||
// skeletonData and atlas will be freed when out of scope
|
atlas.dispose()
|
||||||
|
|
||||||
// Report memory leaks if debug extension is enabled
|
print("\n✓ SpineSwift API test complete")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Report memory leaks after Swift objects have gone out of scope
|
||||||
reportLeaks()
|
reportLeaks()
|
||||||
|
|
||||||
print("\n✓ SpineSwift API test complete")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test function is called from main.swift
|
// Test function is called from main.swift
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user