-
Notifications
You must be signed in to change notification settings - Fork 1
Render
Pavel Kulyov edited this page Mar 16, 2017
·
2 revisions
Module render provides:
- Class Renderable, that forces get_render_data method for all classes that want to be rendered at screen
- remove_obsolete (Point): serves as signal to remove bullet behind the screen area (Need to be redisigned)
-
get_render_data (None) -> (gpos_list, data_gen)
- gpos_list (list of Points): list of global coordinates of objects that will be rendered at this call
- data_gen (Generator): generator that yields tuple (lpos, image, style)
- lpos (Point): local position of current Surface’s piece
- image (str): one symbol for rendering
- style (int): curses style mask (A_BOLD, A_BLINK, …)
- Example: (Point(x=5, y=5), “*”, curses.A_BOLD)
-
render_objects (objects, screen) function
- objects (list of Renderable): objects to be rendered
- screen (curses._Window): curses window object that have methods `addch’, `addstr’ and etc.
- rendering algorithm: will be soon
will be soon
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ - - - | │
│ - - - | │
│ - x^x. - . - | │
│ - X - - | │
│ - * - - | │
│ - - - | │
│ . - . - . - | │
│ - - - | │
│ - - - | │
│ - . . - - | │
│ - - - | │
│ - . - . - | │
│ - - - | │
│ - - - | │
│ - - - | │
│ - - . - | │
│ - . * - - | │
│ - *** . - - | │
│ - ***** - - | │
│ - ***** - - | │
│ - ****** - - | │
│ - . **** - - | │
│ - *** - - | │
│ - ****** - - | │
│ - **** - . - | │
│ . * - - | │
│ - - - | │
│ - - - | │
│ - . - - | │
│ - - . O │
│ - - <=H=> │
│ - - * * │
└─Hull: [██████████]──Shield: [██████████]──Weapon: Blaster | [999/999]─[██████████]─────┘