From 1ac1859da0b7b247aa577554ade7fc44d51e56f5 Mon Sep 17 00:00:00 2001 From: rogererens Date: Mon, 29 Apr 2013 18:20:08 +0300 Subject: [PATCH] Update pong.rst A few typos and drawing attention to an aspect not mentioned before in the text. --- doc/sources/tutorials/pong.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/sources/tutorials/pong.rst b/doc/sources/tutorials/pong.rst index 1818113d2..570077d86 100644 --- a/doc/sources/tutorials/pong.rst +++ b/doc/sources/tutorials/pong.rst @@ -141,7 +141,7 @@ So this canvas block says that the ``PongGame`` widget should draw some graphics primitives. In this case, we add a rectangle to the canvas. We set the pos of the rectangle to be 5 pixels left of the horizontal center of the widget, and 0 for y. The size of the rectangle is set to 10 pixels -in width, and the widgets height in height. The nice thing about defining the +in width, and the widgets' height in height. The nice thing about defining the graphics like this, is that the rendered rectangle will be automatically updated when the properties of any widgets used in the value expression change. @@ -149,7 +149,7 @@ updated when the properties of any widgets used in the value expression change. Try to resize the application window and notice what happens. That's right, the entire UI resizes automatically. The standard behaviour of the - Window is to resize an element based on the its property `size_hint`. The + Window is to resize an element based on its property `size_hint`. The default widget size_hint is (1,1), meaning it will be stretched 100% in both x-direction and y-direction and hence fill the available space. Since the pos and size of the rectangle and center_x and top of the score @@ -160,7 +160,7 @@ updated when the properties of any widgets used in the value expression change. The last two sections we add look pretty similar. Each of them adds a Label -widget as a child widget to the ``PongGame`` widget. For now the text on +widget as a child widget to the ``PongGame`` widget. For now, the text on both of them is just set to *"0"*. We'll hook that up to the actual score once we have the logic implemented, but the labels already look good since we set a bigger font_size, and positioned them relatively @@ -242,6 +242,8 @@ pong.kv: :language: kv :linenos: +Note that not only a `` widget rule has been added, but also a +child widget `PongBall` in the `` widget rule. Adding Ball Animation ---------------------