Skip to content

Commit

Permalink
Translate images (#19)
Browse files Browse the repository at this point in the history
* introduction for buttons

* Translated 4 paragraphs of tutorial buttons

* First translation for hello.rst

* Few fixes for hello.rst

* Final fixes

* half translated buttons page

* next part of page buttons.rst

* last part of translation buttons.rst

* Update hello.rst according to review comments

Fixed as suggested by deshipu in #3

* Change translation of word "flash"

* Grammar fix

* Corrections

* one word chenged

* First part

* changed; my propositions: else if -> jeśli jednak; else -> w pozostałych przypadkach

* Part two

* Translate buttons (#2)

* introduction for buttons

* Translated 4 paragraphs of tutorial buttons

* half translated buttons page

* next part of page buttons.rst

* last part of translation buttons.rst

* Corrections

* one word chenged

* changed; my propositions: else if -> jeśli jednak; else -> w pozostałych przypadkach

* Poprawki od Radomira

* Kolejne poprawki od Radomira + korekta literówek

* Przywrócona właściwa wersja akapitu

* tlumaczenie tutoriala modulu Random

* Revert "tlumaczenie tutoriala modulu Random"

This reverts commit fce2ece.

* kilka akapitów dalej

* ostatnie akapity i poprawki.

* poprawka formatowania

* Poprawki od Radomira, zaakceptowane wszystkie oprócz jednej.
  • Loading branch information
WojtekReu authored and deshipu committed Mar 20, 2018
1 parent 4500c24 commit c176bae
Showing 1 changed file with 82 additions and 83 deletions.
165 changes: 82 additions & 83 deletions docs/tutorials/images.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
Images
Obrazy
------

MicroPython is about as good at art as you can be if the only thing you have is
a 5x5 grid of red LEDs (light emitting diodes - the things that light up on the
front of the device). MicroPython gives you quite a lot of control over the
display so you can create all sorts of interesting effects.
MicroPython jest tak dobry jak to tylko możliwe, jeśli chodzi o sztukę, jeśli
jedyne czym dysponujesz to macierz 5x5 diod LED (ang. Light Emitting Diodes,
diody emitujące światło na przodzie urządzenia). MicroPython daje sporo kontroli
nad wyświetlaczem, zatem możesz uzyskać sporo ciekawych efektów.

MicroPython comes with lots of built-in pictures to show on the display.
For example, to make the device appear happy you type::
MicroPython posiada wbudowany zestaw obrazów które może pokazać na wyświetlaczu.
Na przykład, żeby pokazać na ekranie szczęśliwą buźkę musimy napisać::

from microbit import *
display.show(Image.HAPPY)

I suspect you can remember what the first line does. The second line uses the
``display`` object to ``show`` a built-in image. The happy image we want to
display is a part of the ``Image`` object and called ``HAPPY``. We tell
``show`` to use it by putting it between the parenthesis (``(`` and ``)``).
Mam nadzieję, że pamiętasz co robi pierwsza linijka powyżej. Druga linia używa
obiektu ``display`` i metody ``show`` (ang. pokaż) do wyświetlenia obrazka. Buźka
którą chcemy wyświetlić jest częścią obiektu ``Image`` (ang. Obraz) i nazywa się
``HAPPY`` (ang. szczęśliwy). Mówimy metodzie ``show`` by użyła tego obrazka przez
podanie jego nazwy w nawiasach (``(`` i ``)``).

.. image:: happy.png

Here's a list of the built-in images:
Poniżej znajdziesz listę wszystkich wbudowanych obrazów:

* ``Image.HEART``
* ``Image.HEART_SMALL``
Expand Down Expand Up @@ -71,24 +72,25 @@ Here's a list of the built-in images:
* ``Image.UMBRELLA``
* ``Image.SNAKE``

There's quite a lot! Why not modify the code that makes the micro:bit look
happy to see what some of the other built-in images look like? (Just replace
``Image.HAPPY`` with one of the built-in images listed above.)
Jest ich bardzo dużo! Może zmodyfikujesz kod powyżej żeby zobaczyć jak
wyglądają pozostałe obrazy? (Wystarczy że zastąpisz ``Image.HAPPY`` jednym
z innych wbudowanych obrazów które są wypisane powyżej.)

DIY Images
++++++++++
Obrazy -- Zrób to sam
+++++++++++++++++++++

Of course, you want to make your own image to display on the micro:bit, right?
Naturalnie, na pewno chcesz stworzyć własny obrazek do wyświetlenia, prawda?

That's easy.
To proste.

Each LED pixel on the physical display can be set to one of ten values. If a
pixel is set to ``0`` (zero) then it's off. It literally has zero brightness.
However, if it is set to ``9`` then it is at its brightest level. The values
``1`` to ``8`` represent the brightness levels between off (``0``) and full on
(``9``).
Każda dioda LED (dalej nazywana pikselem) na wyświetlaczu może przyjąć jedną
z dziesięciu wartości. Jeśli piksel jest ustawiony na ``0`` (zero), to znaczy
że jest wyłączony. Po prostu jasność jest ustawiona na zero, dlatego nie świeci.
Jeśli jednak podamy wartość ``9`` to ustawiamy najwyższy poziom jasności.
Wartości od ``1`` do ``8`` reprezentują poziomy jasności między ``0`` (wyłączony)
do ``9`` (pełna jasność).

Armed with this information, it's possible to create a new image like this::
Mając powyższe na uwadze, możemy stworzyć własny obrazek w ten sposób::

from microbit import *

Expand All @@ -100,87 +102,84 @@ Armed with this information, it's possible to create a new image like this::

display.show(boat)

(When run, the device should display an old-fashioned "Blue Peter" sailing ship
with the masts dimmer than the boat's hull.)
(Kiedy uruchomisz urządzenie, na wyświetlaczu pokaże się łódka z dwoma masztami,
które będą nieco ciemniejsze od kadłuba.)

Have you figured out how to draw a picture? Have you noticed that each line of
the physical display is represented by a line of numbers ending in ``:`` and
enclosed between ``"`` double quotes? Each number specifies a brightness.
There are five lines of five numbers so it's possible to specify the individual
brightness for each of the five pixels on each of the five lines on the
physical display. That's how to create a new image.
Wiesz już jak tworzyć obrazki? Widzisz jak każda linia wyświetlacza jest
reprezentowana przez ciąg znaków kończący się ``:`` (dwukropkiem) i zamknięty
w ``"`` (cudzysłów)? Każda liczba określa jasność. Mamy pięć linii po pięć
liczb, zatem możemy osobno nadać jasność każdemu pikselowi na urządzeniu. Tak
właśnie tworzy się własne obrazy.

Simple!
Proste? Proste!

In fact, you don't need to write this over several lines. If you think you can
keep track of each line, you can rewrite it like this::
W zasadzie nie musisz podawać tych wartości w kilku liniach. Jeśli będzie to dla
ciebie czytelne, to możesz wszystkie wartości podać w jednej linii::

boat = Image("05050:05050:05050:99999:09990")

Animation
+++++++++
Animacja
++++++++

Static images are fun, but it's even more fun to make them move. This is also
amazingly simple to do with MicroPython ~ just use a list of images!
Obrazki statyczne są zabawne, ale bardziej zabawne jest ich poruszenie. To też jest
niesamowicie proste do zrobienia w MicroPython ~ po prostu użyj listy obrazków!

Here is a shopping list::
Tu jest lista zakupów::

Eggs
Bacon
Tomatoes
Jaja
Boczek
Pomidory

Here's how you'd represent this list in Python::
Oto jak przedstawiłbyś tę listę w Python::

shopping = ["Eggs", "Bacon", "Tomatoes" ]
zakupy = ["Jaja", "Boczek", "Pomidory" ]

I've simply created a list called ``shopping`` and it contains three items.
Python knows it's a list because it's enclosed in square brackets (``[`` and
``]``). Items in the list are separated by a comma (``,``) and in this instance
the items are three strings of characters: ``"Eggs"``, ``"Bacon"`` and
``"Tomatoes"``. We know they are strings of characters because they're enclosed
in quotation marks ``"``.
Po prostu utworzyłem listę nazwaną ``zakupy`` i zawiera ona trzy elementy.
Python wie, że to jest lista ponieważ jest zawarta w kwadratowych nawiasach (``[`` i
``]``). Elementy w liście są oddzielone przecinkami (``,``) i w tej instancji
elementy są trzema ciągami znaków: ``"Jaja"``, ``"Boczek"`` i ``"Pomidory"``.
My wiemy, że są one ciągami znaków ponieważ są objęte znakami cudzysłowu ``"``.

You can store anything in a list with Python. Here's a list of numbers::
W liście Python możesz przechowywać cokolwiek. Tu jest lista liczb::

primes = [2, 3, 5, 7, 11, 13, 17, 19]


.. note::

Numbers don't need to be quoted since they represent a value (rather than a
string of characters). It's the difference between ``2`` (the numeric value
2) and ``"2"`` (the character/digit representing the number 2). Don't worry
if this doesn't make sense right now. You'll soon get used to it.
Liczby nie potrzebują być w cudzysłowie dopóki reprezentują wartość (w przeciwieństwie
do ciągów znaków). Jest różnica pomiędzy ``2`` (numeryczna wartość 2) i ``"2"``
(znak/cyfra reprezentująca liczbę 2). Nie martw się jeżeli nie widzisz w
tym sensu teraz. Z czasem będzie to dla Ciebie oczywiste.

It's even possible to store different sorts of things in the same list::
Jest nawet możliwe przechowywanie różnych rodzajów rzeczy w tej samej liście::

mixed_up_list = ["hello!", 1.234, Image.HAPPY]

Notice that last item? It was an image!
Zwróciłeś uwagę na ostatni element? To był obrazek!

We can tell MicroPython to animate a list of images. Luckily we have a
couple of lists of images already built in. They're called ``Image.ALL_CLOCKS``
and ``Image.ALL_ARROWS``::
Możemy powiedzieć MicroPythonowi, aby animował listę obrazków. Szczęśliwie mamy
już kilka wbudowanych list obrazków. Są to ``Image.ALL_CLOCKS`` i
``Image.ALL_ARROWS``::

from microbit import *

display.show(Image.ALL_CLOCKS, loop=True, delay=100)

As with a single image, we use ``display.show`` to show it on the
device's display. However, we tell MicroPython to use ``Image.ALL_CLOCKS`` and
it understands that it needs to show each image in the list, one after the
other. We also tell MicroPython to keep looping over the list of images (so
the animation lasts forever) by saying ``loop=True``. Furthermore, we tell it
that we want the delay between each image to be only 100 milliseconds (a tenth
of a second) with the argument ``delay=100``.
Używamy ``display.show`` do pokazania listy obrazków na ekranie urządzenia
tak, jak w przypadku pojedynczego obrazka. Jednak mówimy MicroPythonowi użyj
``Image.ALL_CLOCKS`` i on rozumie, że musi pokazać każdy obrazek z listy
jeden po drugim. Rozkazujemy też MicroPythonowi aby powtarzał listę obrazków
(tak więc animacja trwa nieskończenie) przez ``loop=True``. Ponadto każemy mu,
aby opóźnienia pomiędzy każdym obrazkiem były tylko 100 milisekund (0,1
sekundy) w argumencie ``delay=100``.

Can you work out how to animate over the ``Image.ALL_ARROWS`` list? How do you
avoid looping forever (hint: the opposite of ``True`` is ``False`` although
the default value for ``loop`` is ``False``)? Can you change the speed of the
animation?
Czy możesz domyślić się jak animować obrazki z listy ``Image.ALL_ARROWS``?
Jak możesz uniknąć nieskończonego powtarzania (podpowiedź: przeciwieństwem do
``True`` (ang. prawdziwy) jest ``False`` (ang. fałszywy) chociaż domyślna
wartość dla ``loop`` jest ``False``)? Czy potrafisz zmienić prędkość animacji?

Finally, here's how to create your own animation. In my example I'm going to
make my boat sink into the bottom of the display::
Wreszcie tutaj możesz zobaczyć jak utworzyć swoją własną animację. W moim
przykładzie zamierzam stworzyć łódź tonącą na dno ekranu::

from microbit import *

Expand Down Expand Up @@ -223,12 +222,12 @@ make my boat sink into the bottom of the display::
all_boats = [boat1, boat2, boat3, boat4, boat5, boat6]
display.show(all_boats, delay=200)

Here's how the code works:
A tak działa ten kod:

* I create six ``boat`` images in exactly the same way I described above.
* Then, I put them all into a list that I call ``all_boats``.
* Finally, I ask ``display.show`` to animate the list with a delay of 200 milliseconds.
* Since I've not set ``loop=True`` the boat will only sink once (thus making my animation scientifically accurate). :-)
* Utworzyłem sześć obrazków ``boat`` (ang. łódź) w dokładnie ten sam sposób, jak opisałem powyżej.
* Potem umieściłem wszystkie na liście, którą nazwałem ``all_boats``.
* W końcu poprosiłem ``display.show`` o animację listy z opóźnieniem 200 milisekund.
* Ponieważ nie użyłem ``loop=True`` łódź utonie tylko raz (to czyni moją animację naukowo poprawną). :-)

What would you animate? Can you animate special effects? How would you make an
image fade out and then fade in again?
Co chciałbyś animować? Czy chciałbyś animować efekty specjalne? Jak byś zrobił
aby obrazek znikał, a potem pojawiał się znowu?

0 comments on commit c176bae

Please sign in to comment.