mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 12:08:21 +08:00
Opt: Add load_offset method to Button class
It will be useful in the future
This commit is contained in:
@@ -88,6 +88,16 @@ class Button:
|
||||
self.image = np.array(image.crop(self.area))
|
||||
return self.color
|
||||
|
||||
def load_offset(self, button):
|
||||
"""
|
||||
Load offset from another button.
|
||||
|
||||
Args:
|
||||
button (Button):
|
||||
"""
|
||||
offset = np.subtract(button.button, button._button)[:2]
|
||||
self._button_offset = area_offset(self._button, offset=offset)
|
||||
|
||||
def ensure_template(self):
|
||||
"""
|
||||
Load asset image.
|
||||
|
||||
Reference in New Issue
Block a user