-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
387 lines (370 loc) · 17.1 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>FRAG</title>
<link rel="stylesheet" href="https://fragworks.github.io/css/style.css">
<link rel="stylesheet" href="https://fragworks.github.io/fonts/docker-icon/fontcustom/fontcustom.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/styles/monokai-sublime.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.6.0/clipboard.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="https://fragworks.github.io/js/fw.js"></script>
<link href="https://fragworks.github.io/index.xml" rel="feed" type="application/rss+xml" title="FRAG">
<meta name="generator" content="Hugo 0.20" />
</head>
<body>
<section class="hero is-medium has-text-centered">
<div class="hero-head">
<div class="container">
<nav class="nav">
<div class="nav-left">
<a class="nav-item is-brand" href="https://fragworks.github.io/">
<img src="https://fragworks.github.io/images/logo.svg" width="32" alt="FRAG: Framework for Rather Awesome Games">
FRAG
</a>
</div>
<div class="nav-center">
<a class="nav-item" href="https://github.com/fragworks/frag">
<span class="icon">
<i class="fa fa-github"></i>
</span>
</a>
<a class="nav-item" href="https://twitter.com/hahaitsfunny">
<span class="icon">
<i class="fa fa-twitter"></i>
</span>
</a>
</div>
<span id="nav-toggle" class="nav-toggle">
<span></span>
<span></span>
<span></span>
</span>
<div id="nav-menu" class="nav-right nav-menu">
<a class="nav-item is-active" href="https://fragworks.github.io/">
Home
</a>
<a class="nav-item" href="/community/index/">
Community
</a>
<a class="nav-item" href="/documentation/index/">
Documentation
</a>
<a class="nav-item" href="/roadmap/index/">
Roadmap
</a>
<div class="nav-item">
<div class="field is-grouped">
<p class="control">
<a id="twitter" class="button" data-social-network="Twitter" data-social-action="tweet" data-social-target="https://fragworks.github.io" target="_blank" href="https://twitter.com/intent/tweet?text=FRAG: a game development framework built with @nim_lang %23FRAG&url=https://fragworks.github.io&via=hahaitsfunny">
<span class="icon">
<i class="fa fa-twitter"></i>
</span>
<span>Tweet</span>
</a>
</p>
</div>
</div>
</div>
</nav>
</div>
</div>
<main>
<div class="hero-body">
<div class="container">
<p id="b">
<svg viewBox="0 0 209 376" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<g>
<path id="p2" class="st0" d="M106.9,3.9c4.6-4.1,12.6-4.3,16.9,0.3c3.3,3.7,2.9,9.3,1,13.6c-1.7,3.6-5.7,4.9-9.1,6.2
c1.5,9.8,1.1,19.8,4,29.3c1.3,4.4,4.4,9,9.3,9.7c4.9,0.8,9.2-2.4,12.2-5.9c5-6,8.5-13.2,13.3-19.4c-1.2-3.3-2.9-6.4-3.4-9.8
c0-5,4.3-11.2,9.9-9.8c6,1.8,10.6,9,8.4,15.2c-1.7,4-6.6,4.3-10.3,4.9c-1.4,9.5-4.6,18.9-3.5,28.5c0.4,4.3,3.7,8.5,8.3,8.5
c6.3-0.3,11.5-4.4,16.7-7.6c4.3-2.9,9.5-5.2,11.9-10.1c1.8-3.3,1.1-7.2,0.7-10.7c2.4-2.1,5.3-4.3,8.7-3.2c5.3,2,8,9.4,5,14.2
c-2.2,3.3-6.6,2.7-10,2.8c-16.2,27.5-33.8,54.2-50.9,81.1c-5.4-6.2-11.6-11.8-18.4-16.3c-3.1-2.1-6.9-2.4-10.5-2.8
c-14.3-1.2-28.6-2.6-43-3.6c-9.3-0.7-19.1-1.6-28,2.2c-1.5-6.1-2.4-12.3-4.2-18.3c-6.5-22-13.9-43.7-19.4-66
c-2.5-0.8-5.4-1.2-7.3-3.2C10.5,28.5,15,18.7,22,18.5c3.8,0.1,5.9,3.7,8,6.4c-0.5,3.2-1.1,6.6-3.5,9.1c4.8,6.7,8.6,14.2,14.4,20.2
c3.5,3.6,8.9,6.5,14,4.8c4-1.6,5.8-6.1,6.7-10c1.7-7.5,2.1-15.3,3.3-22.9c-2.3-1.2-5-2.1-6.6-4.2c-4.1-5.2-2-14.6,4.9-16.3
C69.5,3.4,75.9,9.6,75.3,16c0.2,3.9-2.9,6.7-5.9,8.7c3.2,8.6,4.3,18,9,26c2.3,4.1,6.8,7.3,11.6,6.4c4.8-0.9,7.9-5.1,10.1-9.1
c4.2-7.8,6.5-16.4,10.7-24.1c-2.4-2.5-5.3-4.5-6.9-7.6C102.3,12.1,103.5,6.9,106.9,3.9"/>
</g>
<g>
<path id="p3" class="st0" d="M46.1,121.3c8.8-3.8,18.6-2.9,28-2.2c14.3,1,28.7,2.3,43,3.6c3.6,0.4,7.4,0.6,10.5,2.8
c6.9,4.6,13,10.1,18.4,16.3c10.3,12,18.2,25.9,25.5,39.9c4.1,8.4,8.1,17.1,10.2,26.2c1.9,7.9,2.1,16.1,2.1,24.2
c-0.4,19.2-1,38.5-2.5,57.7c-0.5,4.1-0.3,8.7-3.2,12c-2.3-4.9-2.6-10.3-3.1-15.6c-1.6-18.4-2.3-36.9-3.8-55.4
c-0.5-6.3-1.5-12.7-4.6-18.4c-7.1-13.7-14.8-27-22.9-40.1c-3.1-5.2-6.7-10.2-11.3-14.3c-1.4,2.3-2.7,4.6-4.1,6.8
c12.8,10.4,17.9,28.6,12.7,44.2c3.9,7.3,8,14.6,11.9,21.9c-1.6,2.5-3.2,4.9-4.8,7.4c3.9,1.9,7.7,3.9,11.5,5.9
c1.7,9.4,3.4,18.7,5.2,28.1c-2.7,3.1-5.3,6.3-8.1,9.3c1.2,1.8,2.5,3.5,3.8,5.3c-1.8,8.3-3.8,16.6-5.7,24.9
c-2.8,1.4-5.6,2.9-8.4,4.4c1.2,1.6,2.4,3.3,3.6,4.9c-3.2,6.2-5.8,12.7-9.3,18.8c-2.8,2-6.2,2.9-9.3,4.3c0,3.5,0,6.9,0,10.4
c-7.4,7.1-14.9,13.9-22.4,20.8c-18.2,0-36.3,0-54.5,0c-8.4-8.8-16.8-17.7-25.1-26.6c0.2-2,0.5-4.1,0.7-6.1c-3.5-1.8-7.4-3-10.4-5.4
c-4.7-6.7-9-13.7-13.5-20.6c1.7-2.8,3.4-5.7,5-8.5c-2.6-1.8-5.5-3.2-7.8-5.5C2,295.6,1.3,288.3,0,281v-0.7c2.2-2.4,4.4-4.6,6.7-6.9
c-2-3.1-4-6.2-5.9-9.2c2-7.9,3.6-16,6-23.8c1.9-2,4.6-3.1,6.9-4.6c-1-2.3-2-4.6-3-6.9c4.1-6.6,8.5-13.1,13.2-19.3
c1.7-2.2,3.6-4.6,6.3-5.5c3.4-1.2,7.1-1.2,10.7-1.7c5.9-7.4,11.7-14.8,17.5-22.1c-2.2-10.2-2-20.7-2.4-31.1c-5.6,1-12,2.4-17.1-1
c-4.4-2.8-5.6-8.5-4.4-13.3C35.3,128.6,40.3,123.6,46.1,121.3"/>
</g>
</svg>
<svg viewBox="0 0 209 376" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<image height="376" width="209" xlink:href="images/logo.svg" />
</svg>
</p>
<h1 id="frag" class="title">
FRAG
</h1>
<h2 id="modern-framework" class="subtitle">
A game development framework built with the <a href="https://nim-lang.org"><strong>Nim</strong></a> programming language
</h2>
<pre id="nimble"><code>nimble install frag</code></pre>
<div id="ghbtns" class="block">
<iframe src="https://ghbtns.com/github-btn.html?user=fragworks&repo=frag&type=star&count=true&size=large" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>
<iframe src="https://ghbtns.com/github-btn.html?user=fragworks&repo=frag&type=fork&count=false&size=large" frameborder="0" scrolling="0" width="80px" height="30px"></iframe>
</div>
<div class="hero-buttons">
<a class="button is-large is-primary" href="/documentation/index/">
View docs
</a>
</div>
</div>
</div>
</section>
<section class="hero is-primary">
<div class="hero-body">
<div class="container">
<nav class="columns">
<a class="column has-text-centered" href="">
<span class="icon is-large" style="margin-right: -15px;">
<i class="fa fa-mobile"></i>
</span>
<span class="icon is-large">
<i class="fa fa-tablet"></i>
</span>
<span class="icon is-large" style="margin-right: 10px;">
<i class="fa fa-desktop"></i>
</span>
<span class="icon is-large" style="margin-right: 10px;">
<i class="fa fa-gamepad"></i>
</span>
<p class="title is-4"><strong>Portable</strong></p>
<p class="subtitle">Designed for building <strong>cross-platform</strong> games</p>
</a>
<a class="column has-text-centered" href="https://nim-lang.org/">
<span class="fw-icon-nim">
<span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span><span class="path5"></span><span class="path6"></span>
</span>
<p class="title is-4"><strong>Built with Nim</strong></p>
<p class="subtitle">Write your game code in an <strong>expressive</strong>, <strong>garbage-collected</strong>, <strong>high-performance</strong> programming language</p>
</a>
<a class="column has-text-centered" href="">
<span class="icon is-large">
<i class="fa fa-docker"></i>
</span>
<p class="title is-4"><strong>Distribute with Docker</strong></p>
<p class="subtitle">Create distributables for your game using <strong>Docker</strong></p>
</a>
<a class="column has-text-centered" href="">
<span class="icon is-large">
<i class="fa fa-cubes"></i>
</span>
<p class="title is-4"><strong>Modular</strong></p>
<p class="subtitle">Just import what you <strong>need</strong></p>
</a>
<a class="column has-text-centered" href="https://github.com/fragworks/frag">
<span class="icon is-large">
<i class="fa fa-github"></i>
</span>
<p class="title is-4"><strong>Free</strong></p>
<p class="subtitle">Open source on <strong>GitHub</strong></p>
</a>
</nav>
</div>
</div>
</section>
<section class="section is-medium">
<div class="container">
<h3 class="title is-2">
<a href="/documentation/gameloop">
<span class="icon is-medium">
<i class="fa fa-retweet "></i>
</span>
Simple <strong>game loop</strong>
</a>
</h3>
<h4 class="subtitle is-4">Just import and implement your game logic</h4>
<div id="grid" class="columns">
<div class="column">
<div id="markup">
<figure class="highlight"><pre><code class="nim">
import
events
import
bgfxdotnim,
sdl2
import
frag,
frag/config,
frag/graphics/window,
frag/logger,
frag/modules/graphics
type
App = ref object
proc resize*(e: EventArgs) =
let event = SDLEventMessage(e).event
let sdlEventData = event.sdlEventData
let graphics = event.graphics
graphics.setViewRect(0, 0, 0, uint16 sdlEventData.window.data1, uint16 sdlEventData.window.data2)
proc initApp(app: App, ctx: Frag) =
logDebug "Initializing game..."
ctx.events.on(SDLEventType.WindowResize, resize)
logDebug "Game initialized."
proc updateApp(app:App, ctx: Frag, deltaTime: float) =
discard
proc renderApp(app: App, ctx: Frag, deltaTime: float) =
ctx.graphics.clearView(0, ClearMode.Color.ord or ClearMode.Depth.ord, 0x303030ff, 1.0, 0)
proc shutdownApp(app: App, ctx: Frag) =
logDebug "Shutting down game..."
logDebug "Game shut down."
startFrag(App(), Config(
rootWindowTitle: "Your game name",
rootWindowPosX: window.posUndefined, rootWindowPosY: window.posUndefined,
rootWindowWidth: 960, rootWindowHeight: 540,
resetFlags: ResetFlag.VSync,
logFileName: "your_game_name.log",
assetRoot: "../assets",
debugMode: BGFX_DEBUG_TEXT
))</code></pre></figure>
</div>
</div>
<div class="column">
<div class="box">
<article class="media">
<figure class="image">
<img src="images/frag01.png" alt="Image">
</figure>
</article>
</div>
</div>
</div>
</section>
<section class="section is-medium">
<div class="container">
<h3 class="title is-2">
<a href="">
<span class="fw-icon-physics">
</span>
Plug & Play <strong>Physics</strong>
</a>
</h3>
<h4 class="subtitle is-4">Powered by Chipmunk2D</h4>
<div class="box">
<article class="media">
<div class="media-left">
<figure class="image">
<video autoplay="autoplay" controls loop="loop">
<source src="images/physics.mp4" type="video/mp4" />
<img src="images/physics.gif" />
</video>
</figure>
</div>
<div class="media-content">
<div>
<p>
Add 2D rigid body physics to your game with <a href="https://chipmunk-physics.net/"><strong>Chipmunk 2D</strong></a> <small>by</small> <small>Howling Moon Software</small>
</p>
</div>
</div>
</article>
</div>
</div>
</section>
<section class="section is-medium">
<div class="container">
<h3 class="title is-2">
<a href="">
<span class="fw-icon-spine">
</span>
Integration with <strong>Spine</strong>
</a>
</h3>
<h4 class="subtitle is-4">2d skeletal animation at your fingertips</h4>
<div class="box">
<article class="media">
<div class="media-left">
<figure class="image">
<video autoplay="autoplay" controls loop="loop">
<source src="images/spine.mp4" type="video/mp4" />
<img src="images/spine.gif" />
</video>
</figure>
</div>
<div class="media-content">
<div>
<p>
Bring your game to life with <a href="https://chipmunk-physics.net/"><strong>Spine</strong></a> <small>by</small> <small>Esoteric Software</small>
</p>
<div class="notification is-info">
Using <b>Spine</b> in your project? Make sure you own a license. See <a href="https://esotericsoftware.com/spine-purchase">https://esotericsoftware.com/spine-purchase</a> for more details.
</div>
</div>
</div>
</article>
</div>
</div>
</section>
</main>
<footer class="footer">
<div class="container">
<div class="columns">
<div class="column is-3">
<div id="about" class="content">
<strong xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text" property="dct:title" rel="dct:type">FRAG</strong> by <a xmlns:cc="http://creativecommons.org/ns#" href="https://fragworks.github.io" property="cc:attributionName" rel="cc:attributionURL">Zachary Carter & Individual Contributors</a>.
<div class="twitter-container">
<iframe id="twitter-widget-0" scrolling="no" allowtransparency="true" class="twitter-follow-button twitter-follow-button-rendered" style="position: static; visibility: visible; width: 262px; height: 28px;" title="Twitter Follow Button" src="http://platform.twitter.com/widgets/follow_button.5c39137502ea1894df4434ae5ed041c5.en.html#dnt=false&id=twitter-widget-0&lang=en&screen_name=hahaitsfunny&show_count=true&show_screen_name=true&size=l&time=1493497446003" data-screen-name="hahaitsfunny" frameborder="0"></iframe>
</div>
</div>
</div>
<div class="column is-5">
<div id="share" class="content">
<div>
<strong>Support</strong> FRAG!
</div>
<div id="social">
<iframe class="github-btn" src="https://ghbtns.com/github-btn.html?user=fragworks&repo=frag&type=star&count=true&size=large" allowtransparency="true" scrolling="0" frameborder="0" height="30px" width="160px"></iframe>
<a href="https://twitter.com/share" class="twitter-share-button" data-size="large" data-text="FRAG: a game development framework built with @nim_lang" data-url="https://fragworks.github.io" data-via="hahaitsfunny" data-hashtags="FRAG" data-related="nim-lang" data-show-count="false">Tweet</a><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</div>
</div>
</div>
<div class="column is-4">
<div id="sister">
<p>
Brought to you by these <strong>amazing</strong> technologies:
</p>
<ul>
<li>
<div class="columns">
<div class="column">
<a href="https://github.com/bkaradzic/bgfx">
<strong>BGFX</strong>
</a>
</div>
<div class="column">
<iframe class="github-btn" src="https://ghbtns.com/github-btn.html?user=bkaradzic&repo=bgfx&type=star&count=true&size=large" allowtransparency="true" scrolling="0" frameborder="0" height="30px" width="160px"></iframe>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
<p id="tsp">
<small>
Source code licensed <a href="http://opensource.org/licenses/mit-license.php">MIT</a>.
<br>
Website content licensed <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a>.
</small>
</p>
</div>
</footer>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>