-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,36 @@ | ||
<html> | ||
<head> | ||
<title>MoroboxAIPlayerWeb Sample</title> | ||
<link | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
rel="stylesheet" | ||
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" | ||
crossorigin="anonymous" | ||
/> | ||
</head> | ||
|
||
<body class="vertical"> | ||
<div class="horizontal"> | ||
<div id="player"></div> | ||
<div id="editor"></div> | ||
</div> | ||
<div class="info horizontal"> | ||
<button id="attach-player"></button> | ||
<button id="attach-editor"></button> | ||
</div> | ||
<div class="info"> | ||
<div> | ||
moroboxai-game-sdk v<span | ||
id="moroboxai-game-sdk-version" | ||
></span> | ||
<div class="container"> | ||
<div class="row justify-content-center align-items-center"> | ||
<div class="col-3"><div id="player"></div></div> | ||
<div class="col-auto"><div id="editor"></div></div> | ||
</div> | ||
<div> | ||
moroboxai-editor-web v<span | ||
id="moroboxai-editor-web-version" | ||
></span> | ||
<div class="row justify-content-center"> | ||
<div class="col-auto"> | ||
<button id="attach-player"></button> | ||
<button id="attach-editor"></button> | ||
</div> | ||
</div> | ||
<div class="row justify-content-center"> | ||
<div class="col-auto info"> | ||
moroboxai-game-sdk v<span | ||
id="moroboxai-game-sdk-version" | ||
></span | ||
><br /> | ||
moroboxai-editor-web v<span | ||
id="moroboxai-editor-web-version" | ||
></span> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
|
@@ -87,12 +96,9 @@ | |
url: "https://raw.githubusercontent.com/moroboxai/create-moroboxai-game/master/examples/canvas2d-rgb/agent.*", | ||
width: "500px", | ||
height: "400px", | ||
onLoad: (language, value) => | ||
player.getController(0).loadAgent({ | ||
language: language, | ||
code: value | ||
}), | ||
onUnload: () => player.getController(0).unloadAgent() | ||
onRun: (options) => | ||
player.getController(0).loadAgent(options), | ||
onStop: () => player.getController(0).unloadAgent() | ||
}); | ||
|
||
attachEditorButton.textContent = "Detach Editor"; | ||
|
@@ -124,27 +130,17 @@ | |
justify-content: center; | ||
} | ||
|
||
.horizontal { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
#player { | ||
background-color: black; | ||
background-size: cover; | ||
margin-left: 10em; | ||
margin-right: 2em; | ||
} | ||
|
||
.info { | ||
margin-top: 2em; | ||
text-align: center; | ||
} | ||
|
||
.info button ~ button { | ||
margin-left: 1em; | ||
.row + .row { | ||
margin-top: 1em; | ||
} | ||
</style> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters