本文整理匯總了Python中rect.Rect.from_dimensions方法的典型用法代碼示例。如果您正苦於以下問題:Python Rect.from_dimensions方法的具體用法?Python Rect.from_dimensions怎麽用?Python Rect.from_dimensions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rect.Rect
的用法示例。
在下文中一共展示了Rect.from_dimensions方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from rect import Rect [as 別名]
# 或者: from rect.Rect import from_dimensions [as 別名]
def __init__(self, x, y, w, h, objects = [], creatures = [],
start = False):
self.inner_rect = Rect.from_dimensions(x + WALL_WIDTH, y + int(WALL_WIDTH * 1.25),
w + WALL_WIDTH, h + int(WALL_WIDTH * 1.5))
self.outer_rect = Rect.from_dimensions(x, y,
2 * WALL_WIDTH + w,
2 * WALL_WIDTH + h)
示例2: __init__
# 需要導入模塊: from rect import Rect [as 別名]
# 或者: from rect.Rect import from_dimensions [as 別名]
def __init__(self, go_through, symbol, description,
event_map = {}, range = 1, id = None, x_ = 0,
y_ = 0, color = TEXT_COLOR, delayed = empty_interaction):
delayed(self)
self.set_events(self.event_map)
self.rect_ = Rect.from_dimensions(0, 0, 0, 0)
示例3: __init__
# 需要導入模塊: from rect import Rect [as 別名]
# 或者: from rect.Rect import from_dimensions [as 別名]
def __init__(self, origin, x, y, w, h):
self.strength = origin.strength
self.remove = False
self.sprite = vertex_list_from_rect(x, y, w, h)
self.rect = Rect.from_dimensions(x, y, w, h)