mirror of https://github.com/kivy/kivy.git
Merge pull request #1157 from Zen-CODE/Doc_English_Improvements_32
doc: revisions to getttingstarted\drawing.rst
This commit is contained in:
commit
42f49e8d99
|
@ -1,17 +1,23 @@
|
||||||
Drawing
|
Drawing
|
||||||
-------
|
-------
|
||||||
|
|
||||||
Each widget has a canvas, i.e. a place to draw on. The canvas is a group of instructions that should be executed
|
Each widget has a canvas, i.e. a place to draw on. The canvas is a group of
|
||||||
whenever there is a change to the widget's graphics representation.
|
instructions that should be executed whenever there is a change to the widget's
|
||||||
You can add two types of instructions to the canvas, *context* instructions and *vertex* instructions.
|
graphical representation.
|
||||||
You can add instructions either from Python or from kv (the preferred way).
|
You can add two types of instructions to the canvas: *context* instructions and
|
||||||
If you add them from kv, the advantage is that they are automatically updated when any property they depend on changes.
|
*vertex* instructions. You can add instructions either from Python or from the
|
||||||
In Python, you need to do this yourself.
|
kv file (the preferred way).
|
||||||
|
If you add them via the kv file, the advantage is that they are automatically
|
||||||
|
updated when any property they depend on changes. In Python, you need to do
|
||||||
|
this yourself.
|
||||||
|
|
||||||
.. image:: ../images/gs-drawing.png
|
.. image:: ../images/gs-drawing.png
|
||||||
|
|
||||||
In both cases the canvas of the MyWidget is re-drawn whenever the ``position`` or the ``size`` of the widget changes.
|
In both cases, the canvas of `MyWidget` is re-drawn whenever the ``position``
|
||||||
|
or the ``size`` of the widget changes.
|
||||||
|
|
||||||
You can use **canvas.before** or **canvas.after** . This allows you to separate your instructions based on when you want them to happen.
|
You can use **canvas.before** or **canvas.after**. This allows you to separate
|
||||||
|
your instructions based on when you want them to happen.
|
||||||
|
|
||||||
For an in-depth look at how Kivy's graphics are handled, look :mod:`here. <kivy.graphics>`
|
For an in-depth look at how Kivy's graphics are handled, look
|
||||||
|
:mod:`here <kivy.graphics>`.
|
||||||
|
|
Loading…
Reference in New Issue