-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from mkli90/enhancement/30-improve-api-documen…
…tation Documentation updated
- Loading branch information
Showing
15 changed files
with
400 additions
and
182 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 |
---|---|---|
|
@@ -19,7 +19,7 @@ Content: | |
|
||
intro | ||
using_game | ||
inhereting_scene | ||
inheriting_scene | ||
examples | ||
|
||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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,47 +1,113 @@ | ||
$( document ).ready(function() { | ||
function toggleCurrent (elem) { | ||
var parent_li = elem.closest('li'); | ||
parent_li.siblings('li.current').removeClass('current'); | ||
parent_li.siblings().find('li.current').removeClass('current'); | ||
parent_li.find('> ul li.current').removeClass('current'); | ||
parent_li.toggleClass('current'); | ||
} | ||
|
||
$(document).ready(function() { | ||
// Shift nav in mobile when clicking the menu. | ||
$(document).on('click', "[data-toggle='wy-nav-top']", function() { | ||
$("[data-toggle='wy-nav-shift']").toggleClass("shift"); | ||
$("[data-toggle='rst-versions']").toggleClass("shift"); | ||
$("[data-toggle='wy-nav-shift']").toggleClass("shift"); | ||
$("[data-toggle='rst-versions']").toggleClass("shift"); | ||
}); | ||
// Close menu when you click a link. | ||
// Nav menu link click operations | ||
$(document).on('click', ".wy-menu-vertical .current ul li a", function() { | ||
$("[data-toggle='wy-nav-shift']").removeClass("shift"); | ||
$("[data-toggle='rst-versions']").toggleClass("shift"); | ||
var target = $(this); | ||
// Close menu when you click a link. | ||
$("[data-toggle='wy-nav-shift']").removeClass("shift"); | ||
$("[data-toggle='rst-versions']").toggleClass("shift"); | ||
// Handle dynamic display of l3 and l4 nav lists | ||
toggleCurrent(target); | ||
if (typeof(window.SphinxRtdTheme) != 'undefined') { | ||
window.SphinxRtdTheme.StickyNav.hashChange(); | ||
} | ||
}); | ||
$(document).on('click', "[data-toggle='rst-current-version']", function() { | ||
$("[data-toggle='rst-versions']").toggleClass("shift-up"); | ||
}); | ||
$("[data-toggle='rst-versions']").toggleClass("shift-up"); | ||
}); | ||
// Make tables responsive | ||
$("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>"); | ||
|
||
// Add expand links to all parents of nested ul | ||
$('.wy-menu-vertical ul').siblings('a').each(function () { | ||
var link = $(this); | ||
expand = $('<span class="toctree-expand"></span>'); | ||
expand.on('click', function (ev) { | ||
toggleCurrent(link); | ||
ev.stopPropagation(); | ||
return false; | ||
}); | ||
link.prepend(expand); | ||
}); | ||
}); | ||
|
||
// Sphinx theme state | ||
window.SphinxRtdTheme = (function (jquery) { | ||
var stickyNav = (function () { | ||
var navBar, | ||
win, | ||
stickyNavCssClass = 'stickynav', | ||
applyStickNav = function () { | ||
if (navBar.height() <= win.height()) { | ||
navBar.addClass(stickyNavCssClass); | ||
} else { | ||
navBar.removeClass(stickyNavCssClass); | ||
} | ||
}, | ||
winScroll = false, | ||
linkScroll = false, | ||
winPosition = 0, | ||
enable = function () { | ||
applyStickNav(); | ||
win.on('resize', applyStickNav); | ||
init(); | ||
reset(); | ||
win.on('hashchange', reset); | ||
|
||
// Set scrolling | ||
win.on('scroll', function () { | ||
if (!linkScroll) { | ||
winScroll = true; | ||
} | ||
}); | ||
setInterval(function () { | ||
if (winScroll) { | ||
winScroll = false; | ||
var newWinPosition = win.scrollTop(), | ||
navPosition = navBar.scrollTop(), | ||
newNavPosition = navPosition + (newWinPosition - winPosition); | ||
navBar.scrollTop(newNavPosition); | ||
winPosition = newWinPosition; | ||
} | ||
}, 25); | ||
}, | ||
init = function () { | ||
navBar = jquery('nav.wy-nav-side:first'); | ||
win = jquery(window); | ||
win = jquery(window); | ||
}, | ||
reset = function () { | ||
// Get anchor from URL and open up nested nav | ||
var anchor = encodeURI(window.location.hash); | ||
if (anchor) { | ||
try { | ||
var link = $('.wy-menu-vertical') | ||
.find('[href="' + anchor + '"]'); | ||
$('.wy-menu-vertical li.toctree-l1 li.current') | ||
.removeClass('current'); | ||
link.closest('li.toctree-l2').addClass('current'); | ||
link.closest('li.toctree-l3').addClass('current'); | ||
link.closest('li.toctree-l4').addClass('current'); | ||
} | ||
catch (err) { | ||
console.log("Error expanding nav for anchor", err); | ||
} | ||
} | ||
}, | ||
hashChange = function () { | ||
linkScroll = true; | ||
win.one('hashchange', function () { | ||
linkScroll = false; | ||
}); | ||
}; | ||
jquery(init); | ||
return { | ||
enable : enable | ||
enable: enable, | ||
hashChange: hashChange | ||
}; | ||
}()); | ||
return { | ||
StickyNav : stickyNav | ||
StickyNav: stickyNav | ||
}; | ||
}($)); |
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 |
---|---|---|
|
@@ -5,16 +5,16 @@ | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> | ||
<head> | ||
<meta charset="utf-8"> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
|
||
<title>Taz API Documentation — Taz 1.0.0b1 documentation</title> | ||
<title>Taz API Documentation — Taz 1.0.0 documentation</title> | ||
|
||
|
||
|
||
|
||
|
||
|
||
<link href='https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic|Roboto+Slab:400,700|Inconsolata:400,700&subset=latin,cyrillic' rel='stylesheet' type='text/css'> | ||
|
||
|
||
|
||
|
@@ -30,11 +30,11 @@ | |
|
||
|
||
|
||
<link rel="top" title="Taz 1.0.0b1 documentation" href="index.html"/> | ||
<link rel="top" title="Taz 1.0.0 documentation" href="index.html"/> | ||
<link rel="prev" title="Contact" href="help.html"/> | ||
|
||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js"></script> | ||
<script src="_static/js/modernizr.min.js"></script> | ||
|
||
</head> | ||
|
||
|
@@ -46,8 +46,14 @@ | |
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> | ||
<div class="wy-side-nav-search"> | ||
|
||
<a href="index.html" class="fa fa-home"> Taz</a> | ||
|
||
|
||
<a href="index.html" class="icon icon-home"> Taz | ||
|
||
|
||
|
||
</a> | ||
|
||
|
||
<div role="search"> | ||
<form id="rtd-search-form" class="wy-form" action="search.html" method="get"> | ||
|
@@ -56,6 +62,8 @@ | |
<input type="hidden" name="area" value="default" /> | ||
</form> | ||
</div> | ||
|
||
|
||
</div> | ||
|
||
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> | ||
|
@@ -76,15 +84,21 @@ | |
<li class="toctree-l2"><a class="reference internal" href="using_game.html#registering-scenes-with-the-game">Registering scenes with the game</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="using_game.html#using-the-scene-stack">Using the scene stack</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="using_game.html#sharing-data-between-all-scenes">Sharing data between all scenes</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="using_game.html#how-to-switch-between-scenes">How to switch between scenes</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="using_game.html#how-to-integrate-with-a-game-library">How to integrate with a game library</a></li> | ||
</ul> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="inhereting_scene.html">Inhereting the “Scene” class</a><ul> | ||
<li class="toctree-l2"><a class="reference internal" href="inhereting_scene.html#adding-data-to-a-single-scene">Adding data to a single scene</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="inhereting_scene.html#what-to-put-in-initialize">What to put in “initialize”</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="inhereting_scene.html#the-scenes-event-cycle">The scenes event cycle</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="inhereting_scene.html#what-to-put-in-teardown">What to put in teardown</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="inheriting_scene.html">Inheriting the “Scene” class</a><ul> | ||
<li class="toctree-l2"><a class="reference internal" href="inheriting_scene.html#instancing-the-scene-class">Instancing the Scene class</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="inheriting_scene.html#a-scene-s-life-cycle">A Scene’s life cycle</a><ul> | ||
<li class="toctree-l3"><a class="reference internal" href="inheriting_scene.html#what-to-put-in-initialize">What to put in “initialize”</a></li> | ||
<li class="toctree-l3"><a class="reference internal" href="inheriting_scene.html#the-scenes-event-cycle">The scenes event cycle</a><ul> | ||
<li class="toctree-l4"><a class="reference internal" href="inheriting_scene.html#using-the-update-method">Using the Update method</a></li> | ||
<li class="toctree-l4"><a class="reference internal" href="inheriting_scene.html#using-the-render-method">Using the Render method</a></li> | ||
</ul> | ||
</li> | ||
<li class="toctree-l3"><a class="reference internal" href="inheriting_scene.html#what-to-put-in-tear-down-and-resume">What to put in tear_down and resume</a></li> | ||
</ul> | ||
</li> | ||
<li class="toctree-l2"><a class="reference internal" href="inheriting_scene.html#adding-data-to-a-single-scene">Adding data to a single scene</a></li> | ||
</ul> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a><ul> | ||
|
@@ -124,7 +138,9 @@ | |
<li>Taz API Documentation</li> | ||
<li class="wy-breadcrumbs-aside"> | ||
|
||
<a href="_sources/api.txt" rel="nofollow"> View page source</a> | ||
|
||
<a href="_sources/api.txt" rel="nofollow"> View page source</a> | ||
|
||
|
||
</li> | ||
</ul> | ||
|
@@ -152,7 +168,7 @@ | |
</tbody> | ||
</table> | ||
<p>To construct an instance of this class, a update_context | ||
and a render_context, depenging on the used underlying | ||
and a render_context, depending on the used underlying | ||
engine is used. To ensure functionality call the base class’ constructor when overriding the __init__-function.</p> | ||
<dl class="method"> | ||
<dt id="taz.game.Game.pop_scene_from_stack"> | ||
|
@@ -216,7 +232,8 @@ | |
<dl class="class"> | ||
<dt id="taz.game.Scene"> | ||
<em class="property">class </em><code class="descclassname">taz.game.</code><code class="descname">Scene</code><span class="sig-paren">(</span><em>ident</em><span class="sig-paren">)</span><a class="headerlink" href="#taz.game.Scene" title="Permalink to this definition">¶</a></dt> | ||
<dd><p>This is the abstract base class of all scenes. All Scenes must be derived from this and override the abstract methods. | ||
<dd><p>This is the abstract base class of all scenes. | ||
All Scenes must be derived from this and override the abstract methods. | ||
On each tick the render and update functions are called. They get passed the update_context and render_context | ||
passed to the Game object on creation.</p> | ||
<p>When creating an instance of this class a string-identifier must be passed to the constructor in order | ||
|
@@ -242,9 +259,15 @@ | |
<dd><p>This method builds up the scene</p> | ||
</dd></dl> | ||
|
||
<dl class="method"> | ||
<dt id="taz.game.Scene.pause"> | ||
<code class="descname">pause</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#taz.game.Scene.pause" title="Permalink to this definition">¶</a></dt> | ||
<dd><p>This function is called whenever a scene is pushed on top of the active one</p> | ||
</dd></dl> | ||
|
||
<dl class="method"> | ||
<dt id="taz.game.Scene.render"> | ||
<code class="descname">render</code><span class="sig-paren">(</span><em>render_context</em><span class="sig-paren">)</span><a class="headerlink" href="#taz.game.Scene.render" title="Permalink to this definition">¶</a></dt> | ||
<code class="descname">render</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#taz.game.Scene.render" title="Permalink to this definition">¶</a></dt> | ||
<dd><p>This method draws the game’s screen</p> | ||
</dd></dl> | ||
|
||
|
@@ -262,7 +285,7 @@ | |
|
||
<dl class="method"> | ||
<dt id="taz.game.Scene.update"> | ||
<code class="descname">update</code><span class="sig-paren">(</span><em>update_context</em><span class="sig-paren">)</span><a class="headerlink" href="#taz.game.Scene.update" title="Permalink to this definition">¶</a></dt> | ||
<code class="descname">update</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#taz.game.Scene.update" title="Permalink to this definition">¶</a></dt> | ||
<dd><p>This method updates the game’s logic</p> | ||
</dd></dl> | ||
|
||
|
@@ -277,7 +300,7 @@ | |
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> | ||
|
||
|
||
<a href="help.html" class="btn btn-neutral" title="Contact"><span class="fa fa-arrow-circle-left"></span> Previous</a> | ||
<a href="help.html" class="btn btn-neutral" title="Contact" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a> | ||
|
||
</div> | ||
|
||
|
@@ -289,10 +312,10 @@ | |
© Copyright 2015, Max Klingmann <[email protected]>. | ||
</p> | ||
</div> | ||
|
||
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. | ||
|
||
</footer> | ||
|
||
</div> | ||
</div> | ||
|
||
|
@@ -307,7 +330,7 @@ | |
<script type="text/javascript"> | ||
var DOCUMENTATION_OPTIONS = { | ||
URL_ROOT:'./', | ||
VERSION:'1.0.0b1', | ||
VERSION:'1.0.0', | ||
COLLAPSE_INDEX:false, | ||
FILE_SUFFIX:'.html', | ||
HAS_SOURCE: true | ||
|
Oops, something went wrong.