当前位置: 首页>>代码示例>>Python>>正文


Python Box.__init__方法代码示例

本文整理汇总了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)
开发者ID:jkamuda,项目名称:protomonk,代码行数:9,代码来源:brick_box.py

示例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()
开发者ID:cheery,项目名称:essence,代码行数:9,代码来源:intron.py

示例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)
开发者ID:Panda3D-google-code-repositories,项目名称:heavy-destruction,代码行数:29,代码来源:tile.py

示例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
开发者ID:cheery,项目名称:essence,代码行数:9,代码来源:colorpicker.py

示例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)
开发者ID:joaofrancese,项目名称:heavy-destruction,代码行数:10,代码来源:spinner.py

示例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 = ''
开发者ID:jason860306,项目名称:pymp4,代码行数:10,代码来源:fullbox.py

示例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)
开发者ID:cheery,项目名称:essence,代码行数:11,代码来源:container.py

示例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
开发者ID:cheery,项目名称:essence,代码行数:12,代码来源:richtext.py

示例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])
开发者ID:jkamuda,项目名称:protomonk,代码行数:17,代码来源:powerup_box.py

示例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])
开发者ID:jkamuda,项目名称:protomonk,代码行数:17,代码来源:coin_box.py

示例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
开发者ID:Panda3D-google-code-repositories,项目名称:heavy-destruction,代码行数:21,代码来源:tile.py

示例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]
开发者ID:bjonnh,项目名称:prosper,代码行数:6,代码来源:prospekt.py

示例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)
开发者ID:cheery,项目名称:essence,代码行数:8,代码来源:label.py

示例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]
开发者ID:bjonnh,项目名称:prosper,代码行数:6,代码来源:pump.py

示例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)
开发者ID:cheery,项目名称:essence,代码行数:4,代码来源:__init__.py


注:本文中的box.Box.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。