Plots the rectangle shape. Args: node: The node to plot the shape on. ex: The x-coordinate of the observer. ey: The y-coordinate of the observer.
(self, node: dpg.node, center: np.ndarray, ex: float,
ey: float)
| 76 | return separate_axis_theorem(self_vertexes, other_vertexes) |
| 77 | |
| 78 | def plotSelf(self, node: dpg.node, center: np.ndarray, ex: float, |
| 79 | ey: float): |
| 80 | """ |
| 81 | Plots the rectangle shape. |
| 82 | |
| 83 | Args: |
| 84 | node: The node to plot the shape on. |
| 85 | ex: The x-coordinate of the observer. |
| 86 | ey: The y-coordinate of the observer. |
| 87 | """ |
| 88 | vertexes = self.get_vertexes(center) |
| 89 | relativeVex = [[vertex[0] - ex, vertex[1] - ey] for vertex in vertexes] |
| 90 | drawVex = [[ |
| 91 | CoordTF.zoomScale * (CoordTF.drawCenter + rev[0]), |
| 92 | CoordTF.zoomScale * (CoordTF.drawCenter - rev[1]) |
| 93 | ] for rev in relativeVex] |
| 94 | drawVex.append(drawVex[0]) |
| 95 | dpg.draw_polygon(drawVex, |
| 96 | color=(235, 47, 6), |
| 97 | fill=(229, 80, 57, 20), |
| 98 | parent=node) |
| 99 | |
| 100 | |
| 101 | class Circle(Shape): |
nothing calls this directly
no test coverage detected