Skip to content

Commit

Permalink
moved GridEditor sample value into it's own method.
Browse files Browse the repository at this point in the history
  • Loading branch information
petteramland committed Dec 10, 2024
1 parent 2a746d9 commit c2a8cf3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ursina/prefabs/grid_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ def update(self):
self.prev_draw = (x,y)

else: # sample color
self.selected_char = self.grid[x][y]
self.sample(x, y)


if held_keys[self.shortcuts['select']]: # selection
self.rect_selection[1] = self.get_cursor_position()
Expand Down Expand Up @@ -234,6 +235,10 @@ def draw(self, x, y):
self.render()


def sample(self, x, y):
self.selected_char = self.grid[x][y]


def input(self, key):
combined_key = input_handler.get_combined_key(key)

Expand Down

0 comments on commit c2a8cf3

Please sign in to comment.