Comments (2)
You're not using it incorrectly. This appears to be a bug triggered by adding a physics component. I'm not super familiar with that Phaser sub-system, so I'm not sure what's going wrong. I'll update the issue once I've figured it out.
from spine-runtimes.
In Phaser, if you use arcade
physics and set the scaleX
to a negative number will result in having the physics body reflected regardless on the usage of a SpineGameObject or a normal GameObject.
It's possible to get the very same result of the video on this phaser playground example adding block.scaleX = -block.scaleX;
as latest line of the create
function. The debug bounding box is reflected on the right of the brown box:
We have to consider that to flip a GameObject in Phaser, it seems that there are flip methods. In this case the setFlipX(boolean)
should be used.
It's important to notice this part of the Phaser flip documentation:
If this Game Object has a physics body, it will not change the body. This is a rendering toggle only.
So in general it's the user that has to take care of the GameObject body position for some operation (such as rotation) on the GameObject - at least for arcade
physics.
However, when using setFlipX(boolean)
on a SpineGameObject, it is not flipped. We should do that probably and will make a fix to it.
In any case, my advice is to explore also the matter
physics system. That is definitely more advanced and your use case would work out of the box.
Indeed, scaling with negative numbers in matter
won't produce the effect of reflecting the GameObject body.
from spine-runtimes.
Related Issues (20)
- [phaser] texture flicker when creating new SpineGameObject HOT 1
- [ts][threejs] Blending mode not working properly
- [cocos2dx] Double free warning in Spine Examples HOT 2
- [player] Allow loading different data files. HOT 1
- [sfml] Multiply blend mode + non-PMA doesn't look correct on Celestial Circus HOT 1
- [ts] WebGPU support and Spine-Pixi runtime HOT 2
- [c] Scale Problem after 4.2 Upgrade HOT 4
- [ue] The cast shadow is slightly off the skeleton's boundary when using `SpineLitNormalMaterial`. HOT 1
- [runtimes] Copy constructor for Constraints reference bones and slots of the original skeleton HOT 2
- [spine-csharp] Skeleton.PhysicsRotate references the field r instead of the parameter x HOT 1
- [unity] SkeletonGraphicRenderTexture example component RenderTexture distorted
- [godot] Crash in SpineSlotNode if SpineSprite parent does not have skeleton data set HOT 5
- [runtimes] Skeleton.getBounds() should apply clipping
- [godot] Leak in editor when scene with multiple SpineSpriteNodes is open
- [spine-csharp] MathUtils.Atan2Deg isn't defined when USE_FAST_SIN_COS_ATAN2_APPROXIMATIONS is defined HOT 1
- [TS] MixDuration setter issues HOT 3
- [unity] UpdateWhenInvisible incorrect when using SkeletonRenderSeparator
- [unity] SkeletonGraphicRenderTexture incorrect alpha blending
- [ue] The `SetSlotColor` node accepts only 0 or 1 `Color` value, despite its parameters being of byte types.
- [ue] Quickly support UE5.4.1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spine-runtimes.