Draw Status Bar
This commit is contained in:
parent
0586297d85
commit
992511160e
@ -46,7 +46,22 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
"_data": "难度选择:每个数组的第一个是其在标题界面显示的难度,第二个是在游戏内部传输的字符串,会显示在状态栏,修改此处后需要在project/functions中作相应更改"
|
"_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": {
|
"firstData": {
|
||||||
|
|||||||
@ -2344,7 +2344,7 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
statusWidth, statusHeight, statusMaxWidth,statusLabelsLH,
|
statusWidth, statusHeight, statusMaxWidth,statusLabelsLH,
|
||||||
toolBarWidth, toolBarHeight, toolBarTop, toolBarBorder,
|
toolBarWidth, toolBarHeight, toolBarTop, toolBarBorder,
|
||||||
toolsWidth, toolsHeight,toolsMargin,toolsPMaxwidth,
|
toolsWidth, toolsHeight,toolsMargin,toolsPMaxwidth,
|
||||||
fontSize, toolbarFontSize, margin;
|
fontSize, toolbarFontSize, margin, statusBackground, toolsBackground;
|
||||||
|
|
||||||
var count = core.dom.statusBar.children.length;
|
var count = core.dom.statusBar.children.length;
|
||||||
if (!core.flags.enableFloor) count--;
|
if (!core.flags.enableFloor) count--;
|
||||||
@ -2403,12 +2403,14 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
statusHeight = scale*BASE_LINEHEIGHT * .8;
|
statusHeight = scale*BASE_LINEHEIGHT * .8;
|
||||||
statusLabelsLH = .8 * BASE_LINEHEIGHT *scale;
|
statusLabelsLH = .8 * BASE_LINEHEIGHT *scale;
|
||||||
statusMaxWidth = scale * DEFAULT_BAR_WIDTH * .95;
|
statusMaxWidth = scale * DEFAULT_BAR_WIDTH * .95;
|
||||||
|
statusBackground = main.statusTopBackground;
|
||||||
toolBarHeight = tempBotBarH;
|
toolBarHeight = tempBotBarH;
|
||||||
|
|
||||||
toolBarTop = statusBarHeight + canvasWidth;
|
toolBarTop = statusBarHeight + canvasWidth;
|
||||||
toolBarBorder = '3px #fff solid';
|
toolBarBorder = '3px #fff solid';
|
||||||
toolsHeight = scale * BASE_LINEHEIGHT;
|
toolsHeight = scale * BASE_LINEHEIGHT;
|
||||||
toolsPMaxwidth = scale * DEFAULT_BAR_WIDTH * .4;
|
toolsPMaxwidth = scale * DEFAULT_BAR_WIDTH * .4;
|
||||||
|
toolsBackground = main.toolsBackground;
|
||||||
borderRight = '3px #fff solid';
|
borderRight = '3px #fff solid';
|
||||||
|
|
||||||
margin = scale * SPACE * 2;
|
margin = scale * SPACE * 2;
|
||||||
@ -2423,15 +2425,17 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
canvasTop = 0;
|
canvasTop = 0;
|
||||||
// canvasLeft = DEFAULT_BAR_WIDTH * scale;
|
// canvasLeft = DEFAULT_BAR_WIDTH * scale;
|
||||||
toolBarWidth = statusBarWidth = 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';
|
statusBarBorder = '3px #fff solid';
|
||||||
|
statusBackground = main.statusLeftBackground;
|
||||||
|
|
||||||
statusHeight = scale*statusLineHeight * .8;
|
statusHeight = scale*statusLineHeight * .8;
|
||||||
statusLabelsLH = .8 * statusLineHeight *scale;
|
statusLabelsLH = .8 * statusLineHeight *scale;
|
||||||
toolBarHeight = canvasWidth - statusBarHeight;
|
|
||||||
toolBarTop = scale*statusLineHeight * count + SPACE * 2;
|
toolBarTop = scale*statusLineHeight * count + SPACE * 2;
|
||||||
|
toolBarHeight = canvasWidth - toolBarTop;
|
||||||
toolBarBorder = '3px #fff solid';
|
toolBarBorder = '3px #fff solid';
|
||||||
toolsHeight = scale * BASE_LINEHEIGHT;
|
toolsHeight = scale * BASE_LINEHEIGHT;
|
||||||
|
toolsBackground = 'transparent';
|
||||||
fontSize = statusLineFontSize * scale;
|
fontSize = statusLineFontSize * scale;
|
||||||
toolbarFontSize = DEFAULT_FONT_SIZE * scale;
|
toolbarFontSize = DEFAULT_FONT_SIZE * scale;
|
||||||
borderRight = '';
|
borderRight = '';
|
||||||
@ -2454,12 +2458,15 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
// canvasLeft = DEFAULT_BAR_WIDTH;
|
// canvasLeft = DEFAULT_BAR_WIDTH;
|
||||||
|
|
||||||
toolBarWidth = statusBarWidth = 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;
|
statusHeight = statusLineHeight * .8;
|
||||||
statusLabelsLH = .8 * statusLineHeight;
|
statusLabelsLH = .8 * statusLineHeight;
|
||||||
toolBarHeight = DEFAULT_CANVAS_WIDTH - statusBarHeight;
|
|
||||||
toolBarTop = statusLineHeight * count + SPACE * 2;
|
toolBarTop = statusLineHeight * count + SPACE * 2;
|
||||||
|
toolBarHeight = DEFAULT_CANVAS_WIDTH - toolBarTop;
|
||||||
|
toolsBackground = 'transparent';
|
||||||
|
|
||||||
toolsHeight = BASE_LINEHEIGHT;
|
toolsHeight = BASE_LINEHEIGHT;
|
||||||
borderRight = '';
|
borderRight = '';
|
||||||
@ -2540,7 +2547,8 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
borderTop: statusBarBorder,
|
borderTop: statusBarBorder,
|
||||||
borderLeft: statusBarBorder,
|
borderLeft: statusBarBorder,
|
||||||
borderRight: borderRight,
|
borderRight: borderRight,
|
||||||
fontSize: fontSize + unit
|
fontSize: fontSize + unit,
|
||||||
|
background: statusBackground,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -2570,7 +2578,8 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
borderBottom: toolBarBorder,
|
borderBottom: toolBarBorder,
|
||||||
borderLeft: toolBarBorder,
|
borderLeft: toolBarBorder,
|
||||||
borderRight: borderRight,
|
borderRight: borderRight,
|
||||||
fontSize: toolbarFontSize + unit
|
fontSize: toolbarFontSize + unit,
|
||||||
|
background: toolsBackground,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -19,6 +19,9 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"startBackground" : "bg.jpg",
|
"startBackground" : "bg.jpg",
|
||||||
"startLogoStyle" : "color: black",
|
"startLogoStyle" : "color: black",
|
||||||
"levelChoose" : [["简单","Easy"],["普通","Normal"],["困难","Hard"],["噩梦","Hell"]],
|
"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" : {
|
"firstData" : {
|
||||||
"title": "魔塔样板",
|
"title": "魔塔样板",
|
||||||
@ -129,6 +132,7 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
'counterAttack': 0.1,
|
'counterAttack': 0.1,
|
||||||
'purify': 3,
|
'purify': 3,
|
||||||
'hatred': 2,
|
'hatred': 2,
|
||||||
|
'maxValidHp': null,
|
||||||
'animateSpeed': 300,
|
'animateSpeed': 300,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -170,7 +170,7 @@
|
|||||||
-moz-box-sizing: border-box;
|
-moz-box-sizing: border-box;
|
||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
background: url(project/images/ground.png) repeat;
|
background: url(project/images/ground.png) repeat;
|
||||||
z-index: 160;
|
z-index: 150;
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
#statusBar .status{
|
#statusBar .status{
|
||||||
@ -199,7 +199,7 @@
|
|||||||
#toolBar {
|
#toolBar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: url(project/images/ground.png) repeat;
|
background: url(project/images/ground.png) repeat;
|
||||||
z-index: 150;
|
z-index: 160;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
-moz-box-sizing: border-box;
|
-moz-box-sizing: border-box;
|
||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user