mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[monogame] Added Changelog entry for external physics movement and skeleton.PhysicsTranslate().
This commit is contained in:
parent
de6b411007
commit
fb4f5b070d
10
CHANGELOG.md
10
CHANGELOG.md
@ -113,7 +113,6 @@
|
|||||||
## C#
|
## C#
|
||||||
|
|
||||||
- **Additions**
|
- **Additions**
|
||||||
|
|
||||||
- Added [`TrackEntry.AlphaAttachmentThreshold`](http://esotericsoftware.com/spine-api-reference#TrackEntry-alphaAttachmentThreshold).
|
- Added [`TrackEntry.AlphaAttachmentThreshold`](http://esotericsoftware.com/spine-api-reference#TrackEntry-alphaAttachmentThreshold).
|
||||||
|
|
||||||
- **Breaking changes**
|
- **Breaking changes**
|
||||||
@ -173,6 +172,15 @@
|
|||||||
- **Restructuring (Non-Breaking)**
|
- **Restructuring (Non-Breaking)**
|
||||||
|
|
||||||
### XNA/MonoGame
|
### XNA/MonoGame
|
||||||
|
- **Additions**
|
||||||
|
- Apply external movement to physics: If you are not directly modifying `Skeleton.X` or `Skeleton.Y`, you can apply external game object movement to skeleton physics as follows:
|
||||||
|
Add a `Vector2 lastPosition;` member variable to your class interacting with the skeleton. Then call e.g. the following code each frame:
|
||||||
|
```
|
||||||
|
Vector2 currentPosition = <current world position>;
|
||||||
|
Vector2 externalPositionDelta = currentPosition - lastPosition;
|
||||||
|
skeleton.PhysicsTranslate(externalPositionDelta.x, externalPositionDelta.y);
|
||||||
|
lastPosition = currentPosition;
|
||||||
|
```
|
||||||
|
|
||||||
## Java
|
## Java
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user