Comments (6)
Ping.
from phaser-plugin-isometric.
@lewster32 what if we rotate the tile so that'll be parallel to the isometric axes?
from phaser-plugin-isometric.
Sorry for the delay - yes, you cannot rotate bodies as their edges must be aligned to the isometric axes. Rotating doesn't really make a lot of sense in an isometric scene as due to the sprites being 3D representations, any rotations would typically have to be entirely redrawn (i.e. entirely different frames, rather than just transformations to an existing frame). I don't think I'm entirely understanding what you're trying to achieve, so if you have an example then I can try to be more specific, and maybe suggest workarounds.
from phaser-plugin-isometric.
@lewster32 Sorry for my late reply as well, the following is what I'm trying to achieve:
BTW: sorry, it's not a usual rotation, we're not using any trig functions, simply flipping x and y axis.
Guessing the following does the flipping transformation y=x, after applying it the bouds don't get recalculated.
var cow = game.add.isoSprite(100, 100, 0, 'animal-cow-brown', 0);
cow.width *= -1;
How do we calculate the bound of an object?
What about the height of an isometric object?
I think there must be something wrong with the bounds calculation, they don't seem accurate.
from phaser-plugin-isometric.
Does flipping the scale not work? That is how I'd normally do this in Phaser.
cow.scale.x *= -1
from phaser-plugin-isometric.
Appears not - the issue seems to be that bounds are initially derived from the sprite size and assumed to be cubic. When changing the scale or width, any non-cubic bounds are not then automatically updated. I guess the workaround is to manually update the bounds yourself when changing the orientation of the sprite, as there is naturally a looser orientation between the sprite and its body with an isometric system; it has to assume some basic things about the sprite, as it cannot interpret any orientation or shape other than the cubic bounds it should occupy for its size.
In order to set your own bounds, you would use cow.body.setSize
as documented here.
from phaser-plugin-isometric.
Related Issues (20)
- how to draw staggered tilemaps? HOT 9
- Cannot read property '4' of undefined HOT 1
- License HOT 2
- World scaling wrong mouse iso position HOT 6
- Does this plugin support isometric tilemaps? HOT 2
- Static bodies HOT 4
- Jumping doesn't work when holding LEFT + UP HOT 3
- Update npm version to latest HOT 1
- Types (possibly) diverged from Phaser? HOT 2
- Objects that are not cubes HOT 1
- isometric wall HOT 2
- isoSprite _isoPositionChanged is broken HOT 2
- TypeScript: Possibly wrong typing of IsoSprite.isoBounds
- typings may be off
- sprite.anchor broken HOT 2
- isoArcade.setBounds does not update octree HOT 2
- The scale problems in isobounds tile
- Porting to Phaser 3 HOT 3
- Outdated type definitions
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 phaser-plugin-isometric.