支持额外的字体文件
This commit is contained in:
parent
a4e3bd904f
commit
47283d30a9
@ -91,6 +91,18 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
|
|||||||
"_docs": "本塔使用音效",
|
"_docs": "本塔使用音效",
|
||||||
"_data": "在此存放所有的SE,和文件名一致 \n音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好"
|
"_data": "在此存放所有的SE,和文件名一致 \n音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好"
|
||||||
},
|
},
|
||||||
|
"fonts": {
|
||||||
|
"_leaf": true,
|
||||||
|
"_type": "material",
|
||||||
|
"_range": "editor.mode.checkUnique(thiseval)",
|
||||||
|
"_directory": "./project/fonts/",
|
||||||
|
"_transform": (function (one) {
|
||||||
|
if (one.endsWith(".ttf")) return one.substring(0, one.lastIndexOf('.'));
|
||||||
|
return null;
|
||||||
|
}).toString(),
|
||||||
|
"_docs": "本塔使用字体",
|
||||||
|
"_data": "在此存放所有可能使用的字体 \n 字体名不能使用中文,不能带空格或特殊字符"
|
||||||
|
},
|
||||||
"nameMap": {
|
"nameMap": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
|||||||
14
main.js
14
main.js
@ -215,6 +215,7 @@ main.prototype.init = function (mode, callback) {
|
|||||||
main.dom.levelChooseButtons.appendChild(span);
|
main.dom.levelChooseButtons.appendChild(span);
|
||||||
});
|
});
|
||||||
main.createOnChoiceAnimation();
|
main.createOnChoiceAnimation();
|
||||||
|
main.importFonts(main.fonts);
|
||||||
|
|
||||||
main.loadJs('libs', main.loadList, function () {
|
main.loadJs('libs', main.loadList, function () {
|
||||||
main.core = core;
|
main.core = core;
|
||||||
@ -371,6 +372,19 @@ main.prototype.selectButton = function (index) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 创建字体 //////
|
||||||
|
main.prototype.importFonts = function (fonts) {
|
||||||
|
if (!(fonts instanceof Array) || fonts.length == 0) return;
|
||||||
|
var style = document.createElement('style');
|
||||||
|
style.type = 'text/css';
|
||||||
|
var html = '';
|
||||||
|
fonts.forEach(function (font) {
|
||||||
|
html += '@font-face { font-family: "'+font+'"; src: url("project/fonts/'+font+'.ttf") format("truetype")';
|
||||||
|
});
|
||||||
|
style.innerHTML = html;
|
||||||
|
document.body.appendChild(style);
|
||||||
|
}
|
||||||
|
|
||||||
main.prototype.listen = function () {
|
main.prototype.listen = function () {
|
||||||
|
|
||||||
////// 窗口大小变化时 //////
|
////// 窗口大小变化时 //////
|
||||||
|
|||||||
@ -36,6 +36,9 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"bomb.mp3",
|
"bomb.mp3",
|
||||||
"centerFly.mp3"
|
"centerFly.mp3"
|
||||||
],
|
],
|
||||||
|
"fonts": [
|
||||||
|
"number"
|
||||||
|
],
|
||||||
"nameMap": {
|
"nameMap": {
|
||||||
"背景图.jpg": "bg.jpg",
|
"背景图.jpg": "bg.jpg",
|
||||||
"背景音乐.mp3": "bgm.mp3"
|
"背景音乐.mp3": "bgm.mp3"
|
||||||
|
|||||||
BIN
project/fonts/number.ttf
Normal file
BIN
project/fonts/number.ttf
Normal file
Binary file not shown.
@ -218,7 +218,7 @@
|
|||||||
max-height: 1.6em;
|
max-height: 1.6em;
|
||||||
}
|
}
|
||||||
#statusBar span{
|
#statusBar span{
|
||||||
font: bold italic 1.1em Verdana;
|
font: bold italic 1.1em number, Verdana;
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
#statusBar p {
|
#statusBar p {
|
||||||
|
|||||||
@ -52,9 +52,10 @@
|
|||||||
(已完成!) 素材替换
|
(已完成!) 素材替换
|
||||||
大屏幕下放大游戏界面
|
大屏幕下放大游戏界面
|
||||||
最近使用/最常使用的图块
|
最近使用/最常使用的图块
|
||||||
loader并行加载
|
(已完成!) loader并行加载
|
||||||
(已完成!) 合并items.js
|
合并items.js
|
||||||
增加fonts目录,全塔属性增加fonts引用
|
(已完成!) 增加fonts目录,全塔属性增加fonts引用
|
||||||
|
右边框输入完后解析按钮高亮
|
||||||
|
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user