Comments (4)
I'm thinking you're probably not doing it the best way. You should develop your game as if it weren't scaled and then simply use Phaser's scale mode to scale everything up. In your code you shouldn't need to scale visual elements individually - just use a small screen viewport e.g 320 x 240 pixels and then scale up transparently to the rest of your code using game scale / full screen.
Have a look at these examples:
Game scale example: https://phaser.io/examples/v2/input/game-scale
Full screen example: https://phaser.io/examples/v2/display/fullscreen
My own demo: https://github.com/colinvella/phaser-tilemap-plus-demo/blob/master/src/states/BootState.js
from phaser-tilemap-plus.
Hi Michael,
I did not take into account map scaling. So you are essentially scaling one of your visible layers. Obviously the object layer (any the associated shape layer) are not aware of this. Perhaps I can modify the enablePhysics method so that into account the object layer's scale and all you would have to do is to set the same scale to both layers before calling enablePhysics().
from phaser-tilemap-plus.
Thanks for your fast reply! A modification would help me a lot. I'm making a pixelart game and I need to scale all the layers and assets.
A small production preview of the game: https://deploy-vvjtaljwgx.now.sh/
Thank you for the effort!
from phaser-tilemap-plus.
Thank you so much! It works! Your Demo really helped me a lot. I had a misunderstanding of how scaling a game works.
from phaser-tilemap-plus.
Related Issues (11)
- [Issue] Multiple collisions on a sprite HOT 5
- this.game.tilemap is undefined
- Support for Phaser 3? HOT 1
- Thank you for your work! HOT 1
- "Tile Layer Format" matters! HOT 2
- `tilemap.removeTile` etc operations don't modify `plus.tileAnimations` HOT 3
- Cannot read property 'properties" of null HOT 7
- cannot read property 'plus' of undefined HOT 3
- Trigger Tile Animation on Region Based Event HOT 2
- Loading tilemap with preloaded json object not working 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 phaser-tilemap-plus.