當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。