2012-06-04 20:46:34 +00:00
|
|
|
Examples
|
|
|
|
--------
|
|
|
|
|
2014-06-09 19:20:52 +00:00
|
|
|
.. container:: title
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
Follow through the examples.
|
|
|
|
|
|
|
|
.. |ani_dir| replace:: ./examples/animation
|
|
|
|
.. |ani_file| replace:: animate.py
|
2014-06-08 08:01:18 +00:00
|
|
|
.. |ani_desc| replace:: Widget animation using
|
|
|
|
:class:`Animation <kivy.animation.Animation>`
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |app_dir| replace:: ./examples/application
|
|
|
|
.. |app_file1| replace:: app_with_build.py
|
2014-06-08 08:01:18 +00:00
|
|
|
.. |app_desc1| replace:: Application example using
|
|
|
|
:py:meth:`~kivy.app.App.build`
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |app_file2| replace:: app_with_kv.py
|
2014-06-08 07:49:57 +00:00
|
|
|
.. |app_desc2| replace:: Application from a :mod:`.kv <kivy.lang>` file
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |app_file3| replace:: app_with_kv_in_template1.py
|
2014-06-08 07:49:57 +00:00
|
|
|
.. |app_desc3| replace:: Application from a :mod:`kv_directory <kivy.lang>`
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |aud_dir| replace:: ./examples/audio:
|
|
|
|
.. |aud_file| replace:: main.py
|
2014-06-08 08:01:18 +00:00
|
|
|
.. |aud_desc| replace:: How to play :mod:`Audio <kivy.core.audio>`.
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |can_dir| replace:: ./examples/canvas
|
|
|
|
.. |can_file1| replace:: bezier.py
|
2014-06-08 08:01:18 +00:00
|
|
|
.. |can_desc1| replace:: How to draw
|
|
|
|
:class:`Bezier <kivy.graphics.Bezier>` Lines
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |can_file2| replace:: canvas_stress.py
|
2012-07-08 12:25:50 +00:00
|
|
|
.. |can_desc2| replace:: Stress test :class:`Canvas <kivy.graphics.Canvas>`
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |can_file3| replace:: mesh.py
|
2014-06-08 09:21:31 +00:00
|
|
|
.. |can_desc3| replace:: How to use the
|
|
|
|
:class:`Mesh <kivy.graphics.Mesh>` in kivy
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |can_file4| replace:: multitexture.py
|
2014-06-08 08:01:18 +00:00
|
|
|
.. |can_desc4| replace:: How to handle multiple textures with a
|
|
|
|
:class:`Shader <kivy.graphics.shader.Shader>`
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |can_file5| replace:: stencil_canvas.py
|
2014-06-08 09:21:31 +00:00
|
|
|
.. |can_desc5| replace:: How to use the
|
2014-06-08 08:55:23 +00:00
|
|
|
:mod:`Stencil <kivy.graphics.stencil_instructions>`
|
|
|
|
on the widget canvas
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |dem_dir| replace:: ./examples/demo:
|
|
|
|
.. |dem_file| replace:: camera_puzzle.py
|
2014-06-08 09:21:31 +00:00
|
|
|
.. |dem_desc| replace:: A puzzle using the
|
|
|
|
:class:`Camera <kivy.uix.camera.Camera>` output
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |pic_dir| replace:: ./examples/demo/pictures
|
|
|
|
.. |pic_file| replace:: main.py
|
2014-06-08 09:21:31 +00:00
|
|
|
.. |pic_desc| replace:: Highlights usage of the
|
|
|
|
:class:`Image <kivy.uix.image>` and
|
2014-06-08 08:55:23 +00:00
|
|
|
:class:`Scatter <kivy.uix.scatter>` Widgets
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |sed_dir| replace:: ./examples/demo/shadereditor
|
|
|
|
.. |sed_file| replace:: main.py
|
2014-06-08 09:21:31 +00:00
|
|
|
.. |sed_desc| replace:: How to use the
|
2014-06-09 19:17:24 +00:00
|
|
|
:class:`fragment and vertex shaders
|
|
|
|
<kivy.graphics.shader.Shader>`.
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |sho_dir| replace:: ../examples/demo/showcase
|
|
|
|
.. |sho_file| replace:: main.py
|
2014-06-08 18:13:42 +00:00
|
|
|
.. |sho_desc| replace:: Showcase of the
|
|
|
|
:class:`widgets <kivy.uix.widget.Widget>` and
|
|
|
|
:mod:`layouts <kivy.uix.layout>` available in kivy
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |tch_dir| replace:: ./examples/demo/touchtracer
|
|
|
|
.. |tch_file| replace:: main.py
|
2013-06-07 23:00:14 +00:00
|
|
|
.. |tch_desc| replace:: Draw lines under every detected touch
|
2014-06-08 18:23:40 +00:00
|
|
|
.. |tch_desc2| replace:: A good place to understand how
|
|
|
|
:mod:`touch events <kivy.input.motionevent>`
|
|
|
|
work in kivy
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |tws_dir| replace:: ./examples/frameworks/twisted
|
|
|
|
.. |tws_file| replace:: echo_client_app.py
|
|
|
|
.. |tws_file2| replace:: echo_server_app.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |tws_desc| replace:: A client and server app using
|
|
|
|
:doc:`Twisted inside Kivy </guide/other-frameworks>`
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |gst_dir| replace:: ./examples/gestures
|
|
|
|
.. |gst_file| replace:: gesture_board.py
|
2014-06-08 19:16:56 +00:00
|
|
|
.. |gst_desc| replace:: A clean board to try out
|
|
|
|
:mod:`gestures <kivy.gesture>`
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |kv_dir| replace:: ./examples/guide/designwithkv
|
|
|
|
.. |kv_file| replace:: main.py
|
2014-06-11 20:20:45 +00:00
|
|
|
.. |kv_desc| replace:: Programming Guide examples on how to :doc:`design with
|
2014-06-08 08:55:23 +00:00
|
|
|
kv lang </guide/lang>`
|
2012-06-04 20:46:34 +00:00
|
|
|
|
2013-04-14 12:44:01 +00:00
|
|
|
.. |fwd_dir| replace:: ./examples/tutorials/firstwidget
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |fwd_file| replace:: 1_skeleton.py
|
|
|
|
.. |fwd_file2| replace:: 2_print_touch.py
|
|
|
|
.. |fwd_file3| replace:: 3_draw_ellipse.py
|
|
|
|
.. |fwd_file4| replace:: 4_draw_line.py
|
|
|
|
.. |fwd_file5| replace:: 5_random_colors.py
|
|
|
|
.. |fwd_file6| replace:: 6_button.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |fwd_desc| replace:: Programming Guide example: :doc:`Your first
|
|
|
|
widget </tutorials/firstwidget>`
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |qst_dir| replace:: ./examples/guide/quickstart
|
|
|
|
.. |qst_file| replace:: main.py
|
2014-06-11 20:20:45 +00:00
|
|
|
.. |qst_desc| replace:: Programming Guide example:
|
|
|
|
:doc:`Create an application </guide/basic>`
|
2012-06-04 20:46:34 +00:00
|
|
|
|
2014-06-10 06:26:01 +00:00
|
|
|
.. _kinect: http://en.wikipedia.org/wiki/kinect
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |kin_dir| replace:: ./examples/kinect
|
|
|
|
.. |kin_file| replace:: main.py
|
2014-06-10 06:26:01 +00:00
|
|
|
.. |kin_desc| replace:: How to use the `kinect`_ for input
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |kvd_dir| replace:: ./examples/kv
|
|
|
|
.. |kvd_file| replace:: kvrun.py
|
2014-06-09 19:03:04 +00:00
|
|
|
.. |kvd_desc| replace:: Load kv files, use
|
|
|
|
:mod:`kv lang <kivy.lang>`
|
|
|
|
to load different
|
|
|
|
:class:`widgets <kivy.uix.widget.Widget>`.
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |rst_dir| replace:: ./examples/RST_Editor
|
|
|
|
.. |rst_file| replace:: main.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |rst_desc| replace:: An RST editor for the
|
|
|
|
:class:`RstDocument <kivy.uix.rst.RstDocument>` Widget
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |sdr_dir| replace:: ./examples/shader
|
|
|
|
.. |sdr_file| replace:: plasma.py
|
|
|
|
.. |sdr_file1| replace:: shadertree.py
|
2014-06-09 19:17:24 +00:00
|
|
|
.. |sdr_desc| replace:: How to use different
|
|
|
|
:class:`Shaders <kivy.graphics.shader.Shader>`.
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |png_dir| replace:: ./examples/tutorials/pong
|
|
|
|
.. |png_file| replace:: main.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |png_desc| replace:: :doc:`/tutorials/pong`. Your first step in kivy
|
|
|
|
programming
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
.. |wdg_dir| replace:: ./examples/widgets
|
|
|
|
.. |wdg_file1| replace:: accordion_1.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc1| replace:: Usage and showcase of
|
|
|
|
:class:`Accordion <kivy.uix.accordion>` Widget
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |wdg_file2| replace:: asyncimage.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc2| replace:: Usage and showcase of
|
|
|
|
:class:`AsyncImage <kivy.uix.image.AsyncImage>` Widget
|
2012-09-30 11:43:48 +00:00
|
|
|
.. |wdg_file25| replace:: boxlayout_pos_hint.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc25| replace:: Showcase of pos_hint under
|
|
|
|
:class:`BoxLayout <kivy.uix.boxlayout>`
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |wdg_file3| replace:: bubble_test.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc3| replace:: Usage and Showcase of :class:`Bubble <kivy.uix.bubble>`
|
|
|
|
Widget
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |wdg_file4| replace:: customcollide.py
|
2014-06-09 19:38:07 +00:00
|
|
|
.. |wdg_desc4| replace:: Test for
|
|
|
|
:attr:`collision <kivy.uix.widget.Widget.collide_point>`
|
|
|
|
with custom shaped widget
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |wdg_file5| replace:: fbowidget.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc5| replace:: Usage of :class:`FBO <kivy.graphics.fbo>` to speed up
|
|
|
|
graphics
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |wdg_file6| replace:: image_mipmap.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc6| replace:: How to use :class:`Image <kivy.uix.image>` widget with
|
|
|
|
mipmap
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |wdg_file7| replace:: keyboardlistener.py
|
2013-06-07 23:00:14 +00:00
|
|
|
.. |wdg_desc7| replace:: Listen to the keyboard input and spew result to console
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |wdg_file8| replace:: label_mipmap.py
|
2012-09-30 21:00:58 +00:00
|
|
|
.. |wdg_desc8| replace:: How to use :class:`Label <kivy.uix.label>` widget with
|
|
|
|
.. |wdg_file81| replace:: label_with_markup.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc81| replace:: Usage of :class:`Label <kivy.uix.label>` widget with
|
|
|
|
markup
|
2012-09-30 21:00:58 +00:00
|
|
|
.. |wdg_file82| replace:: popup_with_kv.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc82| replace:: Usage of
|
|
|
|
:class:`Popup <kivy.uix.popup>` widget with ``kv``
|
|
|
|
language
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |wdg_file9| replace:: rstexample.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc9| replace:: Usage and showcase of
|
|
|
|
:class:`RstDocument <kivy.uix.rst.RstDocument>` Widget
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |wdg_file10| replace:: scatter.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc10| replace:: Usage and showcase of
|
|
|
|
:class:`Scatter <kivy.uix.scatter>` Widget
|
2012-07-14 10:01:01 +00:00
|
|
|
.. |wdg_file11| replace:: screenmanager.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc11| replace:: Usage and showcase of
|
|
|
|
:mod:`ScreenManager <kivy.uix.screenmanager>` Module
|
2012-07-14 10:01:01 +00:00
|
|
|
.. |wdg_file12| replace:: scrollview.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc12| replace:: Usage and showcase of
|
|
|
|
:class:`ScrollView <kivy.uix.scrollview>` Widget
|
2012-08-17 00:19:14 +00:00
|
|
|
.. |wdg_file14| replace:: spinner.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc14| replace:: Usage and showcase of
|
|
|
|
:class:`Spinner <kivy.uix.spinner>` Widget
|
2012-08-17 00:19:14 +00:00
|
|
|
.. |wdg_file15| replace:: tabbedpanel.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc15| replace:: Usage of a simple
|
|
|
|
:class:`TabbedPanel <kivy.uix.tabbedpanel.TabbedPanel>`
|
2012-08-17 00:19:14 +00:00
|
|
|
.. |wdg_file16| replace:: tabbed_panel_showcase.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc16| replace:: Advanced showcase of
|
|
|
|
:class:`TabbedPanel <kivy.uix.tabbedpanel.TabbedPanel>`
|
2012-08-17 00:19:14 +00:00
|
|
|
.. |wdg_file17| replace:: textalign.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc17| replace:: Usage of text alignment in
|
|
|
|
:class:`Label <kivy.uix.label>` widget
|
2012-08-17 00:19:14 +00:00
|
|
|
.. |wdg_file18| replace:: textinput.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc18| replace:: Usage and Showcase of
|
|
|
|
:class:`TextInput <kivy.uix.textinput>` Widget
|
2012-08-17 00:19:14 +00:00
|
|
|
.. |wdg_file19| replace:: unicode_textinput.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc19| replace:: Showcase of unicode text in
|
|
|
|
:class:`TextInput <kivy.uix.textinput>` Widget
|
2012-08-17 00:19:14 +00:00
|
|
|
.. |wdg_file20| replace:: videoplayer.py
|
2014-06-08 08:55:23 +00:00
|
|
|
.. |wdg_desc20| replace:: Usage and options of
|
|
|
|
:class:`VideoPlayer <kivy.uix.videoplayer>` Widget
|
2012-06-04 20:46:34 +00:00
|
|
|
.. |seq_dir| replace:: ./examples/widgets/sequenced_images:
|
|
|
|
.. |seq_file| replace:: main.py
|
2014-06-11 20:40:05 +00:00
|
|
|
.. _gifs: http://en.wikipedia.org/wiki/Graphics_Interchange_Format
|
|
|
|
.. |seq_desc| replace:: Showcase usage of sequenced images using
|
|
|
|
`gifs`_ and images in .zip file
|
2012-06-04 20:46:34 +00:00
|
|
|
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
| Directory | Filename/s | Example Description |
|
|
|
|
+============+===============+========================+
|
|
|
|
|- |ani_dir| | - |ani_file| |- |ani_desc| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |app_dir| | - |app_file1| |- |app_desc1| |
|
|
|
|
| | - |app_file2| |- |app_desc2| |
|
|
|
|
| | - |app_file3| |- |app_desc3| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |can_dir| | - |can_file1| |- |can_desc1| |
|
|
|
|
| | - |can_file2| |- |can_desc2| |
|
|
|
|
| | - |can_file3| |- |can_desc3| |
|
|
|
|
| | - |can_file4| |- |can_desc4| |
|
|
|
|
| | - |can_file5| |- |can_desc5| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |dem_dir| | - |dem_file| |- |dem_desc| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |pic_dir| | - |pic_file| |- |pic_desc| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |sed_dir| | - |sed_file| |- |sed_desc| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |sho_dir| | - |sho_file| |- |sho_desc| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |tch_dir| | - |tch_file| |- |tch_desc| |
|
|
|
|
| | |- |tch_desc2| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |tws_dir| | - |tws_file| |- |tws_desc| |
|
|
|
|
| | - |tws_file2| | |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |gst_dir| | - |gst_file| |- |gst_desc| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |kv_dir| | - |kv_file| |- |kv_desc| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |fwd_dir| | - |fwd_file| |- |fwd_desc| |
|
|
|
|
| | - |fwd_file2| | |
|
|
|
|
| | - |fwd_file3| | |
|
|
|
|
| | - |fwd_file4| | |
|
|
|
|
| | - |fwd_file5| | |
|
|
|
|
| | - |fwd_file6| | |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |qst_dir| | - |qst_file| |- |qst_desc| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |kin_dir| | - |kin_file| |- |kin_desc| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |kvd_dir| | - |kvd_file| |- |kvd_desc| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |rst_dir| | - |rst_file| |- |rst_desc| |
|
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |sdr_dir| | - |sdr_file| |- |sdr_desc| |
|
2012-07-08 12:25:50 +00:00
|
|
|
| | - |sdr_file1| | |
|
2012-06-04 20:46:34 +00:00
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |wdg_dir| | - |wdg_file1| |- |wdg_desc1| |
|
|
|
|
| | - |wdg_file2| |- |wdg_desc2| |
|
2012-09-30 11:43:48 +00:00
|
|
|
| | - |wdg_file25||- |wdg_desc25| |
|
2012-06-04 20:46:34 +00:00
|
|
|
| | - |wdg_file3| |- |wdg_desc3| |
|
|
|
|
| | - |wdg_file4| |- |wdg_desc4| |
|
|
|
|
| | - |wdg_file5| |- |wdg_desc5| |
|
|
|
|
| | - |wdg_file6| |- |wdg_desc6| |
|
|
|
|
| | - |wdg_file7| |- |wdg_desc7| |
|
|
|
|
| | - |wdg_file8| |- |wdg_desc8| |
|
2012-09-30 21:00:58 +00:00
|
|
|
| | - |wdg_file81||- |wdg_desc81| |
|
|
|
|
| | - |wdg_file82||- |wdg_desc82| |
|
2012-06-04 20:46:34 +00:00
|
|
|
| | - |wdg_file9| |- |wdg_desc9| |
|
|
|
|
| | - |wdg_file10||- |wdg_desc10| |
|
|
|
|
| | - |wdg_file11||- |wdg_desc11| |
|
|
|
|
| | - |wdg_file12||- |wdg_desc12| |
|
|
|
|
| | - |wdg_file14||- |wdg_desc14| |
|
|
|
|
| | - |wdg_file15||- |wdg_desc15| |
|
|
|
|
| | - |wdg_file16||- |wdg_desc16| |
|
2012-07-08 12:25:50 +00:00
|
|
|
| | - |wdg_file17||- |wdg_desc17| |
|
|
|
|
| | - |wdg_file18||- |wdg_desc18| |
|
2012-07-14 10:01:01 +00:00
|
|
|
| | - |wdg_file19||- |wdg_desc19| |
|
2012-08-17 00:19:14 +00:00
|
|
|
| | - |wdg_file20||- |wdg_desc20| |
|
2012-06-04 20:46:34 +00:00
|
|
|
+------------+---------------+------------------------+
|
|
|
|
|- |seq_dir| | - |seq_file| |- |seq_desc| |
|
2012-07-08 09:36:49 +00:00
|
|
|
+------------+---------------+------------------------+
|