Draw Status Bar

This commit is contained in:
ckcz123 2018-05-06 17:32:56 +08:00
parent 0586297d85
commit 992511160e
4 changed files with 38 additions and 10 deletions

View File

@ -46,7 +46,22 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
"_leaf": true,
"_type": "textarea",
"_data": "难度选择:每个数组的第一个是其在标题界面显示的难度,第二个是在游戏内部传输的字符串,会显示在状态栏,修改此处后需要在project/functions中作相应更改"
}
},
"statusLeftBackground": {
"_leaf": true,
"_type": "textarea",
"_data": "横屏时左侧状态栏的背景样式,可以定义背景图、平铺方式等。\n具体请网上搜索\"css background\"了解写法。\n如果弄一张图片作为背景图推荐写法\n\"url(project/images/XXX.png) 0 0/100% 100% no-repeat\""
},
"statusTopBackground": {
"_leaf": true,
"_type": "textarea",
"_data": "竖屏时上方状态栏的背景样式,可以定义背景图、平铺方式等。\n具体请网上搜索\"css background\"了解写法。\n如果弄一张图片作为背景图推荐写法\n\"url(project/images/XXX.png) 0 0/100% 100% no-repeat\""
},
"toolsBackground": {
"_leaf": true,
"_type": "textarea",
"_data": "竖屏时下方道具栏的背景样式,可以定义背景图、平铺方式等。\n具体请网上搜索\"css background\"了解写法。\n如果弄一张图片作为背景图推荐写法\n\"url(project/images/XXX.png) 0 0/100% 100% no-repeat\""
},
}
},
"firstData": {

View File

@ -2344,7 +2344,7 @@ control.prototype.resize = function(clientWidth, clientHeight) {
statusWidth, statusHeight, statusMaxWidth,statusLabelsLH,
toolBarWidth, toolBarHeight, toolBarTop, toolBarBorder,
toolsWidth, toolsHeight,toolsMargin,toolsPMaxwidth,
fontSize, toolbarFontSize, margin;
fontSize, toolbarFontSize, margin, statusBackground, toolsBackground;
var count = core.dom.statusBar.children.length;
if (!core.flags.enableFloor) count--;
@ -2403,12 +2403,14 @@ control.prototype.resize = function(clientWidth, clientHeight) {
statusHeight = scale*BASE_LINEHEIGHT * .8;
statusLabelsLH = .8 * BASE_LINEHEIGHT *scale;
statusMaxWidth = scale * DEFAULT_BAR_WIDTH * .95;
statusBackground = main.statusTopBackground;
toolBarHeight = tempBotBarH;
toolBarTop = statusBarHeight + canvasWidth;
toolBarBorder = '3px #fff solid';
toolsHeight = scale * BASE_LINEHEIGHT;
toolsPMaxwidth = scale * DEFAULT_BAR_WIDTH * .4;
toolsBackground = main.toolsBackground;
borderRight = '3px #fff solid';
margin = scale * SPACE * 2;
@ -2423,15 +2425,17 @@ control.prototype.resize = function(clientWidth, clientHeight) {
canvasTop = 0;
// canvasLeft = DEFAULT_BAR_WIDTH * scale;
toolBarWidth = statusBarWidth = DEFAULT_BAR_WIDTH * scale;
statusBarHeight = scale * statusLineHeight * count + SPACE * 2; //一共有9行加上两个padding空隙
statusBarHeight = gameGroupHeight - SPACE;
statusBarBorder = '3px #fff solid';
statusBackground = main.statusLeftBackground;
statusHeight = scale*statusLineHeight * .8;
statusLabelsLH = .8 * statusLineHeight *scale;
toolBarHeight = canvasWidth - statusBarHeight;
toolBarTop = scale*statusLineHeight * count + SPACE * 2;
toolBarHeight = canvasWidth - toolBarTop;
toolBarBorder = '3px #fff solid';
toolsHeight = scale * BASE_LINEHEIGHT;
toolsBackground = 'transparent';
fontSize = statusLineFontSize * scale;
toolbarFontSize = DEFAULT_FONT_SIZE * scale;
borderRight = '';
@ -2454,12 +2458,15 @@ control.prototype.resize = function(clientWidth, clientHeight) {
// canvasLeft = DEFAULT_BAR_WIDTH;
toolBarWidth = statusBarWidth = DEFAULT_BAR_WIDTH;
statusBarHeight = statusLineHeight * count + SPACE * 2; //一共有9行
// statusBarHeight = statusLineHeight * count + SPACE * 2; //一共有9行
statusBackground = main.statusLeftBackground;
statusBarHeight = gameGroupHeight - SPACE;
statusHeight = statusLineHeight * .8;
statusLabelsLH = .8 * statusLineHeight;
toolBarHeight = DEFAULT_CANVAS_WIDTH - statusBarHeight;
toolBarTop = statusLineHeight * count + SPACE * 2;
toolBarHeight = DEFAULT_CANVAS_WIDTH - toolBarTop;
toolsBackground = 'transparent';
toolsHeight = BASE_LINEHEIGHT;
borderRight = '';
@ -2540,7 +2547,8 @@ control.prototype.resize = function(clientWidth, clientHeight) {
borderTop: statusBarBorder,
borderLeft: statusBarBorder,
borderRight: borderRight,
fontSize: fontSize + unit
fontSize: fontSize + unit,
background: statusBackground,
}
},
{
@ -2570,7 +2578,8 @@ control.prototype.resize = function(clientWidth, clientHeight) {
borderBottom: toolBarBorder,
borderLeft: toolBarBorder,
borderRight: borderRight,
fontSize: toolbarFontSize + unit
fontSize: toolbarFontSize + unit,
background: toolsBackground,
}
},
{

View File

@ -19,6 +19,9 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"startBackground" : "bg.jpg",
"startLogoStyle" : "color: black",
"levelChoose" : [["简单","Easy"],["普通","Normal"],["困难","Hard"],["噩梦","Hell"]],
"statusLeftBackground": "url(project/images/ground.png) repeat",
"statusTopBackground": "url(project/images/ground.png) repeat",
"toolsBackground": "url(project/images/ground.png) repeat"
},
"firstData" : {
"title": "魔塔样板",
@ -129,6 +132,7 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
'counterAttack': 0.1,
'purify': 3,
'hatred': 2,
'maxValidHp': null,
'animateSpeed': 300,
},

View File

@ -170,7 +170,7 @@
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
background: url(project/images/ground.png) repeat;
z-index: 160;
z-index: 150;
display: none;
}
#statusBar .status{
@ -199,7 +199,7 @@
#toolBar {
position: absolute;
background: url(project/images/ground.png) repeat;
z-index: 150;
z-index: 160;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;