treasurehunting2/PySDL2-0.9.5/doc/html/faq.html

179 lines
8.6 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PySDL2 FAQ &#8212; PySDL2 0.9.5 documentation</title>
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.9.5',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="PySDL2 0.9.5 documentation" href="index.html" />
<link rel="next" title="Release News" href="news.html" />
<link rel="prev" title="Window routines to manage on-screen windows" href="modules/sdl2ext_window.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="news.html" title="Release News"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="modules/sdl2ext_window.html" title="Window routines to manage on-screen windows"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">PySDL2 0.9.5 documentation</a> &#187;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="pysdl2-faq">
<span id="faq"></span><h1>PySDL2 FAQ<a class="headerlink" href="#pysdl2-faq" title="Permalink to this headline"></a></h1>
<p>This is a list of Frequently Asked Questions about PySDL2. If you think,
something is missing, please suggest it!</p>
<div class="section" id="on-importing">
<h2>On importing...<a class="headerlink" href="#on-importing" title="Permalink to this headline"></a></h2>
<p>... my script fails and complains that a SDL2 library could not be found!</p>
<blockquote>
<div>Do you have the libraries properly installed? Did you follow the operating
system&#8217;s way of installing or registering libraries? If you placed the
libraries in some folder, make sure that the <code class="docutils literal"><span class="pre">PYSDL2_DLL_PATH</span></code>
environment variable points to the correct location.</div></blockquote>
<p>... my script fails complaining that the <em>found</em> SDL2 library can&#8217;t be used!</p>
<blockquote>
<div>Do you use a 64-bit operating system? Please make sure, that the Python
interpreter <em>and</em> that the SDL2 libraries are either 64-bit ones <em>or</em>
32-bit ones. A 32-bit Python interpreter can&#8217;t deal with a 64-bit library
and vice versa.</div></blockquote>
</div>
<div class="section" id="using">
<h2>Using...<a class="headerlink" href="#using" title="Permalink to this headline"></a></h2>
<p>... the sdl2 API is weird. Why do you use the SDL_ prefix all the time?</p>
<blockquote>
<div>The low-level APIs for SDL2, SDL2_mixer, SDL2_ttf, ... shall represent a
clean wrapping around the original C API calls. Thus, if you have to search
for documentation or want to make a Python to C conversion (or C to Python),
most of the code cleanly maps to the original API naming and layout and you
do not have to think about whether you had to use SDL_ or TTF_ or whatever
as prefix or suffix.</div></blockquote>
<p>... the sdl2 API is does not comply to PEP-8. Please make it PEP-8 compatible.</p>
<blockquote>
<div>Most of the API is PEP-8 compatible. The low-level bindings to SDL2 and
related libraries however use the exact naming (including capital letters)
as the functions or structures, they map to. See the previous entry for
the reason of that.</div></blockquote>
</div>
<div class="section" id="how-do-i">
<h2>How do I...<a class="headerlink" href="#how-do-i" title="Permalink to this headline"></a></h2>
<p>... save my surfaces as image files?</p>
<blockquote>
<div>You can use <code class="xref py py-func docutils literal"><span class="pre">sdl2.SDL_SaveBMP()</span></code> to save them as bitmap files. Other
formats are currently unsupported, but might be added to
the <a class="reference internal" href="modules/sdl2ext.html#module-sdl2.ext" title="sdl2.ext: Python extensions for SDL2"><code class="xref py py-mod docutils literal"><span class="pre">sdl2.ext</span></code></a> package in the future.</div></blockquote>
</div>
<div class="section" id="font-handling">
<h2>Font handling...<a class="headerlink" href="#font-handling" title="Permalink to this headline"></a></h2>
<p>... is too hard. Why can&#8217;t it work the same way as pygame does?</p>
<blockquote>
<div>The <a class="reference internal" href="modules/sdl2_sdlttf.html#module-sdl2.sdlttf" title="sdl2.sdlttf: SDL2_ttf library wrapper"><code class="xref py py-mod docutils literal"><span class="pre">sdl2.sdlttf</span></code></a> API does not know about platform-specific font
locations and is unable to resolve font paths based on e.g. the font name
or typeface. It&#8217;s not its job and PySDL2 likewise does not provide such
functionality. If you need improved font detection support, you might want
to take a look at the sysfont module of the python-utils project, which can
be found at <a class="reference external" href="https://bitbucket.org/marcusva/python-utils/">https://bitbucket.org/marcusva/python-utils/</a>.</div></blockquote>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">PySDL2 FAQ</a><ul>
<li><a class="reference internal" href="#on-importing">On importing...</a></li>
<li><a class="reference internal" href="#using">Using...</a></li>
<li><a class="reference internal" href="#how-do-i">How do I...</a></li>
<li><a class="reference internal" href="#font-handling">Font handling...</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="modules/sdl2ext_window.html"
title="previous chapter">Window routines to manage on-screen windows</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="news.html"
title="next chapter">Release News</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/faq.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="news.html" title="Release News"
>next</a> |</li>
<li class="right" >
<a href="modules/sdl2ext_window.html" title="Window routines to manage on-screen windows"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">PySDL2 0.9.5 documentation</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2013-2016, Marcus von Appen.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.6.
</div>
</body>
</html>