1
0
mirror of https://gitee.com/freeyz/godot-mota.git synced 2024-12-22 15:09:22 +08:00

修改部分配置,增加现在预览

This commit is contained in:
freewu32 2020-08-22 16:55:03 +08:00
parent 7ea0960d7b
commit abf8d2fad1
9 changed files with 767 additions and 21 deletions

View File

@ -71,7 +71,10 @@ script = ExtResource( 12 )
script = ExtResource( 11 )
[node name="HeaderBackground" type="TextureRect" parent="HUD"]
margin_right = 414.0
anchor_left = 0.5
anchor_right = 0.5
margin_left = -207.0
margin_right = 207.0
margin_bottom = 96.0
texture = ExtResource( 6 )
stretch_mode = 2
@ -259,9 +262,13 @@ __meta__ = {
}
[node name="BottomBackground" type="TextureRect" parent="HUD"]
margin_top = 512.0
margin_right = 414.0
margin_bottom = 544.0
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
margin_left = -207.0
margin_top = -32.0
margin_right = 207.0
texture = ExtResource( 6 )
stretch_mode = 2
__meta__ = {
@ -283,57 +290,58 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureButton" type="TextureButton" parent="HUD/BottomBackground/VBoxContainer"]
[node name="BookButton" type="TextureButton" parent="HUD/BottomBackground/VBoxContainer"]
margin_right = 40.0
margin_bottom = 32.0
size_flags_horizontal = 3
texture_normal = SubResource( 7 )
[node name="TextureButton2" type="TextureButton" parent="HUD/BottomBackground/VBoxContainer"]
margin_left = 44.0
margin_right = 84.0
visible = false
margin_right = 40.0
margin_bottom = 32.0
size_flags_horizontal = 3
texture_normal = SubResource( 8 )
[node name="TextureButton3" type="TextureButton" parent="HUD/BottomBackground/VBoxContainer"]
margin_left = 88.0
margin_right = 128.0
visible = false
margin_right = 40.0
margin_bottom = 32.0
size_flags_horizontal = 3
texture_normal = SubResource( 9 )
[node name="TextureButton4" type="TextureButton" parent="HUD/BottomBackground/VBoxContainer"]
margin_left = 132.0
margin_right = 172.0
visible = false
margin_right = 40.0
margin_bottom = 32.0
size_flags_horizontal = 3
texture_normal = SubResource( 10 )
[node name="TextureButton5" type="TextureButton" parent="HUD/BottomBackground/VBoxContainer"]
margin_left = 176.0
margin_right = 216.0
visible = false
margin_right = 40.0
margin_bottom = 32.0
size_flags_horizontal = 3
texture_normal = SubResource( 11 )
[node name="SaveButton" type="TextureButton" parent="HUD/BottomBackground/VBoxContainer"]
margin_left = 220.0
margin_right = 260.0
margin_left = 44.0
margin_right = 84.0
margin_bottom = 32.0
size_flags_horizontal = 3
texture_normal = SubResource( 12 )
[node name="LoadButton" type="TextureButton" parent="HUD/BottomBackground/VBoxContainer"]
margin_left = 264.0
margin_right = 304.0
margin_left = 88.0
margin_right = 128.0
margin_bottom = 32.0
size_flags_horizontal = 3
texture_normal = SubResource( 13 )
[node name="TextureButton8" type="TextureButton" parent="HUD/BottomBackground/VBoxContainer"]
margin_left = 308.0
margin_right = 348.0
visible = false
margin_left = 88.0
margin_right = 128.0
margin_bottom = 32.0
size_flags_horizontal = 3
texture_normal = SubResource( 14 )
@ -389,6 +397,50 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="BookDialog" type="PopupDialog" parent="HUD"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -208.0
margin_top = -176.0
margin_right = 208.0
margin_bottom = 240.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ScrollContainer" type="ScrollContainer" parent="HUD/BookDialog"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -208.0
margin_top = -208.0
margin_right = 206.0
margin_bottom = 208.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="HUD/BookDialog/ScrollContainer"]
[node name="CloseBook" type="Label" parent="HUD/BookDialog"]
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -77.9
margin_top = -32.0
margin_right = -13.9
margin_bottom = -10.0
custom_fonts/font = ExtResource( 8 )
text = "返回游戏"
valign = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Level" type="Node2D" parent="."]
script = ExtResource( 10 )

BIN
docs/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

268
docs/index.html Normal file
View File

@ -0,0 +1,268 @@
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml' lang='' xml:lang=''>
<head>
<meta charset='utf-8' />
<meta name='viewport' content='width=device-width, user-scalable=no' />
<link id='-gd-engine-icon' rel='icon' type='image/png' href='favicon.png' />
<title>Mobile-mota</title>
<style type='text/css'>
body {
touch-action: none;
margin: 0;
border: 0 none;
padding: 0;
text-align: center;
background-color: black;
}
#canvas {
display: block;
margin: 0;
color: white;
}
#canvas:focus {
outline: none;
}
.godot {
font-family: 'Noto Sans', 'Droid Sans', Arial, sans-serif;
color: #e0e0e0;
background-color: #3b3943;
background-image: linear-gradient(to bottom, #403e48, #35333c);
border: 1px solid #45434e;
box-shadow: 0 0 1px 1px #2f2d35;
}
/* Status display
* ============== */
#status {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
/* don't consume click events - make children visible explicitly */
visibility: hidden;
}
#status-progress {
width: 366px;
height: 7px;
background-color: #38363A;
border: 1px solid #444246;
padding: 1px;
box-shadow: 0 0 2px 1px #1B1C22;
border-radius: 2px;
visibility: visible;
}
@media only screen and (orientation:portrait) {
#status-progress {
width: 61.8%;
}
}
#status-progress-inner {
height: 100%;
width: 0;
box-sizing: border-box;
transition: width 0.5s linear;
background-color: #202020;
border: 1px solid #222223;
box-shadow: 0 0 1px 1px #27282E;
border-radius: 3px;
}
#status-indeterminate {
visibility: visible;
position: relative;
}
#status-indeterminate > div {
width: 4.5px;
height: 0;
border-style: solid;
border-width: 9px 3px 0 3px;
border-color: #2b2b2b transparent transparent transparent;
transform-origin: center 21px;
position: absolute;
}
#status-indeterminate > div:nth-child(1) { transform: rotate( 22.5deg); }
#status-indeterminate > div:nth-child(2) { transform: rotate( 67.5deg); }
#status-indeterminate > div:nth-child(3) { transform: rotate(112.5deg); }
#status-indeterminate > div:nth-child(4) { transform: rotate(157.5deg); }
#status-indeterminate > div:nth-child(5) { transform: rotate(202.5deg); }
#status-indeterminate > div:nth-child(6) { transform: rotate(247.5deg); }
#status-indeterminate > div:nth-child(7) { transform: rotate(292.5deg); }
#status-indeterminate > div:nth-child(8) { transform: rotate(337.5deg); }
#status-notice {
margin: 0 100px;
line-height: 1.3;
visibility: visible;
padding: 4px 6px;
visibility: visible;
}
</style>
</head>
<body>
<canvas id='canvas'>
HTML5 canvas appears to be unsupported in the current browser.<br />
Please try updating or use a different browser.
</canvas>
<div id='status'>
<div id='status-progress' style='display: none;' oncontextmenu='event.preventDefault();'><div id ='status-progress-inner'></div></div>
<div id='status-indeterminate' style='display: none;' oncontextmenu='event.preventDefault();'>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div id='status-notice' class='godot' style='display: none;'></div>
</div>
<script type='text/javascript' src='index.js'></script>
<script type='text/javascript'>//<![CDATA[
var engine = new Engine;
var setStatusMode;
var setStatusNotice;
(function() {
const EXECUTABLE_NAME = 'index';
const MAIN_PACK = 'index.pck';
const INDETERMINATE_STATUS_STEP_MS = 100;
var canvas = document.getElementById('canvas');
var statusProgress = document.getElementById('status-progress');
var statusProgressInner = document.getElementById('status-progress-inner');
var statusIndeterminate = document.getElementById('status-indeterminate');
var statusNotice = document.getElementById('status-notice');
var initializing = true;
var statusMode = 'hidden';
var animationCallbacks = [];
function animate(time) {
animationCallbacks.forEach(callback => callback(time));
requestAnimationFrame(animate);
}
requestAnimationFrame(animate);
function adjustCanvasDimensions() {
var scale = window.devicePixelRatio || 1;
var width = window.innerWidth;
var height = window.innerHeight;
canvas.width = width * scale;
canvas.height = height * scale;
canvas.style.width = width + "px";
canvas.style.height = height + "px";
}
animationCallbacks.push(adjustCanvasDimensions);
adjustCanvasDimensions();
setStatusMode = function setStatusMode(mode) {
if (statusMode === mode || !initializing)
return;
[statusProgress, statusIndeterminate, statusNotice].forEach(elem => {
elem.style.display = 'none';
});
animationCallbacks = animationCallbacks.filter(function(value) {
return (value != animateStatusIndeterminate);
});
switch (mode) {
case 'progress':
statusProgress.style.display = 'block';
break;
case 'indeterminate':
statusIndeterminate.style.display = 'block';
animationCallbacks.push(animateStatusIndeterminate);
break;
case 'notice':
statusNotice.style.display = 'block';
break;
case 'hidden':
break;
default:
throw new Error('Invalid status mode');
}
statusMode = mode;
}
function animateStatusIndeterminate(ms) {
var i = Math.floor(ms / INDETERMINATE_STATUS_STEP_MS % 8);
if (statusIndeterminate.children[i].style.borderTopColor == '') {
Array.prototype.slice.call(statusIndeterminate.children).forEach(child => {
child.style.borderTopColor = '';
});
statusIndeterminate.children[i].style.borderTopColor = '#dfdfdf';
}
}
setStatusNotice = function setStatusNotice(text) {
while (statusNotice.lastChild) {
statusNotice.removeChild(statusNotice.lastChild);
}
var lines = text.split('\n');
lines.forEach((line) => {
statusNotice.appendChild(document.createTextNode(line));
statusNotice.appendChild(document.createElement('br'));
});
};
engine.setProgressFunc((current, total) => {
if (total > 0) {
statusProgressInner.style.width = current/total * 100 + '%';
setStatusMode('progress');
if (current === total) {
// wait for progress bar animation
setTimeout(() => {
setStatusMode('indeterminate');
}, 500);
}
} else {
setStatusMode('indeterminate');
}
});
function displayFailureNotice(err) {
var msg = err.message || err;
console.error(msg);
setStatusNotice(msg);
setStatusMode('notice');
initializing = false;
};
if (!Engine.isWebGLAvailable()) {
displayFailureNotice('WebGL not available');
} else {
setStatusMode('indeterminate');
engine.setCanvas(canvas);
engine.startGame(EXECUTABLE_NAME, MAIN_PACK).then(() => {
setStatusMode('hidden');
initializing = false;
}, displayFailureNotice);
}
})();
//]]></script>
</body>
</html>

419
docs/index.js Normal file

File diff suppressed because one or more lines are too long

BIN
docs/index.pck Normal file

Binary file not shown.

BIN
docs/index.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
docs/index.wasm Normal file

Binary file not shown.

View File

@ -7,7 +7,7 @@ custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../export/mota/index.html"
export_path="docs/index.html"
patch_list=PoolStringArray( )
script_export_mode=1
script_encryption_key=""

View File

@ -103,9 +103,13 @@ window/size/width=416
window/size/height=544
window/size/always_on_top=true
window/dpi/allow_hidpi=true
window/stretch/mode="viewport"
window/stretch/mode="2d"
window/stretch/aspect="keep"
[gui]
theme/use_hidpi=true
[importer_defaults]
texture={
@ -132,6 +136,9 @@ texture={
[rendering]
quality/driver/driver_name="GLES2"
quality/2d/use_nvidia_rect_flicker_workaround=true
quality/intended_usage/framebuffer_allocation=0
quality/intended_usage/framebuffer_allocation.mobile=0
quality/2d/use_pixel_snap=true
vram_compression/import_etc=true
environment/default_environment="res://settings/default_env.tres"