diff --git a/doc/sources/.static/default.css b/doc/sources/.static/default.css index 219bd5242..67b529426 100644 --- a/doc/sources/.static/default.css +++ b/doc/sources/.static/default.css @@ -55,7 +55,6 @@ a:hover { } - /** Header */ #topbar { @@ -599,6 +598,11 @@ table.field-list th.field-name { /** Image link */ +div.body .align-left { + float: left; + margin: 0 20px 20px 20px; +} + div.body .align-right { float: right; margin: 0 0 20px 20px; @@ -648,3 +652,23 @@ dl.api-level dt { cursor: pointer; } +/* Getting started + */ +.gs-osimage { + margin-top: 10px; + width: 264px !important; + height: 168px; + float: left; +} +.gs-osimage canvas { + width: 128px !important; + margin: 0 auto; +} + +.gs-osimage img { + margin: 0 auto; +} + +.gs-osimage-last { + clear: right; +} diff --git a/doc/sources/gettingstarted/first_app.rst b/doc/sources/gettingstarted/first_app.rst index dc471b836..ecbb4c137 100644 --- a/doc/sources/gettingstarted/first_app.rst +++ b/doc/sources/gettingstarted/first_app.rst @@ -1,5 +1,20 @@ A first App =========== -the simplest App possible, with a kv file using only basic widgets. +Jump into the code +------------------ + +Immerse yourself into the world of Kivy with your first App. + +.. image:: ../images/gs-tutorial.png + :align: center + +The :doc:`/tutorials/pong` introduces the fundamental design patterns and +application development process. As you follow the tutorial, you will create a simple app. +You will also learn how to run your app in on your OS. The simple steps in the tutorial +introduce elegant, useful concepts that you use over and over again in app development. + +Your :doc:`/tutorials/pong` is the most important article in the road map. It +lays the foundation for the concepts that you will learn more about later. Each +of the other articles expands on one of those concepts. diff --git a/doc/sources/gettingstarted/installation.rst b/doc/sources/gettingstarted/installation.rst index cfe6ccf7d..aa692add7 100644 --- a/doc/sources/gettingstarted/installation.rst +++ b/doc/sources/gettingstarted/installation.rst @@ -1,37 +1,36 @@ Installation ============ -Installing Tools ----------------- +Installing Kivy SDK +------------------- -Using Kivy software development kit you can create using your choice of a favourite -development enviornment to rapidly churn out a App. +Using Kivy SDK, you can use your favorite development environment to start +coding your App. -.. image: ../images/gs-installation.png +To get started, you need to download the latest version of Kivy: -To get started, you need to: - - Download the latest version of Kivy. at http://kivy.org/#download + http://kivy.org/#download Please refer to the installation instructions for your specific platform: - Installation on Windows - Start a Kivy Application - Start from Command-Line - Package Contents - Installation on MacOSX - Start any Kivy Application - Start from Command Line - Installation on Linux - Prerequisites - Installation - Start from Command Line - Installation on Android - Installation of Examples - Packaging for IOS +.. image:: ../images/windows.png + :alt: Windows + :target: ../installation/installation-windows.html + :class: gs-osimage -If you want to use the devlopment version of Kivy, so you can use the last additions to the framework, you can get the source code from github. +.. image:: ../images/macosx.png + :alt: MacOSX + :target: ../installation/installation-macosx.html + :class: gs-osimage + +.. image:: ../images/linux.png + :alt: Linux + :target: ../installation/installation-linux.html + :class: gs-osimage gs-osimage-last + +If you want to use the development version of Kivy, so you can use the last +additions to the framework, you can get the source code from github:: git clone http://github.com/kivy/kivy -Take a look at our instructions on Installation of Development version. +Take a look at our instructions on Installation of :ref:`installation_devel` diff --git a/doc/sources/gettingstarted/intro.rst b/doc/sources/gettingstarted/intro.rst index 1b63e158e..2bfd17a70 100644 --- a/doc/sources/gettingstarted/intro.rst +++ b/doc/sources/gettingstarted/intro.rst @@ -23,7 +23,7 @@ Follow this guide to get the tools you need, understand the major concepts and best practices, as this is an introduction, pointers will be provided at the end of each section to find more information. -As you proceed through the guide, you will, using kivy sdk: +As you proceed through the guide, you will, using Kivy SDK: - **Learn**: The basics of programming with the Kivy language. - **Explore**: The Kivy framework. diff --git a/doc/sources/images/gs-tutorial.png b/doc/sources/images/gs-tutorial.png new file mode 100644 index 000000000..a200c935e Binary files /dev/null and b/doc/sources/images/gs-tutorial.png differ diff --git a/doc/sources/images/linux.png b/doc/sources/images/linux.png new file mode 100644 index 000000000..23f4bd074 Binary files /dev/null and b/doc/sources/images/linux.png differ diff --git a/doc/sources/images/macosx.png b/doc/sources/images/macosx.png new file mode 100644 index 000000000..d1f139f71 Binary files /dev/null and b/doc/sources/images/macosx.png differ diff --git a/doc/sources/images/windows.png b/doc/sources/images/windows.png new file mode 100644 index 000000000..a20fa073c Binary files /dev/null and b/doc/sources/images/windows.png differ diff --git a/doc/sources/installation/installation-linux.rst b/doc/sources/installation/installation-linux.rst index f647ade67..bc5440596 100644 --- a/doc/sources/installation/installation-linux.rst +++ b/doc/sources/installation/installation-linux.rst @@ -1,3 +1,5 @@ +.. _installation_linux: + Installation on Linux ===================== diff --git a/doc/sources/installation/installation-macosx.rst b/doc/sources/installation/installation-macosx.rst index 7c8adca64..59da8d8af 100644 --- a/doc/sources/installation/installation-macosx.rst +++ b/doc/sources/installation/installation-macosx.rst @@ -1,3 +1,5 @@ +.. _installation_macosx: + Installation on MacOSX ====================== diff --git a/doc/sources/installation/installation-windows.rst b/doc/sources/installation/installation-windows.rst index 401e407cd..e2fd8db15 100644 --- a/doc/sources/installation/installation-windows.rst +++ b/doc/sources/installation/installation-windows.rst @@ -1,3 +1,5 @@ +.. _installation_windows: + Installation on Windows ======================= diff --git a/doc/sources/installation/installation.rst b/doc/sources/installation/installation.rst index 6953b71aa..1af19cc79 100644 --- a/doc/sources/installation/installation.rst +++ b/doc/sources/installation/installation.rst @@ -52,6 +52,8 @@ Please refer to the installation instructions for your specific platform: installation-android +.. _installation_devel: + Development Version ------------------- diff --git a/examples/tutorials/pong/main.py b/examples/tutorials/pong/main.py index 6d1a1fc79..349297312 100644 --- a/examples/tutorials/pong/main.py +++ b/examples/tutorials/pong/main.py @@ -1,30 +1,31 @@ import kivy +kivy.require('1.1.1') + from kivy.app import App from kivy.uix.widget import Widget from kivy.properties import NumericProperty, ReferenceListProperty, ObjectProperty from kivy.vector import Vector from kivy.factory import Factory from kivy.clock import Clock -from random import randint, random class PongPaddle(Widget): score = NumericProperty(0) - + def bounce_ball(self, ball): if self.collide_widget(ball): vx, vy = ball.velocity offset = (ball.center_y-self.center_y)/(self.height/2) bounced = Vector(-1*vx, vy) vel = bounced * 1.1 - ball.velocity = vel.x, vel.y + offset + ball.velocity = vel.x, vel.y + offset class PongBall(Widget): velocity_x = NumericProperty(0) velocity_y = NumericProperty(0) velocity = ReferenceListProperty(velocity_x, velocity_y) - + def move(self): self.pos = Vector(*self.velocity) + self.pos @@ -37,14 +38,14 @@ class PongGame(Widget): def serve_ball(self, vel=(4,0)): self.ball.center = self.center self.ball.velocity = vel - + def update(self, *args): self.ball.move() - + #bounce of paddles self.player1.bounce_ball(self.ball) self.player2.bounce_ball(self.ball) - + #bounce ball off bottom or top if (self.ball.y < self.y) or (self.ball.top > self.top): self.ball.velocity_y *= -1 @@ -56,8 +57,8 @@ class PongGame(Widget): if self.ball.x > self.width: self.player1.score += 1 self.serve_ball(vel=(-4,0)) - - + + def on_touch_move(self, touch): if touch.x < self.width/3: self.player1.center_y = touch.y