基于arcadephysics编译出来的phaser,做了一些修改。
解决了以下移植问题:
- PIXI not defined
- canvas的指定
- touch事件问题
- 音频播放问题
- atlas文件加载
飞机大战demo完工,源码目录:js/plane
完成了demo展示的基本框架 完成了主菜单和子菜单的功能
basic移植完毕 开放域相关功能完毕
中文插件移植完工,源码目录:js/plugins/ChineseTextPlugin.js
适配微信小游戏的Phaser以及它的demo集合
Home Page: https://www.phaser-china.com/
项目中要是把字体调小后,文字会非常模糊,
let game = new Phaser.Game({
width: 667,
height: 375,
renderer: Phaser.CANVAS,
antialias: true,
resolution: window.devicePixelRatio,
canvas: canvas
})
在main.js
中resolution: window.devicePixelRatio
开启这配置后,字体是清晰了,但是项目在state
跳转后,某些就会出现字体变大的效果。不知道用什么方式能解决的
你好,用的时候用phaser的canvas打出来的文字发虚,我看demo里有的文字也是这样的,这个有好办法解决吗?
var game = new Phaser.Game({
width: 240,
height: 400,
backgroundColor: '#d00',
renderer: Phaser.CANVAS,
canvas: document.getElementsByTagName('canvas')[0],
state: {
create: create
}
})
function create() {
console.log(1111)
// game.stage.setBackgroundColor('#999999');
// 文本
var style = { font: '65px Arial', fill: '#ff0044', align: 'center' }
var text = game.add.text(
game.world.centerX,
game.world.centerY,
'- phaser -\nwith a sprinkle of\npixi dust',
style
)
text.anchor.set(0.5)
}
canvas取到了oppo小游戏中全局暴露的canvas,但是打包运行还是没显示画布,设置背景颜色也没用,浏览器都是正常的。
跟浏览器比,浏览器是真实dom,小游戏是虚拟dom,这个有关系吗。
作者你好,我在基于你重构的phaser.js来开发微信小游戏,在开发过程中要到物理殷勤,加载的时候要用到加载json文件。但是报错了,可以指点殷勤哪里修复这个问题吗?期待你的回答!
现在小游戏和小程序加载方式还是有很大差别,求助
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.