/
index.html
158 lines (144 loc) · 5.12 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Cobold Console</title>
<!--- <meta name="viewport" content="width=device-width, initial-scale=1.0"> --->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/console_home.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="js/cobold_console-0.1.js"></script>
</head>
<body>
<h1><span class="titleCobold">Cobold</span><span class="titleConsole">Console</span></h1>
<div class="subtitle">
An Open-Source HTML5 Console
<br />
Excellent for text-based games
<br />
Designed with ♥ by <a href="http://lukenickerson.github.io">Luke Nickerson</a>
<br />
for the ASCII Enthusiasts Game Jam
</div>
<div class="mainButtons">
<a href="omicron_game.html">Try it out now > Omicron Game</a>
<a href="hello_world.html">Basic Console Example > Hello World</a>
<a href="https://github.com/Lukenickerson/cobold-console">Cobold Console GitHub Repo</a>
</div>
<a href="omicron_game.html">
<img src="images/omicron_screenshot.png" class="exampleScreenshot" alt="Screenshot of Omicron Game" />
</a>
<a href="https://github.com/Lukenickerson/cobold-console"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
<article>
<h1>How to Use the Console</h1>
<h2>Setup</h2>
<ol>
<li>Include jQuery
<code>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
</code>
</li>
<li>Include the latest Cobold Console code
<code>
<script src="js/cobold_console-0.1.js"></script>
</code>
</li>
<li>Include the HTML for the Console
<code><pre>
<div id="console">
<div id="consoleOutput">
Loading...
</div>
<div id="consoleInput">
<form method="get" post="">
<label for="consoleInputTextArea"></label>
<textarea id="consoleInputTextArea" autocapitalize="off">
</textarea>
<!--- <input type="submit" /> --->
</form>
</div>
</div>
</pre></code>
</li>
<li>Include the CSS styling
<code>
<link rel="stylesheet" href="css/console_alpha.css" />
</code>
</li>
<li>Instantiate the Cobold Console
<code><pre>
$(document).ready(function(){
window.cc = new ConsoleClass();
});
</pre></code>
</li>
</ol>
<h2>Functions</h2>
<h3>Output</h3>
<ul>
<li>.add( <span class="params">anything</span> )</li>
<li>.addDelay( <span class="params">duration in milliseconds</span> )</li>
<li>.addLine( <span class="params">string</span> )</li>
<li>.addNewLine()</li>
<li>.addText( <span class="params">string</span> )</li>
<li>.clear()</li>
<li>.refresh()</li>
<li>.rush( <span class="params">milliseconds</span> )</li>
<li>.setPrompt( <span class="params">string</span> )</li>
</ul>
<h3>Input</h3>
<ul>
<li>.acceptOneCharacterInput()</li>
<li>.acceptTextEnterInput()</li>
<li>.clearInput()</li>
<li>.startInput()</li>
<li>.stopInput()</li>
<li>.submitInput( <span class="params">string</span> )</li>
</ul>
<h3>Special</h3>
<ul>
<li>.submitCallback( <span class="params">string</span> )
<br />Redefine this function so you can send input to your app
</li>
</ul>
<h2>Example</h2>
<code><pre>
var cc = new ConsoleClass();
cc.addLine("Hello")
.addDelay(1000)
.addLine("World")
.addDelay(1000);
cc.submitCallback = function (x) {
alert(x);
}
</pre></code>
<ul>
<li><a href="hello_world.html">Look at a basic Hello World example</a></li>
<li><a href="omicron_game.html">Try it out a simple game: Omicron</a></li>
</ul>
<h2>Go Forth</h2>
<ol>
<li>Make stuff</li>
<li><a href="https://github.com/Lukenickerson/cobold-console">Contribute to the Cobold Console GitHub Repo</a></li>
</ol>
</article>
<footer>
<p>© 2014 Luke Nickerson</p>
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/">
<img alt="Creative Commons License" style="border-width:0"
src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a>
<br />This work is licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/">
Creative Commons Attribution 4.0 International License</a>.
</footer>
<!--- Google Analytics --->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-7118348-1', 'deathraygames.com');
ga('send', 'pageview');
</script>
</body>
</html>