本文整理汇总了Python中box.Box.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Box.__init__方法的具体用法?Python Box.__init__怎么用?Python Box.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类box.Box
的用法示例。
在下文中一共展示了Box.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self, sound_manager, x, y):
Box.__init__(self, sound_manager, x, y)
self.box_time = -1
self.game_time = 0
self.init_frames()
self.refresh_image(self.display_frame)
示例2: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self, generator, *args):
Box.__init__(self, (0,0,0,0), None)
self.node = None
self.controller = None
self.generator = generator
self.args = args
self.rebuild()
示例3: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self, brick, color, tileDir, thickness, density, unglueThreshold=None, shatterLimit=None, shatterThreshold=None, noSetup=False):
if noSetup: return
depth = thickness / 2
world = brick.world
parent = brick.parent
size = entrywiseMult(vecInvert(tileDir), brick.size) + (vecBasic(tileDir) * depth)
pos = brick.node.getPos() + entrywiseMult(tileDir, brick.size) + (vecFromList(tileDir) * depth)
self.tileDir = tileDir
if unglueThreshold == None: unglueThreshold = 5
if shatterThreshold == None: shatterThreshold = 10
dir = getNeutralDir()
Box.__init__(self, world, parent, color, pos, dir, size, density, unglueThreshold, shatterLimit, shatterThreshold)
self.thickness = thickness
self.brick = brick
self.brick.addTile(self)
# Glue to brick.
self.glue = OdeFixedJoint(self.world.world)
self.glue.attachBodies(self.body, brick.body)
self.glue.set()
# Adjust collision bitmasks.
self.geom.setCategoryBits(GameObject.bitmaskTileGlued)
self.geom.setCollideBits(GameObject.bitmaskAll & ~GameObject.bitmaskBox & ~GameObject.bitmaskTileGlued & ~GameObject.bitmaskTile)
示例4: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self, argon):
self.hue = 0.0
self.saturation = 0.0
self.value = 1.0
self.gradient = argon.image('hue-saturation-360x256.png')
Box.__init__(self, 0, 0, 480+20, 256+20)
self.which = -1
示例5: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self, world, parent, color, pos, dir, axis, size, density):
Box.__init__(self, world, parent, color, pos, dir, size, density)
self.body.setGravityMode(False)
self.joint = OdeHingeJoint(world.world)
self.joint.attach(self.body, None)
self.joint.setAnchor(self.node.getPos())
self.joint.setAxis(*axis)
self.joint.setParamBounce(0.0)
示例6: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self, offset=0, box=None):
Box.__init__(self, offset, box)
if isinstance(box, FullBox) and box != None:
self.large_size = box.large_size
self.user_type = box.user_type
else:
self.version = 0
self.flags = ''
示例7: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self, nodes, style):
self.nodes = nodes
self.offset0 = [0] * (len(nodes) + 1)
self.offset1 = [0] * (len(nodes) + 1)
self.flow0 = [0] * len(nodes)
self.flow1 = [0] * len(nodes)
self.base0 = 0
self.base1 = 0
Box.__init__(self, (0,0,0,0), style)
示例8: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self, font, text, tags, head=0, tail=0):
self.font = font
self.text = text
self.tags = tags
self.head = head + 11
self.tail = tail + 40
Box.__init__(self)
self.width = 300
self.line_height = font.height * 1.2
self.dragging = False
示例9: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self, sound_manager, group, x, y, powerup=c.POWERUP_MUSHROOM):
Box.__init__(self, sound_manager, x, y)
self.group = group
self.powerup = powerup
self.empty_frame = None
self.coin_box_frames = []
self.frame_idx = 0
self.coin_box_time = 0
self.game_time = 0
self.transition_time = 0
self.empty = False
self.init_frames()
self.refresh_image(self.coin_box_frames[0])
示例10: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self, sound_manager, x, y, num_coins=1):
Box.__init__(self, sound_manager, x, y)
self.num_coins = num_coins
self.empty_frame = None
self.coin_box_frames = []
self.frame_idx = 0
self.coin_box_time = 0
self.game_time = 0
self.transition_time = 0
self.coin_score_group = pygame.sprite.Group()
self.init_frames()
self.refresh_image(self.coin_box_frames[0])
示例11: make2
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def make2(self, tile, color, tileDir, pos, size, density, shatterLimit=None, shatterThreshold=None):
self = Tile(0, 0, 0, 0, 0, noSetup = True)
world = tile.world
parent = tile.parent
self.tileDir = tileDir
if shatterThreshold == None: shatterThreshold = 10
dir = getNeutralDir()
Box.__init__(self, world, parent, color, pos, dir, size, density, shatterLimit, shatterThreshold)
self.thickness = tile.thickness
self.brick = tile.brick
self.glue = None
# Adjust collision bitmasks.
self.geom.setCategoryBits(GameObject.bitmaskTile)
self.geom.setCollideBits(GameObject.bitmaskAll & ~GameObject.bitmaskTileGlued & ~GameObject.bitmaskTile)
return self
示例12: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self):
Box.__init__(self)
self.codes_false=[0x15,0x18,0x24]
self.end_codes=[0x3,0x6,0x18,0x15]
示例13: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self, source, style, start=0, stop=None):
self.source = source
self.offsets = None
self.start = start
self.stop = stop
Box.__init__(self, (0, 0, 0, 0), style)
示例14: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self):
Box.__init__(self)
self.codes_false=["?\x0d"]
self.end_codes=[0x0d]
示例15: __init__
# 需要导入模块: from box import Box [as 别名]
# 或者: from box.Box import __init__ [as 别名]
def __init__(self, width, height, style):
Box.__init__(self, (0,0,width,height), style)