Merge pull request #234 from ckcz123/v2.0

V2.0
This commit is contained in:
Zhang Chen 2018-10-12 00:37:00 +08:00 committed by GitHub
commit d76d36d0aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View File

@ -8,9 +8,7 @@ HTML5 canvas制作的魔塔样板支持全平台游戏
* [List / HTML5魔塔游戏列表](https://h5mota.com/)
* [Demo / 样板效果](https://ckcz123.com/games/template/)
* [Docs / 使用文档说明](https://ckcz123.github.io/mota-js/)
<!--
* [Video / 视频教程](http://www.bilibili.com/video/av17608025/)
-->
* [Video / 视频教程](https://www.bilibili.com/video/av32781473/)
![样板](./docs/img/sample0.png)
## 目录结构
@ -43,13 +41,13 @@ HTML5 canvas制作的魔塔样板支持全平台游戏
│ ├─ icons.js # 素材和ID的对应关系定义
│ ├─ items.js # 道具的定义,获得道具的效果
│ └─ maps.js # 地图和数字的对应关系
├── /常用工具/ # 一些常用工具,可以辅助造塔
├── /常用工具/ # 一些常用工具,可以辅助造塔;具体可参见下面的【相关工具】
├── editor.html # 可视化地图编辑工具
├── editor-mobile.html # 可视化地图编辑工具(手机版)
├── index.html # 主程序,游戏的入口
├── main.js # JS程序的入口将动态对所需JS进行加载
├── style.css # 游戏所需要用到的样式表
└── 启动服务.exe # 一个本地的HTTP服务器也能支撑前端的一些POST请求从而能拓展JS的IO功能。 http://github.com/ckcz123/mota-js-server/
└── 启动服务.exe # 一个本地的HTTP服务器也能支撑前端的一些POST请求从而能拓展JS的IO功能。
```
## 更新说明
@ -315,6 +313,7 @@ HTML5 canvas制作的魔塔样板支持全平台游戏
## 相关工具
- [启动服务](http://github.com/ckcz123/mota-js-server/) 一个本地的HTTP服务器也能支撑前端的一些POST请求从而能拓展JS的IO功能。
- [RM动画导出器](http://github.com/ckcz123/animate_export/)能从RMXP中导出动画以供H5使用。
- [JS代码压缩工具](http://github.com/ckcz123/JSCompressor/)能对Javascript代码进行压缩和整合从而减少IO请求量。
- [便捷PS工具](http://github.com/ckcz123/ps/)能只用复制和粘贴来快速对素材进行PS操作。

View File

@ -13,6 +13,8 @@
继续查看文档的详细介绍让你学会如何使用这一个样板来制作属于自己的HTML5魔塔。
本说明文档配有B站视频教程对照查看效果更佳哦[https://www.bilibili.com/video/av32781473/](https://www.bilibili.com/video/av32781473/)。
==========================================================================================
[继续阅读下一章现在就做出自己的第一部H5魔塔](start)

View File

@ -2657,17 +2657,16 @@ control.prototype.updateHeroIcon = function (name) {
core.statusBar.icons.name = name;
var image = core.material.images.hero;
// 全身图
var height = core.material.icons.hero.height;
var ratio = 32 / height, width = 32 * ratio, left = 16-width/2;
var canvas = document.createElement("canvas");
var context = canvas.getContext("2d");
canvas.width = 32;
canvas.height = 32;
context.drawImage(image, 0, 0, 32, 32, 0, 0, 32, 32);
if (core.material.icons.hero.height>=48) {
context.lineWidth = 5;
context.strokeStyle = '#FFFFFF';
context.strokeRect(0, 0, 32, 32);
}
context.drawImage(image, 0, 0, 32, height, left, 0, width, 32);
core.statusBar.image.name.src = canvas.toDataURL("image/png");
}