Comments (4)
Hello @gnesher! Strings are accepted as valid for game height and width because you might want to use percentages (f.e. 60% width and 100% height). Even though I haven't used this yet, I would leave it. Is that what you meant?
Have a look at the official phaser code.
from phaser3-typescript.
Oh interesting. I've been following a simple tutorial (https://gamedevacademy.org/phaser-3-tutorial/) which tells you to put a sprite in the middle of the screen using this.sys.game.config.height / 2 which is now invalid. Not sure how to work around that except to manually cast these to number when I know the value
from phaser3-typescript.
That is true, this will be invalid. The best thing would be probably, that if you choose to use a string f.e. 20%, that the phaser framework would calculate the absolute size and save that as the width so you can access it with this.sys.game.config.height
. Maybe something to discuss in the official phaser respository?
from phaser3-typescript.
@gnesher Are you going to open a discussion in the official phaser repository or will you leave it as it is?
from phaser3-typescript.
Related Issues (20)
- Generate phaser.d.ts HOT 2
- webpack phaser expose-loader config HOT 4
- one big js file vs multiple smaller js files? HOT 2
- "space-shooter" is not displayed 😭 HOT 1
- "endless-runner" does not start 😭 HOT 1
- "flappy-bird" title display is incorrect HOT 1
- Building fails with phaser 3.16.1 HOT 2
- VS Code debugging HOT 3
- webpack-boilerplate does not compile HOT 14
- Webpack config for production? HOT 4
- npm run dev missing script error
- SmoothedKeyControlConfig missing down key property
- Phaser 3.18 HOT 3
- Proposal to Update the Parcel Boilerplate Starter to V2. HOT 1
- Make repository a Template Repository HOT 2
- Image links broken in README.md file HOT 7
- Make a example RPG game! HOT 1
- Most games are not compiling HOT 2
- Webpack template not functioning correctly. 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 phaser3-typescript.