Skip to content

Commit d438ce5

Browse files
author
Alejandro Casanovas
authored
Improve Sections (#1392)
* Complete and improved docstrings with params Section.draw_order can now be smaller than zero Breaking change: Section.mouse_is_on_top now only checks for the section dimensions and not the event capture area. To check if a section should capture an event use Section.should_receive_mouse_event Event capture properties removed and set as attributes that are automatically set Improved some attribute access Improved SectionManager.get_section_by_name SectionManager.clear_sections will now call Section.on_hide_section on each one Improved SectionManager.get_sections with a generator expression Added event_capture param to SectionManager get_first_section and get_sections to allow to get sections based on event capture dimensions or on draw dimensions * fix unexpected identation complain * fix arcade.Camera: Vec2 now operates multiplication on scalar values and not on other Vec2 * fix docstrings * fix docstrings ... * fix docstrings ... * fix docstrings ... * fix docstrings ...
1 parent e3d6501 commit d438ce5

3 files changed

Lines changed: 205 additions & 67 deletions

File tree

arcade/camera.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ def update(self) -> None:
489489

490490
# Come up with a new velocity, pulled by opposite vector and damped
491491
self.shake_velocity += opposite_vector
492-
self.shake_velocity *= Vec2(self.shake_damping, self.shake_damping)
492+
self.shake_velocity *= self.shake_damping
493493

494494
update_view_matrix = True
495495

arcade/examples/sections_demo_3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,9 @@ def __init__(self):
259259

260260
# create and store the modal, so we can set
261261
# self.modal_section.enabled = True to show it
262-
self.modal_section = ModalSection(self.window.width / 3,
262+
self.modal_section = ModalSection((self.window.width / 2) - 150,
263263
(self.window.height / 2) - 100,
264-
400, 200)
264+
300, 200)
265265

266266
# we set accept_keyboard_events to False (default to True)
267267
self.info_bar = InfoBar(0, self.window.height - INFO_BAR_HEIGHT, self.window.width, INFO_BAR_HEIGHT,

0 commit comments

Comments
 (0)