mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
Replace direct bounds calculation with BoundsProvider interface for better performance and correctness. This makes it easier to get the correct bounds. BREAKING CHANGES: - SkeletonSprite extends FlxTypedGroup<FlxObject> rather than FlxObject. This was necessary because the FlxObject bounding/hitbox is always connected to its position and size and cannot be offset. - Removed getAnimationBounds() method. Replace it with the appropriate BoundsProvider implementation based on your use case, or create your own. - Removed setBoundingBox(). Use BoundsProvider features. - hitTest() now uses the assigned BoundsProvider instead of direct calculation. For accurate hit testing, use CurrentPoseBoundsProvider and call calculateBounds() each frame or on click. New features: - Uses BoundsProvider as starling. - SkeletonSprite constructor now accepts a third optional parameter for BoundsProvider. SetupPoseBoundsProvider is used by default. - Added calculateBounds() to recalculate bounds on demand.
45 lines
778 B
JSON
45 lines
778 B
JSON
{
|
|
"bones": [
|
|
{ "name": "root" },
|
|
{
|
|
"name": "pivot",
|
|
"parent": "root",
|
|
"scaleX": 1,
|
|
"scaleY": 1,
|
|
"rotation": 0,
|
|
"x": 20,
|
|
"y": -20
|
|
},
|
|
{
|
|
"name": "pivot2",
|
|
"parent": "pivot",
|
|
"scaleX": 1,
|
|
"scaleY": 1,
|
|
"rotation": 0,
|
|
"x": 20,
|
|
"y": -20
|
|
},
|
|
{
|
|
"name": "replaceMe",
|
|
"parent": "pivot2",
|
|
"scaleX": 1,
|
|
"scaleY": 1,
|
|
"rotation": 0,
|
|
"x": 20,
|
|
"y": -20
|
|
}
|
|
],
|
|
"slots": [
|
|
{ "name": "replaceMe", "bone": "replaceMe", "attachment": "image" }
|
|
],
|
|
"skins": [
|
|
{
|
|
"name": "default",
|
|
"attachments": {
|
|
"replaceMe": { "image": { "width": 100, "height": 100 } }
|
|
}
|
|
}
|
|
],
|
|
"animations": { "animation": {} }
|
|
}
|