Skip to content

Commit

Permalink
builtins: screen
Browse files Browse the repository at this point in the history
  • Loading branch information
bletvaska committed Oct 3, 2018
1 parent ae89689 commit 0d31b80
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 31 deletions.
47 changes: 24 additions & 23 deletions doc/builtins.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Built-in Objects
Zabudované objekty
================

Pygame Zero provides useful built-in objects to help you make games easily.
Pygame Zero poskytuje užitočné zabudované objekty, ktoré vám pomôžu vytvárať
vaše hry jednoduchšie.


.. _screen:
Expand All @@ -14,7 +15,7 @@ Screen

ptext

The ``screen`` object represents your game screen.
Objekt ``screen`` reprezentuje vašu hernú obrazovku.

It is a thin wrapper around a Pygame surface that allows you to easily
draw images to the screen ("blit" them).
Expand All @@ -23,62 +24,62 @@ draw images to the screen ("blit" them).

.. attribute:: surface

The raw `Pygame surface`_ that represents the screen buffer. You can
use this for advanced graphics operations.
Referencia na `Pygame surface`_, ktorý reprezentuje buffer obrazovky.
Môžete ho použiť na pokročilé grafické úlohy.

.. _`Pygame surface`: https://www.pygame.org/docs/ref/surface.html

.. method:: clear()

Reset the screen to black.
Resetuje obrazovku na čierno.

.. method:: fill((red, green, blue))

Fill the screen with a solid color.
Vyplní obrazovku farbou.

.. method:: blit(image, (left, top))

Draw the image to the screen at the given position.
Vykreslí obrázok na obrazovku na zadanú pozíciu.

``blit()`` accepts either a Surface or a string as its ``image``
parameter. If ``image`` is a ``str`` then the named image will be
loaded from the ``images/`` directory.
``blit()`` akceptuje buď ``Surface`` alebo reťazec ako jej parameter
``image``. Ak je ``image`` reťazec (``str``), tak sa nahrá obrázok s týmto
názvom z priečinku ``images/``.

.. method:: draw.line(start, end, (r, g, b))

Draw a line from start to end.
Nakreslí čiaru od počiatočného bodu (``start``) po koncový (``end``).

.. method:: draw.circle(pos, radius, (r, g, b))

Draw the outline of a circle.
Nakreslí kružnicu.

.. method:: draw.filled_circle(pos, radius, (r, g, b))

Draw a filled circle.
Nakreslí kruh.

.. method:: draw.rect(rect, (r, g, b))

Draw the outline of a rectangle.
Nakreslí obrys obdĺžnika.

Takes a :ref:`Rect <rect>`.
Očakáva :ref:`Rect <rect>`.

.. method:: draw.filled_rect(rect, (r, g, b))

Draw a filled rectangle.
Nakreslí vyplnený obdĺžnik.

.. method:: draw.text(text, [pos], **kwargs)

Draw text.
Nakreslí text.

There's an extremely rich API for positioning and formatting text; see
:doc:`ptext` for full details.
K dispozícii je bohaté API pre umiestňovanie a formátovanie textu; pre
zobrazenie kompletnej dokumentácie navštívte :doc:`ptext`.

.. method:: draw.textbox(text, rect, **kwargs)

Draw text, sized to fill the given :ref:`Rect`.
Nakreslí text, ktorý vyplní daný :ref:`Rect`.

There's an extremely rich API for formatting text; see
:doc:`ptext` for full details.
K dispozícii je bohaté API pre formátovanie textu; pre zobrazenie kompletnej
dokumentácie navštívte :doc:`ptext`.

.. _rect:

Expand Down
16 changes: 8 additions & 8 deletions doc/from-scratch.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Migrating from Scratch
======================
Prechod z nástroja Scratch
==========================

This tutorial will compare an implementation of Flappy Bird written in Scratch
with one written in Pygame Zero. The Scratch and Pygame Zero programs are
Expand Down Expand Up @@ -111,7 +111,7 @@ animation by one step, so we just need to a call to ``update_walls()``::
update_walls()


The Bird
Vták
--------

The patterns described above for how Scratch logic translates to Python code
Expand Down Expand Up @@ -227,16 +227,16 @@ The biggest differences between Scratch and Pygame Zero are these:
instead of ``dead = 0`` as in Scratch.


Summary
Zhrnutie
-------

Many of the concepts available in Scratch can be translated directly into
Pygame Zero.
Množstvo konceptov dostupných v nástroji Scratch môže byť preložených priamo
do knižnice Pygame Zero.

Here are some comparisons:
Tu je niekoľko porovnaní:

+----------------------------+--------------------------------------------+
| In Scratch | In Pygame Zero |
| V nástroji Scratch | V knižnici Pygame Zero |
+============================+============================================+
| ``change y by 1`` (up) | ``bird.y -= 1`` |
+----------------------------+--------------------------------------------+
Expand Down
1 change: 1 addition & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
sphinx-quickstart on Tue Apr 14 16:09:10 2015.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Slovak translation: Miroslav "mirek" Biňas (mirek@cnl.sk)
Welcome to Pygame Zero
======================
Expand Down

0 comments on commit 0d31b80

Please sign in to comment.