-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Trimatix/5-import
5 import
- Loading branch information
Showing
8 changed files
with
241 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,49 @@ | ||
from typing import Tuple | ||
|
||
|
||
class Texture: | ||
def __init__(self, x: int, y: int, width: int, height: int) -> None: | ||
self.x = x | ||
self.y = y | ||
self.width = width | ||
self.height = height | ||
|
||
|
||
@property | ||
def shape(self) -> Tuple[int, int]: | ||
"""The shape of the texture region, given as a (width, height) tuple. | ||
:return: The shape of the texture region, as a (width, height) tuple | ||
:rtype: Tuple[int, int] | ||
""" | ||
return (self.width, self.height) | ||
|
||
|
||
@shape.setter | ||
def shape(self, value: Tuple[int, int]) -> None: | ||
"""Set the shape of the texture region. | ||
:param value: The shape of the texture region, as a (width, height) tuple | ||
:type value: Tuple[int, int] | ||
""" | ||
(self.width, self.height) = value | ||
|
||
|
||
@property | ||
def position(self) -> Tuple[int, int]: | ||
"""The coordinates of the texture region relative to the AEI origin, given as an (x, y) tuple. | ||
:return: The coordinates of the texture region, as an (x, y) tuple | ||
:rtype: Tuple[int, int] | ||
""" | ||
return (self.x, self.y) | ||
|
||
|
||
@position.setter | ||
def position(self, value: Tuple[int, int]) -> None: | ||
"""Set the coordinates of the texture region relative to the AEI origin. | ||
:param value: The coordinates of the texture region, as an (x, y) tuple | ||
:type value: Tuple[int, int] | ||
""" | ||
(self.x, self.y) = value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.