mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Formatting
This commit is contained in:
parent
7d7d43843c
commit
3d5a66b5f8
@ -26,7 +26,7 @@ let package = Package(
|
||||
.library(
|
||||
name: "SpineiOS",
|
||||
targets: ["SpineiOS"]
|
||||
)
|
||||
),
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
@ -43,7 +43,7 @@ let package = Package(
|
||||
sources: [
|
||||
"spine-c/src/extensions.cpp",
|
||||
"spine-c/src/generated",
|
||||
"spine-cpp/src/spine"
|
||||
"spine-cpp/src/spine",
|
||||
],
|
||||
publicHeadersPath: "spine-c/include",
|
||||
cxxSettings: [
|
||||
@ -63,7 +63,7 @@ let package = Package(
|
||||
path: "spine-ios/Sources/SpineSwift",
|
||||
sources: [
|
||||
"Generated",
|
||||
"Extensions"
|
||||
"Extensions",
|
||||
]
|
||||
),
|
||||
.systemLibrary(
|
||||
|
||||
@ -5,6 +5,5 @@
|
||||
import FlutterMacOS
|
||||
import Foundation
|
||||
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
}
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
import SpineiOS
|
||||
import SpineSwift
|
||||
import SpineiOS
|
||||
import SwiftUI
|
||||
|
||||
struct AnimationStateEvents: View {
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
import SpineiOS
|
||||
import SpineSwift
|
||||
import SpineiOS
|
||||
import SwiftUI
|
||||
|
||||
struct DressUp: View {
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
import SpineiOS
|
||||
import SpineSwift
|
||||
import SpineiOS
|
||||
import SwiftUI
|
||||
|
||||
// View modifier to report memory leaks when view disappears
|
||||
|
||||
@ -27,8 +27,8 @@
|
||||
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
import SpineiOS
|
||||
import SpineSwift
|
||||
import SpineiOS
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
|
||||
@ -36,7 +36,8 @@ extension BonePose {
|
||||
/// Transform world coordinates to local coordinates
|
||||
public func worldToLocal(worldX: Float, worldY: Float) -> Vector {
|
||||
let output = ArrayFloat()
|
||||
spine_bone_pose_world_to_local_v(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self),
|
||||
spine_bone_pose_world_to_local_v(
|
||||
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self),
|
||||
worldX, worldY,
|
||||
output._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
let vector = Vector(x: output[0], y: output[1])
|
||||
@ -46,7 +47,8 @@ extension BonePose {
|
||||
/// Transform local coordinates to world coordinates
|
||||
public func localToWorld(localX: Float, localY: Float) -> Vector {
|
||||
let output = ArrayFloat()
|
||||
spine_bone_pose_local_to_world_v(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self),
|
||||
spine_bone_pose_local_to_world_v(
|
||||
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self),
|
||||
localX, localY,
|
||||
output._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
let vector = Vector(x: output[0], y: output[1])
|
||||
@ -56,7 +58,8 @@ extension BonePose {
|
||||
/// Transform world coordinates to parent coordinates
|
||||
public func worldToParent(worldX: Float, worldY: Float) -> Vector {
|
||||
let output = ArrayFloat()
|
||||
spine_bone_pose_world_to_parent_v(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self),
|
||||
spine_bone_pose_world_to_parent_v(
|
||||
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self),
|
||||
worldX, worldY,
|
||||
output._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
let vector = Vector(x: output[0], y: output[1])
|
||||
@ -66,7 +69,8 @@ extension BonePose {
|
||||
/// Transform parent coordinates to world coordinates
|
||||
public func parentToWorld(parentX: Float, parentY: Float) -> Vector {
|
||||
let output = ArrayFloat()
|
||||
spine_bone_pose_parent_to_world_v(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self),
|
||||
spine_bone_pose_parent_to_world_v(
|
||||
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self),
|
||||
parentX, parentY,
|
||||
output._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
let vector = Vector(x: output[0], y: output[1])
|
||||
|
||||
@ -36,7 +36,8 @@ extension Skeleton {
|
||||
/// Get the axis-aligned bounding box (AABB) containing all world vertices of the skeleton
|
||||
public var bounds: Bounds {
|
||||
let output = ArrayFloat()
|
||||
spine_skeleton_get_bounds(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
||||
spine_skeleton_get_bounds(
|
||||
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
||||
output._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
let bounds = Bounds(
|
||||
x: output[0],
|
||||
@ -50,7 +51,8 @@ extension Skeleton {
|
||||
/// Get the position of the skeleton
|
||||
public func getPosition() -> Vector {
|
||||
let output = ArrayFloat()
|
||||
spine_skeleton_get_position_v(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
||||
spine_skeleton_get_position_v(
|
||||
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
||||
output._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
let position = Vector(x: output[0], y: output[1])
|
||||
return position
|
||||
|
||||
@ -71,24 +71,31 @@ extension Skin {
|
||||
|
||||
switch className {
|
||||
case "RegionAttachment":
|
||||
attachment = RegionAttachment(fromPointer: UnsafeMutableRawPointer(attachmentPtr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
attachment = RegionAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(attachmentPtr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
case "MeshAttachment":
|
||||
attachment = MeshAttachment(fromPointer: UnsafeMutableRawPointer(attachmentPtr).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
attachment = MeshAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(attachmentPtr).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
case "BoundingBoxAttachment":
|
||||
attachment = BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(attachmentPtr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
attachment = BoundingBoxAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(attachmentPtr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "ClippingAttachment":
|
||||
attachment = ClippingAttachment(fromPointer: UnsafeMutableRawPointer(attachmentPtr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
attachment = ClippingAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(attachmentPtr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "PathAttachment":
|
||||
attachment = PathAttachment(fromPointer: UnsafeMutableRawPointer(attachmentPtr).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||
attachment = PathAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(attachmentPtr).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||
case "PointAttachment":
|
||||
attachment = PointAttachment(fromPointer: UnsafeMutableRawPointer(attachmentPtr).assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
||||
attachment = PointAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(attachmentPtr).assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
||||
default:
|
||||
// Unknown attachment type, treat as generic Attachment
|
||||
attachment = nil
|
||||
}
|
||||
}
|
||||
|
||||
entries.append(SkinEntry(
|
||||
entries.append(
|
||||
SkinEntry(
|
||||
slotIndex: slotIndex,
|
||||
name: name,
|
||||
attachment: attachment
|
||||
|
||||
@ -54,7 +54,8 @@ public class Animation: NSObject {
|
||||
return ArrayTimeline(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_animation_set_timelines(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_timeline_wrapper.self))
|
||||
spine_animation_set_timelines(
|
||||
_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_timeline_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -79,12 +80,19 @@ public class Animation: NSObject {
|
||||
}
|
||||
|
||||
public func hasTimeline(_ ids: ArrayPropertyId) -> Bool {
|
||||
let result = spine_animation_has_timeline(_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), ids._ptr.assumingMemoryBound(to: spine_array_property_id_wrapper.self))
|
||||
let result = spine_animation_has_timeline(
|
||||
_ptr.assumingMemoryBound(to: spine_animation_wrapper.self), ids._ptr.assumingMemoryBound(to: spine_array_property_id_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public func apply(_ skeleton: Skeleton, _ lastTime: Float, _ time: Float, _ loop: Bool, _ events: ArrayEvent?, _ alpha: Float, _ blend: MixBlend, _ 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)
|
||||
public func apply(
|
||||
_ skeleton: Skeleton, _ lastTime: Float, _ time: Float, _ loop: Bool, _ events: ArrayEvent?, _ alpha: Float, _ blend: MixBlend,
|
||||
_ 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)
|
||||
}
|
||||
|
||||
public static func search(_ values: ArrayFloat, _ target: Float) -> Int32 {
|
||||
|
||||
@ -381,7 +381,8 @@ public class ArrayAnimation: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: Animation?) {
|
||||
spine_array_animation_add(_ptr.assumingMemoryBound(to: spine_array_animation_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
||||
spine_array_animation_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_animation_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -459,7 +460,8 @@ public class ArrayAtlasPage: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: AtlasPage?) {
|
||||
spine_array_atlas_page_add(_ptr.assumingMemoryBound(to: spine_array_atlas_page_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||
spine_array_atlas_page_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_atlas_page_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -537,7 +539,8 @@ public class ArrayAtlasRegion: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: AtlasRegion?) {
|
||||
spine_array_atlas_region_add(_ptr.assumingMemoryBound(to: spine_array_atlas_region_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||
spine_array_atlas_region_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_atlas_region_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -614,7 +617,8 @@ public class ArrayAttachment: NSObject {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
return BoundingBoxAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
@ -633,7 +637,8 @@ public class ArrayAttachment: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: Attachment?) {
|
||||
spine_array_attachment_add(_ptr.assumingMemoryBound(to: spine_array_attachment_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||
spine_array_attachment_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_attachment_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -711,7 +716,8 @@ public class ArrayBone: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: Bone?) {
|
||||
spine_array_bone_add(_ptr.assumingMemoryBound(to: spine_array_bone_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
spine_array_bone_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_bone_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -789,7 +795,8 @@ public class ArrayBoneData: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: BoneData?) {
|
||||
spine_array_bone_data_add(_ptr.assumingMemoryBound(to: spine_array_bone_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||
spine_array_bone_data_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_bone_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -867,7 +874,8 @@ public class ArrayBonePose: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: BonePose?) {
|
||||
spine_array_bone_pose_add(_ptr.assumingMemoryBound(to: spine_array_bone_pose_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||
spine_array_bone_pose_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_bone_pose_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -945,7 +953,9 @@ public class ArrayBoundingBoxAttachment: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: BoundingBoxAttachment?) {
|
||||
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))
|
||||
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))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -966,7 +976,8 @@ public class ArrayBoundingBoxAttachment: NSObject {
|
||||
public var length: Int {
|
||||
get { count }
|
||||
set {
|
||||
spine_array_bounding_box_attachment_set_size(_ptr.assumingMemoryBound(to: spine_array_bounding_box_attachment_wrapper.self), newValue, nil)
|
||||
spine_array_bounding_box_attachment_set_size(
|
||||
_ptr.assumingMemoryBound(to: spine_array_bounding_box_attachment_wrapper.self), newValue, nil)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1039,7 +1050,8 @@ public class ArrayConstraint: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: Constraint?) {
|
||||
spine_array_constraint_add(_ptr.assumingMemoryBound(to: spine_array_constraint_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_constraint_wrapper.self))
|
||||
spine_array_constraint_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_constraint_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_constraint_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -1120,11 +1132,13 @@ public class ArrayConstraintData: NSObject {
|
||||
case "spine_path_constraint_data":
|
||||
return PathConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
|
||||
case "spine_physics_constraint_data":
|
||||
return PhysicsConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||
return PhysicsConstraintData(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||
case "spine_slider_data":
|
||||
return SliderData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
||||
case "spine_transform_constraint_data":
|
||||
return TransformConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||
return TransformConstraintData(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class ConstraintData")
|
||||
}
|
||||
@ -1133,7 +1147,9 @@ public class ArrayConstraintData: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: ConstraintData?) {
|
||||
spine_array_constraint_data_add(_ptr.assumingMemoryBound(to: spine_array_constraint_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_constraint_data_wrapper.self))
|
||||
spine_array_constraint_data_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_constraint_data_wrapper.self),
|
||||
value?._ptr.assumingMemoryBound(to: spine_constraint_data_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -1211,7 +1227,8 @@ public class ArrayEvent: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: Event?) {
|
||||
spine_array_event_add(_ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||
spine_array_event_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_event_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -1289,7 +1306,8 @@ public class ArrayEventData: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: EventData?) {
|
||||
spine_array_event_data_add(_ptr.assumingMemoryBound(to: spine_array_event_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
||||
spine_array_event_data_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_event_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_event_data_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -1385,7 +1403,9 @@ public class ArrayFromProperty: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: FromProperty?) {
|
||||
spine_array_from_property_add(_ptr.assumingMemoryBound(to: spine_array_from_property_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
|
||||
spine_array_from_property_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_from_property_wrapper.self),
|
||||
value?._ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -1463,7 +1483,9 @@ public class ArrayPhysicsConstraint: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: PhysicsConstraint?) {
|
||||
spine_array_physics_constraint_add(_ptr.assumingMemoryBound(to: spine_array_physics_constraint_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
spine_array_physics_constraint_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_physics_constraint_wrapper.self),
|
||||
value?._ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -1541,7 +1563,8 @@ public class ArrayPolygon: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: Polygon?) {
|
||||
spine_array_polygon_add(_ptr.assumingMemoryBound(to: spine_array_polygon_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
|
||||
spine_array_polygon_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_polygon_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -1619,7 +1642,8 @@ public class ArraySkin: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: Skin?) {
|
||||
spine_array_skin_add(_ptr.assumingMemoryBound(to: spine_array_skin_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
|
||||
spine_array_skin_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_skin_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -1697,7 +1721,8 @@ public class ArraySlot: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: Slot?) {
|
||||
spine_array_slot_add(_ptr.assumingMemoryBound(to: spine_array_slot_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
|
||||
spine_array_slot_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_slot_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -1775,7 +1800,8 @@ public class ArraySlotData: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: SlotData?) {
|
||||
spine_array_slot_data_add(_ptr.assumingMemoryBound(to: spine_array_slot_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
||||
spine_array_slot_data_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_slot_data_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -1853,7 +1879,9 @@ public class ArrayTextureRegion: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: TextureRegion?) {
|
||||
spine_array_texture_region_add(_ptr.assumingMemoryBound(to: spine_array_texture_region_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
||||
spine_array_texture_region_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_texture_region_wrapper.self),
|
||||
value?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -1940,31 +1968,43 @@ public class ArrayTimeline: NSObject {
|
||||
case "spine_event_timeline":
|
||||
return EventTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_event_timeline_wrapper.self))
|
||||
case "spine_ik_constraint_timeline":
|
||||
return IkConstraintTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self))
|
||||
return IkConstraintTimeline(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self))
|
||||
case "spine_inherit_timeline":
|
||||
return InheritTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_inherit_timeline_wrapper.self))
|
||||
case "spine_path_constraint_mix_timeline":
|
||||
return PathConstraintMixTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self))
|
||||
return PathConstraintMixTimeline(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self))
|
||||
case "spine_path_constraint_position_timeline":
|
||||
return PathConstraintPositionTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_position_timeline_wrapper.self))
|
||||
return PathConstraintPositionTimeline(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_position_timeline_wrapper.self))
|
||||
case "spine_path_constraint_spacing_timeline":
|
||||
return PathConstraintSpacingTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_spacing_timeline_wrapper.self))
|
||||
return PathConstraintSpacingTimeline(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_spacing_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_damping_timeline":
|
||||
return PhysicsConstraintDampingTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_damping_timeline_wrapper.self))
|
||||
return PhysicsConstraintDampingTimeline(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_damping_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_gravity_timeline":
|
||||
return PhysicsConstraintGravityTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_gravity_timeline_wrapper.self))
|
||||
return PhysicsConstraintGravityTimeline(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_gravity_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_inertia_timeline":
|
||||
return PhysicsConstraintInertiaTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_inertia_timeline_wrapper.self))
|
||||
return PhysicsConstraintInertiaTimeline(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_inertia_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_mass_timeline":
|
||||
return PhysicsConstraintMassTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_mass_timeline_wrapper.self))
|
||||
return PhysicsConstraintMassTimeline(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_mass_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_mix_timeline":
|
||||
return PhysicsConstraintMixTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_mix_timeline_wrapper.self))
|
||||
return PhysicsConstraintMixTimeline(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_mix_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_reset_timeline":
|
||||
return PhysicsConstraintResetTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self))
|
||||
return PhysicsConstraintResetTimeline(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_strength_timeline":
|
||||
return PhysicsConstraintStrengthTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_strength_timeline_wrapper.self))
|
||||
return PhysicsConstraintStrengthTimeline(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_strength_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_wind_timeline":
|
||||
return PhysicsConstraintWindTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_wind_timeline_wrapper.self))
|
||||
return PhysicsConstraintWindTimeline(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_wind_timeline_wrapper.self))
|
||||
case "spine_rgb2_timeline":
|
||||
return Rgb2Timeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rgb2_timeline_wrapper.self))
|
||||
case "spine_rgba2_timeline":
|
||||
@ -1994,7 +2034,8 @@ public class ArrayTimeline: NSObject {
|
||||
case "spine_slider_timeline":
|
||||
return SliderTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_timeline_wrapper.self))
|
||||
case "spine_transform_constraint_timeline":
|
||||
return TransformConstraintTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self))
|
||||
return TransformConstraintTimeline(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self))
|
||||
case "spine_translate_timeline":
|
||||
return TranslateTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_translate_timeline_wrapper.self))
|
||||
case "spine_translate_x_timeline":
|
||||
@ -2009,7 +2050,8 @@ public class ArrayTimeline: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: Timeline?) {
|
||||
spine_array_timeline_add(_ptr.assumingMemoryBound(to: spine_array_timeline_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_timeline_wrapper.self))
|
||||
spine_array_timeline_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_timeline_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_timeline_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -2105,7 +2147,8 @@ public class ArrayToProperty: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: ToProperty?) {
|
||||
spine_array_to_property_add(_ptr.assumingMemoryBound(to: spine_array_to_property_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_to_property_wrapper.self))
|
||||
spine_array_to_property_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_to_property_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_to_property_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -2183,7 +2226,8 @@ public class ArrayTrackEntry: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: TrackEntry?) {
|
||||
spine_array_track_entry_add(_ptr.assumingMemoryBound(to: spine_array_track_entry_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||
spine_array_track_entry_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_track_entry_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
@ -2281,7 +2325,8 @@ public class ArrayUpdate: NSObject {
|
||||
|
||||
/// Adds a value to the end of this array
|
||||
public func add(_ value: Update?) {
|
||||
spine_array_update_add(_ptr.assumingMemoryBound(to: spine_array_update_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_update_wrapper.self))
|
||||
spine_array_update_add(
|
||||
_ptr.assumingMemoryBound(to: spine_array_update_wrapper.self), value?._ptr.assumingMemoryBound(to: spine_update_wrapper.self))
|
||||
}
|
||||
|
||||
/// Removes all elements from this array
|
||||
|
||||
@ -64,7 +64,8 @@ open class Attachment: NSObject {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
return BoundingBoxAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
|
||||
@ -42,12 +42,14 @@ public class Bone: PosedActive, Posed, Update {
|
||||
}
|
||||
|
||||
public convenience init(_ data: BoneData, _ parent: Bone?) {
|
||||
let ptr = spine_bone_create(data._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), parent?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
let ptr = spine_bone_create(
|
||||
data._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self), parent?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
public static func from(_ bone: Bone, _ parent: Bone?) -> Bone {
|
||||
let ptr = spine_bone_create2(bone._ptr.assumingMemoryBound(to: spine_bone_wrapper.self), parent?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
let ptr = spine_bone_create2(
|
||||
bone._ptr.assumingMemoryBound(to: spine_bone_wrapper.self), parent?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
return Bone(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -96,7 +98,9 @@ public class Bone: PosedActive, Posed, Update {
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_bone_update(_ptr.assumingMemoryBound(to: spine_bone_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
spine_bone_update(
|
||||
_ptr.assumingMemoryBound(to: spine_bone_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
||||
spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
|
||||
@ -122,7 +122,8 @@ public class Color: NSObject {
|
||||
}
|
||||
|
||||
public func set3(_ other: Color) -> Color {
|
||||
let result = spine_color_set_3(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), other._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
||||
let result = spine_color_set_3(
|
||||
_ptr.assumingMemoryBound(to: spine_color_wrapper.self), other._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
||||
return Color(fromPointer: result!)
|
||||
}
|
||||
|
||||
@ -137,7 +138,8 @@ public class Color: NSObject {
|
||||
}
|
||||
|
||||
public func add3(_ other: Color) -> Color {
|
||||
let result = spine_color_add_3(_ptr.assumingMemoryBound(to: spine_color_wrapper.self), other._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
||||
let result = spine_color_add_3(
|
||||
_ptr.assumingMemoryBound(to: spine_color_wrapper.self), other._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
||||
return Color(fromPointer: result!)
|
||||
}
|
||||
|
||||
|
||||
@ -54,7 +54,8 @@ public class Polygon: NSObject {
|
||||
return ArrayFloat(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_polygon_set__vertices(_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
spine_polygon_set__vertices(
|
||||
_ptr.assumingMemoryBound(to: spine_polygon_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -49,12 +49,14 @@ public class Rtti: NSObject {
|
||||
}
|
||||
|
||||
public func isExactly(_ rtti: Rtti) -> Bool {
|
||||
let result = spine_rtti_is_exactly(_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self), rtti._ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
|
||||
let result = spine_rtti_is_exactly(
|
||||
_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self), rtti._ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public func instanceOf(_ rtti: Rtti) -> Bool {
|
||||
let result = spine_rtti_instance_of(_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self), rtti._ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
|
||||
let result = spine_rtti_instance_of(
|
||||
_ptr.assumingMemoryBound(to: spine_rtti_wrapper.self), rtti._ptr.assumingMemoryBound(to: spine_rtti_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
@ -99,7 +99,9 @@ public class Sequence: NSObject {
|
||||
}
|
||||
|
||||
public func apply(_ slot: SlotPose?, _ attachment: Attachment?) {
|
||||
spine_sequence_apply(_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), slot?._ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), attachment?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||
spine_sequence_apply(
|
||||
_ptr.assumingMemoryBound(to: spine_sequence_wrapper.self), slot?._ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self),
|
||||
attachment?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||
}
|
||||
|
||||
public func getPath(_ basePath: String, _ index: Int32) -> String {
|
||||
|
||||
@ -191,7 +191,8 @@ public class Skeleton: NSObject {
|
||||
public var setColor: Color {
|
||||
get { fatalError("Setter-only property") }
|
||||
set(newValue) {
|
||||
spine_skeleton_set_color_1(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
||||
spine_skeleton_set_color_1(
|
||||
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_color_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -204,11 +205,13 @@ public class Skeleton: NSObject {
|
||||
}
|
||||
|
||||
public func constrained(_ object: Posed) {
|
||||
spine_skeleton_constrained(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), object._ptr.assumingMemoryBound(to: spine_posed_wrapper.self))
|
||||
spine_skeleton_constrained(
|
||||
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), object._ptr.assumingMemoryBound(to: spine_posed_wrapper.self))
|
||||
}
|
||||
|
||||
public func sortBone(_ bone: Bone?) {
|
||||
spine_skeleton_sort_bone(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), bone?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
spine_skeleton_sort_bone(
|
||||
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), bone?._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
}
|
||||
|
||||
public static func sortReset(_ bones: ArrayBone) {
|
||||
@ -216,7 +219,8 @@ public class Skeleton: NSObject {
|
||||
}
|
||||
|
||||
public func updateWorldTransform(_ physics: Physics) {
|
||||
spine_skeleton_update_world_transform(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
spine_skeleton_update_world_transform(
|
||||
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public func setupPose() {
|
||||
@ -270,7 +274,8 @@ public class Skeleton: NSObject {
|
||||
}
|
||||
|
||||
public func setSkin2(_ newSkin: Skin?) {
|
||||
spine_skeleton_set_skin_2(_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newSkin?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
|
||||
spine_skeleton_set_skin_2(
|
||||
_ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), newSkin?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
|
||||
}
|
||||
|
||||
public func getAttachment(_ slotName: String, _ attachmentName: String) -> Attachment? {
|
||||
@ -280,7 +285,8 @@ public class Skeleton: NSObject {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
return BoundingBoxAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
@ -303,7 +309,8 @@ public class Skeleton: NSObject {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
return BoundingBoxAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
|
||||
@ -69,7 +69,9 @@ public class Skin: NSObject {
|
||||
}
|
||||
|
||||
public func setAttachment(_ slotIndex: Int, _ name: String, _ attachment: Attachment) {
|
||||
spine_skin_set_attachment(_ptr.assumingMemoryBound(to: spine_skin_wrapper.self), slotIndex, name, attachment._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||
spine_skin_set_attachment(
|
||||
_ptr.assumingMemoryBound(to: spine_skin_wrapper.self), slotIndex, name,
|
||||
attachment._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||
}
|
||||
|
||||
public func getAttachment(_ slotIndex: Int, _ name: String) -> Attachment? {
|
||||
@ -79,7 +81,8 @@ public class Skin: NSObject {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
return BoundingBoxAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
@ -100,7 +103,9 @@ public class Skin: NSObject {
|
||||
}
|
||||
|
||||
public func findAttachmentsForSlot(_ slotIndex: Int, _ attachments: ArrayAttachment) {
|
||||
spine_skin_find_attachments_for_slot(_ptr.assumingMemoryBound(to: spine_skin_wrapper.self), slotIndex, attachments._ptr.assumingMemoryBound(to: spine_array_attachment_wrapper.self))
|
||||
spine_skin_find_attachments_for_slot(
|
||||
_ptr.assumingMemoryBound(to: spine_skin_wrapper.self), slotIndex,
|
||||
attachments._ptr.assumingMemoryBound(to: spine_array_attachment_wrapper.self))
|
||||
}
|
||||
|
||||
public func addSkin(_ other: Skin) {
|
||||
|
||||
@ -42,7 +42,8 @@ public class Slider: PosedActive, Posed, Constraint {
|
||||
}
|
||||
|
||||
public convenience init(_ data: SliderData, _ skeleton: Skeleton) {
|
||||
let ptr = spine_slider_create(data._ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let ptr = spine_slider_create(
|
||||
data._ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -62,7 +63,8 @@ public class Slider: PosedActive, Posed, Constraint {
|
||||
return Bone(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_slider_set_bone(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
spine_slider_set_bone(
|
||||
_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,12 +89,15 @@ public class Slider: PosedActive, Posed, Constraint {
|
||||
}
|
||||
|
||||
public func copyAttachment(_ skeleton: Skeleton) -> Slider {
|
||||
let result = spine_slider_copy(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let result = spine_slider_copy(
|
||||
_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
return Slider(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_slider_update(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
spine_slider_update(
|
||||
_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
||||
spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
|
||||
@ -44,7 +44,8 @@ public class Slot: NSObject, Posed {
|
||||
}
|
||||
|
||||
public convenience init(_ data: SlotData, _ skeleton: Skeleton) {
|
||||
let ptr = spine_slot_create(data._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let ptr = spine_slot_create(
|
||||
data._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
|
||||
@ -73,8 +73,14 @@ open class Timeline: NSObject {
|
||||
return ArrayPropertyId(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func apply(_ skeleton: Skeleton, _ lastTime: Float, _ time: Float, _ events: ArrayEvent?, _ alpha: Float, _ blend: MixBlend, _ direction: MixDirection, _ 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 func apply(
|
||||
_ skeleton: Skeleton, _ lastTime: Float, _ time: Float, _ events: ArrayEvent?, _ alpha: Float, _ blend: MixBlend, _ direction: MixDirection,
|
||||
_ 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 {
|
||||
|
||||
@ -95,7 +95,8 @@ public class AnimationState: NSObject {
|
||||
}
|
||||
|
||||
public func apply(_ skeleton: Skeleton) -> Bool {
|
||||
let result = spine_animation_state_apply(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let result = spine_animation_state_apply(
|
||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
@ -108,12 +109,14 @@ public class AnimationState: NSObject {
|
||||
}
|
||||
|
||||
public func setEmptyAnimation(_ trackIndex: Int, _ mixDuration: Float) -> TrackEntry {
|
||||
let result = spine_animation_state_set_empty_animation(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, mixDuration)
|
||||
let result = spine_animation_state_set_empty_animation(
|
||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, mixDuration)
|
||||
return TrackEntry(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func addEmptyAnimation(_ trackIndex: Int, _ mixDuration: Float, _ delay: Float) -> TrackEntry {
|
||||
let result = spine_animation_state_add_empty_animation(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, mixDuration, delay)
|
||||
let result = spine_animation_state_add_empty_animation(
|
||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, mixDuration, delay)
|
||||
return TrackEntry(fromPointer: result!)
|
||||
}
|
||||
|
||||
@ -131,26 +134,33 @@ public class AnimationState: NSObject {
|
||||
}
|
||||
|
||||
public func disposeTrackEntry(_ entry: TrackEntry?) {
|
||||
spine_animation_state_dispose_track_entry(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), entry?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||
spine_animation_state_dispose_track_entry(
|
||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), entry?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||
}
|
||||
|
||||
public func setAnimation(_ trackIndex: Int, _ animationName: String, _ loop: Bool) -> TrackEntry {
|
||||
let result = spine_animation_state_set_animation_1(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animationName, loop)
|
||||
let result = spine_animation_state_set_animation_1(
|
||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animationName, loop)
|
||||
return TrackEntry(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func setAnimation2(_ trackIndex: Int, _ animation: Animation, _ loop: Bool) -> TrackEntry {
|
||||
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)
|
||||
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)
|
||||
return TrackEntry(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func addAnimation(_ trackIndex: Int, _ animationName: String, _ loop: Bool, _ delay: Float) -> TrackEntry {
|
||||
let result = spine_animation_state_add_animation_1(_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animationName, loop, delay)
|
||||
let result = spine_animation_state_add_animation_1(
|
||||
_ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self), trackIndex, animationName, loop, delay)
|
||||
return TrackEntry(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func addAnimation2(_ trackIndex: Int, _ animation: Animation, _ loop: Bool, _ delay: Float) -> TrackEntry {
|
||||
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)
|
||||
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)
|
||||
return TrackEntry(fromPointer: result!)
|
||||
}
|
||||
|
||||
|
||||
@ -64,7 +64,9 @@ public class AnimationStateData: NSObject {
|
||||
}
|
||||
|
||||
public func getMix(_ from: Animation, _ to: Animation) -> Float {
|
||||
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))
|
||||
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))
|
||||
return result
|
||||
}
|
||||
|
||||
@ -77,7 +79,9 @@ public class AnimationStateData: NSObject {
|
||||
}
|
||||
|
||||
public func setMix2(_ from: Animation, _ to: Animation, _ duration: Float) {
|
||||
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)
|
||||
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)
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -49,32 +49,44 @@ public class AtlasAttachmentLoader: NSObject, AttachmentLoader {
|
||||
}
|
||||
|
||||
public func newRegionAttachment(_ skin: Skin, _ name: String, _ path: String, _ sequence: Sequence?) -> RegionAttachment? {
|
||||
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))
|
||||
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))
|
||||
return result.map { RegionAttachment(fromPointer: $0) }
|
||||
}
|
||||
|
||||
public func newMeshAttachment(_ skin: Skin, _ name: String, _ path: String, _ sequence: Sequence?) -> MeshAttachment? {
|
||||
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))
|
||||
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))
|
||||
return result.map { MeshAttachment(fromPointer: $0) }
|
||||
}
|
||||
|
||||
public func newBoundingBoxAttachment(_ skin: Skin, _ name: String) -> BoundingBoxAttachment? {
|
||||
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)
|
||||
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
|
||||
)
|
||||
return result.map { BoundingBoxAttachment(fromPointer: $0) }
|
||||
}
|
||||
|
||||
public func newPathAttachment(_ skin: Skin, _ name: String) -> PathAttachment? {
|
||||
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)
|
||||
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
|
||||
)
|
||||
return result.map { PathAttachment(fromPointer: $0) }
|
||||
}
|
||||
|
||||
public func newPointAttachment(_ skin: Skin, _ name: String) -> PointAttachment? {
|
||||
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)
|
||||
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
|
||||
)
|
||||
return result.map { PointAttachment(fromPointer: $0) }
|
||||
}
|
||||
|
||||
public func newClippingAttachment(_ skin: Skin, _ name: String) -> ClippingAttachment? {
|
||||
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)
|
||||
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
|
||||
)
|
||||
return result.map { ClippingAttachment(fromPointer: $0) }
|
||||
}
|
||||
|
||||
|
||||
@ -74,7 +74,8 @@ public class AtlasPage: NSObject {
|
||||
return Format(rawValue: Int32(result.rawValue))!
|
||||
}
|
||||
set {
|
||||
spine_atlas_page_set_format(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_format(rawValue: UInt32(newValue.rawValue)))
|
||||
spine_atlas_page_set_format(
|
||||
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_format(rawValue: UInt32(newValue.rawValue)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,7 +85,8 @@ public class AtlasPage: NSObject {
|
||||
return TextureFilter(rawValue: Int32(result.rawValue))!
|
||||
}
|
||||
set {
|
||||
spine_atlas_page_set_min_filter(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_filter(rawValue: UInt32(newValue.rawValue)))
|
||||
spine_atlas_page_set_min_filter(
|
||||
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_filter(rawValue: UInt32(newValue.rawValue)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +96,8 @@ public class AtlasPage: NSObject {
|
||||
return TextureFilter(rawValue: Int32(result.rawValue))!
|
||||
}
|
||||
set {
|
||||
spine_atlas_page_set_mag_filter(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_filter(rawValue: UInt32(newValue.rawValue)))
|
||||
spine_atlas_page_set_mag_filter(
|
||||
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_filter(rawValue: UInt32(newValue.rawValue)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,7 +107,8 @@ public class AtlasPage: NSObject {
|
||||
return TextureWrap(rawValue: Int32(result.rawValue))!
|
||||
}
|
||||
set {
|
||||
spine_atlas_page_set_u_wrap(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_wrap(rawValue: UInt32(newValue.rawValue)))
|
||||
spine_atlas_page_set_u_wrap(
|
||||
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_wrap(rawValue: UInt32(newValue.rawValue)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,7 +118,8 @@ public class AtlasPage: NSObject {
|
||||
return TextureWrap(rawValue: Int32(result.rawValue))!
|
||||
}
|
||||
set {
|
||||
spine_atlas_page_set_v_wrap(_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_wrap(rawValue: UInt32(newValue.rawValue)))
|
||||
spine_atlas_page_set_v_wrap(
|
||||
_ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self), spine_texture_wrap(rawValue: UInt32(newValue.rawValue)))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,8 @@ public class AtlasRegion: TextureRegion {
|
||||
return result.map { AtlasPage(fromPointer: $0) }
|
||||
}
|
||||
set {
|
||||
spine_atlas_region_set_page(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||
spine_atlas_region_set_page(
|
||||
_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_atlas_page_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -182,7 +183,8 @@ public class AtlasRegion: TextureRegion {
|
||||
return ArrayInt(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_atlas_region_set_splits(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
||||
spine_atlas_region_set_splits(
|
||||
_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -192,7 +194,8 @@ public class AtlasRegion: TextureRegion {
|
||||
return ArrayInt(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_atlas_region_set_pads(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
||||
spine_atlas_region_set_pads(
|
||||
_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -202,7 +205,8 @@ public class AtlasRegion: TextureRegion {
|
||||
return ArrayFloat(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_atlas_region_set_values(_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
spine_atlas_region_set_values(
|
||||
_ptr.assumingMemoryBound(to: spine_atlas_region_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -124,7 +124,8 @@ public class BoneLocal: NSObject {
|
||||
return Inherit(rawValue: Int32(result.rawValue))!
|
||||
}
|
||||
set {
|
||||
spine_bone_local_set_inherit(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), spine_inherit(rawValue: UInt32(newValue.rawValue)))
|
||||
spine_bone_local_set_inherit(
|
||||
_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), spine_inherit(rawValue: UInt32(newValue.rawValue)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,7 +137,8 @@ public class BoneLocal: NSObject {
|
||||
}
|
||||
|
||||
public func set(_ pose: BoneLocal) {
|
||||
spine_bone_local_set(_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
||||
spine_bone_local_set(
|
||||
_ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_bone_local_wrapper.self))
|
||||
}
|
||||
|
||||
public func setPosition(_ x: Float, _ y: Float) {
|
||||
|
||||
@ -132,23 +132,29 @@ public class BonePose: BoneLocal, Update {
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
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)))
|
||||
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)))
|
||||
}
|
||||
|
||||
public func updateWorldTransform(_ skeleton: Skeleton) {
|
||||
spine_bone_pose_update_world_transform(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
spine_bone_pose_update_world_transform(
|
||||
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func updateLocalTransform(_ skeleton: Skeleton) {
|
||||
spine_bone_pose_update_local_transform(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
spine_bone_pose_update_local_transform(
|
||||
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func validateLocalTransform(_ skeleton: Skeleton) {
|
||||
spine_bone_pose_validate_local_transform(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
spine_bone_pose_validate_local_transform(
|
||||
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func modifyLocal(_ skeleton: Skeleton) {
|
||||
spine_bone_pose_modify_local(_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
spine_bone_pose_modify_local(
|
||||
_ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func modifyWorld(_ update: Int32) {
|
||||
|
||||
@ -52,7 +52,9 @@ public class ClippingAttachment: VertexAttachment {
|
||||
return result.map { SlotData(fromPointer: $0) }
|
||||
}
|
||||
set {
|
||||
spine_clipping_attachment_set_end_slot(_ptr.assumingMemoryBound(to: spine_clipping_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
||||
spine_clipping_attachment_set_end_slot(
|
||||
_ptr.assumingMemoryBound(to: spine_clipping_attachment_wrapper.self),
|
||||
newValue?._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -60,12 +60,17 @@ open class CurveTimeline: Timeline {
|
||||
return ArrayFloat(fromPointer: result!)
|
||||
}
|
||||
|
||||
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) {
|
||||
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 setBezier(
|
||||
_ bezier: Int, _ frame: Int, _ value: Float, _ time1: Float, _ value1: Float, _ cx1: Float, _ cy1: Float, _ cx2: Float, _ cy2: Float,
|
||||
_ 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 {
|
||||
let result = spine_curve_timeline_get_bezier_value(_ptr.assumingMemoryBound(to: spine_curve_timeline_wrapper.self), time, frame, valueOffset, i)
|
||||
let result = spine_curve_timeline_get_bezier_value(
|
||||
_ptr.assumingMemoryBound(to: spine_curve_timeline_wrapper.self), time, frame, valueOffset, i)
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
@ -51,22 +51,31 @@ open class CurveTimeline1: CurveTimeline {
|
||||
}
|
||||
|
||||
public func getRelativeValue(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ current: Float, _ setup: Float) -> Float {
|
||||
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)
|
||||
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)
|
||||
return result
|
||||
}
|
||||
|
||||
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)
|
||||
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)
|
||||
return result
|
||||
}
|
||||
|
||||
public func getAbsoluteValue(_ time: Float, _ alpha: Float, _ blend: MixBlend, _ current: Float, _ setup: Float) -> Float {
|
||||
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)
|
||||
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)
|
||||
return result
|
||||
}
|
||||
|
||||
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(_ptr.assumingMemoryBound(to: spine_curve_timeline1_wrapper.self), time, alpha, spine_mix_blend(rawValue: UInt32(blend.rawValue)), current, setup, value)
|
||||
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)
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,8 @@ public class DeformTimeline: SlotCurveTimeline {
|
||||
}
|
||||
|
||||
public convenience init(_ frameCount: Int, _ bezierCount: Int, _ slotIndex: Int32, _ attachment: VertexAttachment) {
|
||||
let ptr = spine_deform_timeline_create(frameCount, bezierCount, slotIndex, attachment._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||
let ptr = spine_deform_timeline_create(
|
||||
frameCount, bezierCount, slotIndex, attachment._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -53,9 +54,11 @@ public class DeformTimeline: SlotCurveTimeline {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
return BoundingBoxAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
return ClippingAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
case "spine_path_attachment":
|
||||
@ -65,12 +68,16 @@ public class DeformTimeline: SlotCurveTimeline {
|
||||
}
|
||||
}
|
||||
set {
|
||||
spine_deform_timeline_set_attachment(_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||
spine_deform_timeline_set_attachment(
|
||||
_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self),
|
||||
newValue._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
public func setFrame(_ frameIndex: Int32, _ time: Float, _ vertices: ArrayFloat) {
|
||||
spine_deform_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_deform_timeline_wrapper.self), frameIndex, time, vertices._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
spine_deform_timeline_set_frame(
|
||||
_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 {
|
||||
|
||||
@ -47,7 +47,9 @@ public class DrawOrderTimeline: Timeline {
|
||||
}
|
||||
|
||||
public func setFrame(_ frame: Int, _ time: Float, _ drawOrder: ArrayInt?) {
|
||||
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))
|
||||
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))
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -44,7 +44,9 @@ public class EventQueueEntry: NSObject {
|
||||
}
|
||||
|
||||
public convenience init(_ eventType: EventType, _ trackEntry: TrackEntry?, _ event: Event?) {
|
||||
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))
|
||||
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))
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -54,7 +56,8 @@ public class EventQueueEntry: NSObject {
|
||||
return EventType(rawValue: Int32(result.rawValue))!
|
||||
}
|
||||
set {
|
||||
spine_event_queue_entry_set__type(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), spine_event_type(rawValue: UInt32(newValue.rawValue)))
|
||||
spine_event_queue_entry_set__type(
|
||||
_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), spine_event_type(rawValue: UInt32(newValue.rawValue)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,7 +67,9 @@ public class EventQueueEntry: NSObject {
|
||||
return result.map { TrackEntry(fromPointer: $0) }
|
||||
}
|
||||
set {
|
||||
spine_event_queue_entry_set__entry(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||
spine_event_queue_entry_set__entry(
|
||||
_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self),
|
||||
newValue?._ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,7 +79,8 @@ public class EventQueueEntry: NSObject {
|
||||
return result.map { Event(fromPointer: $0) }
|
||||
}
|
||||
set {
|
||||
spine_event_queue_entry_set__event(_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||
spine_event_queue_entry_set__event(
|
||||
_ptr.assumingMemoryBound(to: spine_event_queue_entry_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,8 @@ public class EventTimeline: Timeline {
|
||||
}
|
||||
|
||||
public func setFrame(_ frame: Int, _ event: Event) {
|
||||
spine_event_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_event_timeline_wrapper.self), frame, event._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||
spine_event_timeline_set_frame(
|
||||
_ptr.assumingMemoryBound(to: spine_event_timeline_wrapper.self), frame, event._ptr.assumingMemoryBound(to: spine_event_wrapper.self))
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -64,7 +64,9 @@ open class FromProperty: NSObject {
|
||||
return result.map { ArrayToProperty(fromPointer: $0) }
|
||||
}
|
||||
set {
|
||||
spine_from_property_set__to(_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_array_to_property_wrapper.self))
|
||||
spine_from_property_set__to(
|
||||
_ptr.assumingMemoryBound(to: spine_from_property_wrapper.self),
|
||||
newValue?._ptr.assumingMemoryBound(to: spine_array_to_property_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,9 @@ public class IkConstraint: PosedActive, Posed, Constraint {
|
||||
}
|
||||
|
||||
public convenience init(_ data: IkConstraintData, _ skeleton: Skeleton) {
|
||||
let ptr = spine_ik_constraint_create(data._ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let ptr = spine_ik_constraint_create(
|
||||
data._ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self),
|
||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -72,7 +74,8 @@ public class IkConstraint: PosedActive, Posed, Constraint {
|
||||
return Bone(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_ik_constraint_set_target(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
spine_ik_constraint_set_target(
|
||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,16 +95,20 @@ public class IkConstraint: PosedActive, Posed, Constraint {
|
||||
}
|
||||
|
||||
public func copyAttachment(_ skeleton: Skeleton) -> IkConstraint {
|
||||
let result = spine_ik_constraint_copy(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let result = spine_ik_constraint_copy(
|
||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
return IkConstraint(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_ik_constraint_update(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
spine_ik_constraint_update(
|
||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
||||
spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_ik_constraint_sort(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
spine_ik_constraint_sort(
|
||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
@ -117,12 +124,21 @@ public class IkConstraint: PosedActive, Posed, Constraint {
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public static func apply(_ 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)
|
||||
public static func apply(
|
||||
_ 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)
|
||||
}
|
||||
|
||||
public static func apply2(_ skeleton: Skeleton, _ parent: BonePose, _ child: BonePose, _ targetX: Float, _ targetY: Float, _ bendDirection: Int32, _ stretch: Bool, _ 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 static func apply2(
|
||||
_ skeleton: Skeleton, _ parent: BonePose, _ child: BonePose, _ targetX: Float, _ targetY: Float, _ bendDirection: Int32, _ stretch: Bool,
|
||||
_ 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() {
|
||||
|
||||
@ -62,7 +62,9 @@ public class IkConstraintData: PosedData, ConstraintData {
|
||||
return BoneData(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_ik_constraint_data_set_target(_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||
spine_ik_constraint_data_set_target(
|
||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self),
|
||||
newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,7 +84,8 @@ public class IkConstraintData: PosedData, ConstraintData {
|
||||
}
|
||||
|
||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||
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))
|
||||
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))
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
|
||||
@ -99,7 +99,9 @@ public class IkConstraintPose: NSObject {
|
||||
}
|
||||
|
||||
public func set(_ pose: IkConstraintPose) {
|
||||
spine_ik_constraint_pose_set(_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
||||
spine_ik_constraint_pose_set(
|
||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self),
|
||||
pose._ptr.assumingMemoryBound(to: spine_ik_constraint_pose_wrapper.self))
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -57,7 +57,8 @@ public class IkConstraintTimeline: CurveTimeline, ConstraintTimeline {
|
||||
}
|
||||
|
||||
public func setFrame(_ frame: Int32, _ time: Float, _ mix: Float, _ softness: Float, _ bendDirection: Int32, _ compress: Bool, _ stretch: Bool) {
|
||||
spine_ik_constraint_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self), frame, time, mix, softness, bendDirection, compress, stretch)
|
||||
spine_ik_constraint_timeline_set_frame(
|
||||
_ptr.assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self), frame, time, mix, softness, bendDirection, compress, stretch)
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -57,7 +57,8 @@ public class InheritTimeline: Timeline, BoneTimeline {
|
||||
}
|
||||
|
||||
public func setFrame(_ frame: Int32, _ time: Float, _ inherit: Inherit) {
|
||||
spine_inherit_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_inherit_timeline_wrapper.self), frame, time, spine_inherit(rawValue: UInt32(inherit.rawValue)))
|
||||
spine_inherit_timeline_set_frame(
|
||||
_ptr.assumingMemoryBound(to: spine_inherit_timeline_wrapper.self), frame, time, spine_inherit(rawValue: UInt32(inherit.rawValue)))
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -62,7 +62,9 @@ public class MeshAttachment: VertexAttachment {
|
||||
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))
|
||||
spine_mesh_attachment_set_region_u_vs(
|
||||
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
|
||||
newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,7 +79,9 @@ public class MeshAttachment: VertexAttachment {
|
||||
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))
|
||||
spine_mesh_attachment_set_triangles(
|
||||
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
|
||||
newValue._ptr.assumingMemoryBound(to: spine_array_unsigned_short_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -102,7 +106,9 @@ public class MeshAttachment: VertexAttachment {
|
||||
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))
|
||||
spine_mesh_attachment_set_region(
|
||||
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
|
||||
newValue?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,7 +118,8 @@ public class MeshAttachment: VertexAttachment {
|
||||
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))
|
||||
spine_mesh_attachment_set_sequence(
|
||||
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,7 +129,9 @@ public class MeshAttachment: VertexAttachment {
|
||||
return result.map { MeshAttachment(fromPointer: $0) }
|
||||
}
|
||||
set {
|
||||
spine_mesh_attachment_set_parent_mesh(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
spine_mesh_attachment_set_parent_mesh(
|
||||
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
|
||||
newValue?._ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -132,7 +141,9 @@ public class MeshAttachment: VertexAttachment {
|
||||
return ArrayUnsignedShort(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_mesh_attachment_set_edges(_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_unsigned_short_wrapper.self))
|
||||
spine_mesh_attachment_set_edges(
|
||||
_ptr.assumingMemoryBound(to: spine_mesh_attachment_wrapper.self),
|
||||
newValue._ptr.assumingMemoryBound(to: spine_array_unsigned_short_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,9 @@ public class PathAttachment: VertexAttachment {
|
||||
return ArrayFloat(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_path_attachment_set_lengths(_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
spine_path_attachment_set_lengths(
|
||||
_ptr.assumingMemoryBound(to: spine_path_attachment_wrapper.self),
|
||||
newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,9 @@ public class PathConstraint: PosedActive, Posed, Constraint {
|
||||
}
|
||||
|
||||
public convenience init(_ data: PathConstraintData, _ skeleton: Skeleton) {
|
||||
let ptr = spine_path_constraint_create(data._ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let ptr = spine_path_constraint_create(
|
||||
data._ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self),
|
||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -67,7 +69,8 @@ public class PathConstraint: PosedActive, Posed, Constraint {
|
||||
return Slot(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_path_constraint_set_slot(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
|
||||
spine_path_constraint_set_slot(
|
||||
_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,16 +95,20 @@ public class PathConstraint: PosedActive, Posed, Constraint {
|
||||
}
|
||||
|
||||
public func copyAttachment(_ skeleton: Skeleton) -> PathConstraint {
|
||||
let result = spine_path_constraint_copy(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let result = spine_path_constraint_copy(
|
||||
_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
return PathConstraint(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_path_constraint_update(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
spine_path_constraint_update(
|
||||
_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
||||
spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_path_constraint_sort(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
spine_path_constraint_sort(
|
||||
_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
|
||||
@ -62,7 +62,9 @@ public class PathConstraintData: PosedData, ConstraintData {
|
||||
return SlotData(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_path_constraint_data_set_slot(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
||||
spine_path_constraint_data_set_slot(
|
||||
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self),
|
||||
newValue._ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,7 +74,8 @@ public class PathConstraintData: PosedData, ConstraintData {
|
||||
return PositionMode(rawValue: Int32(result.rawValue))!
|
||||
}
|
||||
set {
|
||||
spine_path_constraint_data_set_position_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_position_mode(rawValue: UInt32(newValue.rawValue)))
|
||||
spine_path_constraint_data_set_position_mode(
|
||||
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_position_mode(rawValue: UInt32(newValue.rawValue)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,7 +85,8 @@ public class PathConstraintData: PosedData, ConstraintData {
|
||||
return SpacingMode(rawValue: Int32(result.rawValue))!
|
||||
}
|
||||
set {
|
||||
spine_path_constraint_data_set_spacing_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_spacing_mode(rawValue: UInt32(newValue.rawValue)))
|
||||
spine_path_constraint_data_set_spacing_mode(
|
||||
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_spacing_mode(rawValue: UInt32(newValue.rawValue)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,7 +96,8 @@ public class PathConstraintData: PosedData, ConstraintData {
|
||||
return RotateMode(rawValue: Int32(result.rawValue))!
|
||||
}
|
||||
set {
|
||||
spine_path_constraint_data_set_rotate_mode(_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_rotate_mode(rawValue: UInt32(newValue.rawValue)))
|
||||
spine_path_constraint_data_set_rotate_mode(
|
||||
_ptr.assumingMemoryBound(to: spine_path_constraint_data_wrapper.self), spine_rotate_mode(rawValue: UInt32(newValue.rawValue)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,7 +117,8 @@ public class PathConstraintData: PosedData, ConstraintData {
|
||||
}
|
||||
|
||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||
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))
|
||||
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))
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
|
||||
@ -48,16 +48,19 @@ public class PathConstraintMixTimeline: CurveTimeline, ConstraintTimeline {
|
||||
|
||||
public var constraintIndex: Int32 {
|
||||
get {
|
||||
let result = spine_path_constraint_mix_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self))
|
||||
let result = spine_path_constraint_mix_timeline_get_constraint_index(
|
||||
_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self))
|
||||
return result
|
||||
}
|
||||
set {
|
||||
spine_path_constraint_mix_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self), newValue)
|
||||
spine_path_constraint_mix_timeline_set_constraint_index(
|
||||
_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self), newValue)
|
||||
}
|
||||
}
|
||||
|
||||
public func setFrame(_ frame: Int32, _ time: Float, _ mixRotate: Float, _ mixX: Float, _ mixY: Float) {
|
||||
spine_path_constraint_mix_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self), frame, time, mixRotate, mixX, mixY)
|
||||
spine_path_constraint_mix_timeline_set_frame(
|
||||
_ptr.assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self), frame, time, mixRotate, mixX, mixY)
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -99,7 +99,9 @@ public class PathConstraintPose: NSObject {
|
||||
}
|
||||
|
||||
public func set(_ pose: PathConstraintPose) {
|
||||
spine_path_constraint_pose_set(_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
||||
spine_path_constraint_pose_set(
|
||||
_ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self),
|
||||
pose._ptr.assumingMemoryBound(to: spine_path_constraint_pose_wrapper.self))
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -42,7 +42,9 @@ public class PhysicsConstraint: PosedActive, Posed, Constraint {
|
||||
}
|
||||
|
||||
public convenience init(_ data: PhysicsConstraintData, _ skeleton: Skeleton) {
|
||||
let ptr = spine_physics_constraint_create(data._ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let ptr = spine_physics_constraint_create(
|
||||
data._ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self),
|
||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -62,7 +64,9 @@ public class PhysicsConstraint: PosedActive, Posed, Constraint {
|
||||
return BonePose(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_physics_constraint_set_bone(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||
spine_physics_constraint_set_bone(
|
||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self),
|
||||
newValue._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,20 +91,25 @@ public class PhysicsConstraint: PosedActive, Posed, Constraint {
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_physics_constraint_update(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
spine_physics_constraint_update(
|
||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
||||
spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_physics_constraint_sort(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
spine_physics_constraint_sort(
|
||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func copyAttachment(_ skeleton: Skeleton) -> PhysicsConstraint {
|
||||
let result = spine_physics_constraint_copy(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let result = spine_physics_constraint_copy(
|
||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
return PhysicsConstraint(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func reset(_ skeleton: Skeleton) {
|
||||
spine_physics_constraint_reset(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
spine_physics_constraint_reset(
|
||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func translate(_ x: Float, _ y: Float) {
|
||||
|
||||
@ -57,7 +57,9 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
||||
return BoneData(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_physics_constraint_data_set_bone(_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||
spine_physics_constraint_data_set_bone(
|
||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self),
|
||||
newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,7 +209,9 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
||||
}
|
||||
|
||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||
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))
|
||||
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))
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
|
||||
@ -119,7 +119,9 @@ public class PhysicsConstraintPose: NSObject {
|
||||
}
|
||||
|
||||
public func set(_ pose: PhysicsConstraintPose) {
|
||||
spine_physics_constraint_pose_set(_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
||||
spine_physics_constraint_pose_set(
|
||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self),
|
||||
pose._ptr.assumingMemoryBound(to: spine_physics_constraint_pose_wrapper.self))
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -48,16 +48,19 @@ public class PhysicsConstraintResetTimeline: Timeline, ConstraintTimeline {
|
||||
|
||||
public var constraintIndex: Int32 {
|
||||
get {
|
||||
let result = spine_physics_constraint_reset_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self))
|
||||
let result = spine_physics_constraint_reset_timeline_get_constraint_index(
|
||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self))
|
||||
return result
|
||||
}
|
||||
set {
|
||||
spine_physics_constraint_reset_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self), newValue)
|
||||
spine_physics_constraint_reset_timeline_set_constraint_index(
|
||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self), newValue)
|
||||
}
|
||||
}
|
||||
|
||||
public func setFrame(_ frame: Int32, _ time: Float) {
|
||||
spine_physics_constraint_reset_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self), frame, time)
|
||||
spine_physics_constraint_reset_timeline_set_frame(
|
||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self), frame, time)
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -43,11 +43,13 @@ open class PhysicsConstraintTimeline: CurveTimeline1, ConstraintTimeline {
|
||||
|
||||
public var constraintIndex: Int32 {
|
||||
get {
|
||||
let result = spine_physics_constraint_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self))
|
||||
let result = spine_physics_constraint_timeline_get_constraint_index(
|
||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self))
|
||||
return result
|
||||
}
|
||||
set {
|
||||
spine_physics_constraint_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self), newValue)
|
||||
spine_physics_constraint_timeline_set_constraint_index(
|
||||
_ptr.assumingMemoryBound(to: spine_physics_constraint_timeline_wrapper.self), newValue)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -82,7 +82,8 @@ public class PointAttachment: Attachment {
|
||||
}
|
||||
|
||||
public func computeWorldRotation(_ bone: BonePose) -> Float {
|
||||
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))
|
||||
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))
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
@ -53,17 +53,17 @@ public enum Property: Int32, CaseIterable {
|
||||
case pathConstraintPosition = 131072
|
||||
case pathConstraintSpacing = 262144
|
||||
case pathConstraintMix = 524288
|
||||
case physicsConstraintInertia = 1048576
|
||||
case physicsConstraintStrength = 2097152
|
||||
case physicsConstraintDamping = 4194304
|
||||
case physicsConstraintMass = 8388608
|
||||
case physicsConstraintWind = 16777216
|
||||
case physicsConstraintGravity = 33554432
|
||||
case physicsConstraintMix = 67108864
|
||||
case physicsConstraintReset = 134217728
|
||||
case sequence = 268435456
|
||||
case sliderTime = 536870912
|
||||
case sliderMix = 1073741824
|
||||
case physicsConstraintInertia = 1_048_576
|
||||
case physicsConstraintStrength = 2_097_152
|
||||
case physicsConstraintDamping = 4_194_304
|
||||
case physicsConstraintMass = 8_388_608
|
||||
case physicsConstraintWind = 16_777_216
|
||||
case physicsConstraintGravity = 33_554_432
|
||||
case physicsConstraintMix = 67_108_864
|
||||
case physicsConstraintReset = 134_217_728
|
||||
case sequence = 268_435_456
|
||||
case sliderTime = 536_870_912
|
||||
case sliderMix = 1_073_741_824
|
||||
|
||||
public static func fromValue(_ value: Int32) -> Property? {
|
||||
return Property(rawValue: value)
|
||||
|
||||
@ -137,7 +137,9 @@ public class RegionAttachment: Attachment {
|
||||
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))
|
||||
spine_region_attachment_set_region(
|
||||
_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self),
|
||||
newValue?._ptr.assumingMemoryBound(to: spine_texture_region_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,7 +149,9 @@ public class RegionAttachment: Attachment {
|
||||
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))
|
||||
spine_region_attachment_set_sequence(
|
||||
_ptr.assumingMemoryBound(to: spine_region_attachment_wrapper.self),
|
||||
newValue?._ptr.assumingMemoryBound(to: spine_sequence_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,7 +170,9 @@ public class RegionAttachment: Attachment {
|
||||
}
|
||||
|
||||
public func computeWorldVertices(_ slot: Slot, _ worldVertices: ArrayFloat, _ offset: Int, _ stride: Int) {
|
||||
spine_region_attachment_compute_world_vertices_2(_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)
|
||||
spine_region_attachment_compute_world_vertices_2(
|
||||
_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() {
|
||||
|
||||
@ -52,7 +52,8 @@ public class SequenceTimeline: Timeline, SlotTimeline {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
return BoundingBoxAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
@ -79,7 +80,9 @@ public class SequenceTimeline: Timeline, SlotTimeline {
|
||||
}
|
||||
|
||||
public func setFrame(_ frame: Int32, _ time: Float, _ mode: SequenceMode, _ index: Int32, _ delay: Float) {
|
||||
spine_sequence_timeline_set_frame(_ptr.assumingMemoryBound(to: spine_sequence_timeline_wrapper.self), frame, time, spine_sequence_mode(rawValue: UInt32(mode.rawValue)), index, delay)
|
||||
spine_sequence_timeline_set_frame(
|
||||
_ptr.assumingMemoryBound(to: spine_sequence_timeline_wrapper.self), frame, time, spine_sequence_mode(rawValue: UInt32(mode.rawValue)),
|
||||
index, delay)
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -89,7 +89,9 @@ public class SkeletonBounds: NSObject {
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ updateAabb: Bool) {
|
||||
spine_skeleton_bounds_update(_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), updateAabb)
|
||||
spine_skeleton_bounds_update(
|
||||
_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
||||
updateAabb)
|
||||
}
|
||||
|
||||
public func aabbContainsPoint(_ x: Float, _ y: Float) -> Bool {
|
||||
@ -103,22 +105,27 @@ public class SkeletonBounds: NSObject {
|
||||
}
|
||||
|
||||
public func aabbIntersectsSkeleton(_ bounds: SkeletonBounds) -> Bool {
|
||||
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))
|
||||
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))
|
||||
return result
|
||||
}
|
||||
|
||||
public func getPolygon(_ attachment: BoundingBoxAttachment?) -> 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))
|
||||
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))
|
||||
return result.map { Polygon(fromPointer: $0) }
|
||||
}
|
||||
|
||||
public func getBoundingBox(_ polygon: Polygon?) -> BoundingBoxAttachment? {
|
||||
let result = spine_skeleton_bounds_get_bounding_box(_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), polygon?._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
|
||||
let result = spine_skeleton_bounds_get_bounding_box(
|
||||
_ptr.assumingMemoryBound(to: spine_skeleton_bounds_wrapper.self), polygon?._ptr.assumingMemoryBound(to: spine_polygon_wrapper.self))
|
||||
return result.map { BoundingBoxAttachment(fromPointer: $0) }
|
||||
}
|
||||
|
||||
public func containsPoint(_ polygon: Polygon, _ x: Float, _ y: Float) -> Bool {
|
||||
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)
|
||||
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)
|
||||
return result
|
||||
}
|
||||
|
||||
@ -133,7 +140,9 @@ public class SkeletonBounds: NSObject {
|
||||
}
|
||||
|
||||
public func intersectsSegment2(_ polygon: Polygon, _ x1: Float, _ y1: Float, _ x2: Float, _ y2: Float) -> Bool {
|
||||
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)
|
||||
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)
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
@ -69,12 +69,15 @@ public class SkeletonClipping: NSObject {
|
||||
}
|
||||
|
||||
public func clipStart(_ skeleton: Skeleton, _ slot: Slot, _ clip: ClippingAttachment?) -> Int {
|
||||
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))
|
||||
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))
|
||||
return result
|
||||
}
|
||||
|
||||
public func clipEnd(_ slot: Slot) {
|
||||
spine_skeleton_clipping_clip_end_1(_ptr.assumingMemoryBound(to: spine_skeleton_clipping_wrapper.self), slot._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
|
||||
spine_skeleton_clipping_clip_end_1(
|
||||
_ptr.assumingMemoryBound(to: spine_skeleton_clipping_wrapper.self), slot._ptr.assumingMemoryBound(to: spine_slot_wrapper.self))
|
||||
}
|
||||
|
||||
public func clipEnd2() {
|
||||
@ -82,7 +85,10 @@ public class SkeletonClipping: NSObject {
|
||||
}
|
||||
|
||||
public func clipTriangles(_ vertices: ArrayFloat, _ triangles: ArrayUnsignedShort, _ uvs: ArrayFloat, _ stride: Int) -> Bool {
|
||||
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)
|
||||
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)
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
@ -79,7 +79,8 @@ public class SkeletonData: NSObject {
|
||||
return result.map { Skin(fromPointer: $0) }
|
||||
}
|
||||
set {
|
||||
spine_skeleton_data_set_default_skin(_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
|
||||
spine_skeleton_data_set_default_skin(
|
||||
_ptr.assumingMemoryBound(to: spine_skeleton_data_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_skin_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -49,7 +49,8 @@ public class SkeletonRenderer: NSObject {
|
||||
}
|
||||
|
||||
public func render(_ skeleton: Skeleton) -> RenderCommand? {
|
||||
let result = spine_skeleton_renderer_render(_ptr.assumingMemoryBound(to: spine_skeleton_renderer_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let result = spine_skeleton_renderer_render(
|
||||
_ptr.assumingMemoryBound(to: spine_skeleton_renderer_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
return result.map { RenderCommand(fromPointer: $0) }
|
||||
}
|
||||
|
||||
|
||||
@ -57,7 +57,8 @@ public class SliderData: PosedData, ConstraintData {
|
||||
return Animation(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_slider_data_set_animation(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
||||
spine_slider_data_set_animation(
|
||||
_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,7 +88,8 @@ public class SliderData: PosedData, ConstraintData {
|
||||
return result.map { BoneData(fromPointer: $0) }
|
||||
}
|
||||
set {
|
||||
spine_slider_data_set_bone(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||
spine_slider_data_set_bone(
|
||||
_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -115,7 +117,9 @@ public class SliderData: PosedData, ConstraintData {
|
||||
}
|
||||
}
|
||||
set {
|
||||
spine_slider_data_set_property(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_from_property_wrapper.self))
|
||||
spine_slider_data_set_property(
|
||||
_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_from_property_wrapper.self)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,7 +159,8 @@ public class SliderData: PosedData, ConstraintData {
|
||||
}
|
||||
|
||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||
let result = spine_slider_data_create_method(_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let result = spine_slider_data_create_method(
|
||||
_ptr.assumingMemoryBound(to: spine_slider_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
|
||||
@ -69,7 +69,8 @@ public class SliderPose: NSObject {
|
||||
}
|
||||
|
||||
public func set(_ pose: SliderPose) {
|
||||
spine_slider_pose_set(_ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self))
|
||||
spine_slider_pose_set(
|
||||
_ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_slider_pose_wrapper.self))
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -72,7 +72,8 @@ public class SlotData: PosedData {
|
||||
return BlendMode(rawValue: Int32(result.rawValue))!
|
||||
}
|
||||
set {
|
||||
spine_slot_data_set_blend_mode(_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), spine_blend_mode(rawValue: UInt32(newValue.rawValue)))
|
||||
spine_slot_data_set_blend_mode(
|
||||
_ptr.assumingMemoryBound(to: spine_slot_data_wrapper.self), spine_blend_mode(rawValue: UInt32(newValue.rawValue)))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -76,7 +76,8 @@ public class SlotPose: NSObject {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
return BoundingBoxAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
@ -92,7 +93,8 @@ public class SlotPose: NSObject {
|
||||
}
|
||||
}
|
||||
set {
|
||||
spine_slot_pose_set_attachment(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||
spine_slot_pose_set_attachment(
|
||||
_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,7 +114,8 @@ public class SlotPose: NSObject {
|
||||
}
|
||||
|
||||
public func set(_ pose: SlotPose) {
|
||||
spine_slot_pose_set(_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self))
|
||||
spine_slot_pose_set(
|
||||
_ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_slot_pose_wrapper.self))
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -79,12 +79,17 @@ open class ToProperty: NSObject {
|
||||
}
|
||||
|
||||
public func mix(_ pose: TransformConstraintPose) -> Float {
|
||||
let result = spine_to_property_mix(_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
||||
let result = spine_to_property_mix(
|
||||
_ptr.assumingMemoryBound(to: spine_to_property_wrapper.self),
|
||||
pose._ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public func apply(_ skeleton: Skeleton, _ pose: TransformConstraintPose, _ bone: BonePose, _ value: Float, _ local: Bool, _ additive: Bool) {
|
||||
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)
|
||||
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)
|
||||
}
|
||||
|
||||
public static func rttiStatic() -> Rtti {
|
||||
|
||||
@ -59,7 +59,8 @@ public class TrackEntry: NSObject {
|
||||
return Animation(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_track_entry_set_animation(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
||||
spine_track_entry_set_animation(
|
||||
_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_animation_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -264,7 +265,8 @@ public class TrackEntry: NSObject {
|
||||
return MixBlend(rawValue: Int32(result.rawValue))!
|
||||
}
|
||||
set {
|
||||
spine_track_entry_set_mix_blend(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), spine_mix_blend(rawValue: UInt32(newValue.rawValue)))
|
||||
spine_track_entry_set_mix_blend(
|
||||
_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), spine_mix_blend(rawValue: UInt32(newValue.rawValue)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -304,7 +306,9 @@ public class TrackEntry: NSObject {
|
||||
return result.map { AnimationState(fromPointer: $0) }
|
||||
}
|
||||
set {
|
||||
spine_track_entry_set_animation_state(_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self))
|
||||
spine_track_entry_set_animation_state(
|
||||
_ptr.assumingMemoryBound(to: spine_track_entry_wrapper.self),
|
||||
newValue?._ptr.assumingMemoryBound(to: spine_animation_state_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,9 @@ public class TransformConstraint: PosedActive, Posed, Constraint {
|
||||
}
|
||||
|
||||
public convenience init(_ data: TransformConstraintData, _ skeleton: Skeleton) {
|
||||
let ptr = spine_transform_constraint_create(data._ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let ptr = spine_transform_constraint_create(
|
||||
data._ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self),
|
||||
skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
@ -67,7 +69,8 @@ public class TransformConstraint: PosedActive, Posed, Constraint {
|
||||
return Bone(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_transform_constraint_set_source(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
spine_transform_constraint_set_source(
|
||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,16 +95,20 @@ public class TransformConstraint: PosedActive, Posed, Constraint {
|
||||
}
|
||||
|
||||
public func copyAttachment(_ skeleton: Skeleton) -> TransformConstraint {
|
||||
let result = spine_transform_constraint_copy(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
let result = spine_transform_constraint_copy(
|
||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
return TransformConstraint(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_transform_constraint_update(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
spine_transform_constraint_update(
|
||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self),
|
||||
spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_transform_constraint_sort(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
spine_transform_constraint_sort(
|
||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
|
||||
@ -62,13 +62,16 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
||||
return BoneData(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_transform_constraint_data_set_source(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||
spine_transform_constraint_data_set_source(
|
||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self),
|
||||
newValue._ptr.assumingMemoryBound(to: spine_bone_data_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
public var offsetRotation: Float {
|
||||
get {
|
||||
let result = spine_transform_constraint_data_get_offset_rotation(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||
let result = spine_transform_constraint_data_get_offset_rotation(
|
||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||
return result
|
||||
}
|
||||
set {
|
||||
@ -98,7 +101,8 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
||||
|
||||
public var offsetScaleX: Float {
|
||||
get {
|
||||
let result = spine_transform_constraint_data_get_offset_scale_x(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||
let result = spine_transform_constraint_data_get_offset_scale_x(
|
||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||
return result
|
||||
}
|
||||
set {
|
||||
@ -108,7 +112,8 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
||||
|
||||
public var offsetScaleY: Float {
|
||||
get {
|
||||
let result = spine_transform_constraint_data_get_offset_scale_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||
let result = spine_transform_constraint_data_get_offset_scale_y(
|
||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||
return result
|
||||
}
|
||||
set {
|
||||
@ -118,7 +123,8 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
||||
|
||||
public var offsetShearY: Float {
|
||||
get {
|
||||
let result = spine_transform_constraint_data_get_offset_shear_y(_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||
let result = spine_transform_constraint_data_get_offset_shear_y(
|
||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||
return result
|
||||
}
|
||||
set {
|
||||
@ -177,7 +183,9 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
||||
}
|
||||
|
||||
public func createMethod(_ skeleton: Skeleton) -> Constraint {
|
||||
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))
|
||||
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))
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
|
||||
@ -109,7 +109,9 @@ public class TransformConstraintPose: NSObject {
|
||||
}
|
||||
|
||||
public func set(_ pose: TransformConstraintPose) {
|
||||
spine_transform_constraint_pose_set(_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self), pose._ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
||||
spine_transform_constraint_pose_set(
|
||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self),
|
||||
pose._ptr.assumingMemoryBound(to: spine_transform_constraint_pose_wrapper.self))
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -48,16 +48,22 @@ public class TransformConstraintTimeline: CurveTimeline, ConstraintTimeline {
|
||||
|
||||
public var constraintIndex: Int32 {
|
||||
get {
|
||||
let result = spine_transform_constraint_timeline_get_constraint_index(_ptr.assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self))
|
||||
let result = spine_transform_constraint_timeline_get_constraint_index(
|
||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self))
|
||||
return result
|
||||
}
|
||||
set {
|
||||
spine_transform_constraint_timeline_set_constraint_index(_ptr.assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self), newValue)
|
||||
spine_transform_constraint_timeline_set_constraint_index(
|
||||
_ptr.assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self), newValue)
|
||||
}
|
||||
}
|
||||
|
||||
public func setFrame(_ 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)
|
||||
public func setFrame(
|
||||
_ 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)
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -52,7 +52,9 @@ open class VertexAttachment: Attachment {
|
||||
return ArrayInt(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_vertex_attachment_set_bones(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
||||
spine_vertex_attachment_set_bones(
|
||||
_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self),
|
||||
newValue._ptr.assumingMemoryBound(to: spine_array_int_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,7 +64,9 @@ open class VertexAttachment: Attachment {
|
||||
return ArrayFloat(fromPointer: result!)
|
||||
}
|
||||
set {
|
||||
spine_vertex_attachment_set_vertices(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self), newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
spine_vertex_attachment_set_vertices(
|
||||
_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self),
|
||||
newValue._ptr.assumingMemoryBound(to: spine_array_float_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,7 +88,8 @@ open class VertexAttachment: Attachment {
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
return BoundingBoxAttachment(
|
||||
fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
@ -100,16 +105,25 @@ open class VertexAttachment: Attachment {
|
||||
}
|
||||
}
|
||||
set {
|
||||
spine_vertex_attachment_set_timeline_attachment(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self), newValue?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||
spine_vertex_attachment_set_timeline_attachment(
|
||||
_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self),
|
||||
newValue?._ptr.assumingMemoryBound(to: spine_attachment_wrapper.self))
|
||||
}
|
||||
}
|
||||
|
||||
public func copyTo(_ other: VertexAttachment) {
|
||||
spine_vertex_attachment_copy_to(_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self), other._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||
spine_vertex_attachment_copy_to(
|
||||
_ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self),
|
||||
other._ptr.assumingMemoryBound(to: spine_vertex_attachment_wrapper.self))
|
||||
}
|
||||
|
||||
public func computeWorldVertices(_ 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)
|
||||
public func computeWorldVertices(
|
||||
_ 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)
|
||||
}
|
||||
|
||||
}
|
||||
@ -28,10 +28,11 @@
|
||||
*****************************************************************************/
|
||||
|
||||
import MetalKit
|
||||
#if canImport(UIKit)
|
||||
import UIKit
|
||||
|
||||
extension MTLClearColor {
|
||||
#if canImport(UIKit)
|
||||
import UIKit
|
||||
|
||||
extension MTLClearColor {
|
||||
init(_ color: UIColor) {
|
||||
var red: CGFloat = 0
|
||||
var green: CGFloat = 0
|
||||
@ -42,5 +43,5 @@ extension MTLClearColor {
|
||||
|
||||
self.init(red: Double(red), green: Double(green), blue: Double(blue), alpha: Double(alpha))
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -28,8 +28,8 @@
|
||||
*****************************************************************************/
|
||||
|
||||
import Foundation
|
||||
import SpineSwift
|
||||
import SpineShadersStructs
|
||||
import SpineSwift
|
||||
import simd
|
||||
|
||||
extension RenderCommand {
|
||||
@ -41,7 +41,8 @@ extension RenderCommand {
|
||||
guard let indicesPtr = indices,
|
||||
let positionsPtr = positions,
|
||||
let uvsPtr = uvs,
|
||||
let colorsPtr = colors else {
|
||||
let colorsPtr = colors
|
||||
else {
|
||||
return vertices
|
||||
}
|
||||
let indicesArray = Array(UnsafeBufferPointer(start: indicesPtr, count: numInds))
|
||||
|
||||
@ -29,10 +29,11 @@
|
||||
|
||||
import CoreGraphics
|
||||
import Foundation
|
||||
#if canImport(UIKit)
|
||||
import UIKit
|
||||
|
||||
extension SkeletonDrawableWrapper {
|
||||
#if canImport(UIKit)
|
||||
import UIKit
|
||||
|
||||
extension SkeletonDrawableWrapper {
|
||||
|
||||
/// Render the ``Skeleton`` to a `CGImage`
|
||||
///
|
||||
@ -85,6 +86,6 @@ extension SkeletonDrawableWrapper {
|
||||
}
|
||||
return cgImage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -29,9 +29,9 @@
|
||||
|
||||
import Foundation
|
||||
import MetalKit
|
||||
import SpineSwift
|
||||
import SpineC
|
||||
import SpineShadersStructs
|
||||
import SpineSwift
|
||||
|
||||
protocol SpineRendererDelegate: AnyObject {
|
||||
func spineRendererWillUpdate(_ spineRenderer: SpineRenderer)
|
||||
|
||||
@ -135,7 +135,7 @@ public final class SkeletonDrawableWrapper: NSObject {
|
||||
public func update(delta: Float) {
|
||||
if disposed { return }
|
||||
|
||||
skeletonDrawable.update(delta);
|
||||
skeletonDrawable.update(delta)
|
||||
}
|
||||
|
||||
public func dispose() {
|
||||
|
||||
@ -30,8 +30,8 @@
|
||||
import CoreGraphics
|
||||
import Foundation
|
||||
import QuartzCore
|
||||
import UIKit
|
||||
import SpineSwift
|
||||
import UIKit
|
||||
|
||||
public typealias SpineControllerCallback = (_ controller: SpineController) -> Void
|
||||
|
||||
|
||||
@ -28,8 +28,8 @@
|
||||
*****************************************************************************/
|
||||
|
||||
import MetalKit
|
||||
import UIKit
|
||||
import SpineSwift
|
||||
import UIKit
|
||||
|
||||
/// A ``UIView`` to display a Spine skeleton. The skeleton can be loaded from a bundle, local files, http, or a pre-loaded ``SkeletonDrawableWrapper``.
|
||||
///
|
||||
|
||||
@ -16,7 +16,7 @@ let package = Package(
|
||||
name: "SpineTest",
|
||||
dependencies: [
|
||||
.product(name: "SpineC", package: "spine-runtimes"),
|
||||
.product(name: "SpineSwift", package: "spine-runtimes")
|
||||
.product(name: "SpineSwift", package: "spine-runtimes"),
|
||||
],
|
||||
path: "src"
|
||||
)
|
||||
|
||||
@ -65,7 +65,8 @@ func runSkeletonDrawableTestSwift() {
|
||||
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)")
|
||||
print(
|
||||
" Bounds after setupPose: x=\(boundsAfterPose.x), y=\(boundsAfterPose.y), width=\(boundsAfterPose.width), height=\(boundsAfterPose.height)")
|
||||
|
||||
// Test position
|
||||
let position = drawable.skeleton.getPosition()
|
||||
@ -114,7 +115,9 @@ func runSkeletonDrawableTestSwift() {
|
||||
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)")
|
||||
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:")
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
group=com.esotericsoftware.spine
|
||||
version=4.3.0-SNAPSHOT
|
||||
libgdx_version=1.13.5
|
||||
libgdx_version=1.13.6-SNAPSHOT
|
||||
POM_NAME=spine-libgdx
|
||||
POM_DESCRIPTION=Spine Runtime for libGDX
|
||||
POM_URL=https://github.com/esotericsoftware/spine-runtimes
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user