當前位置: 首頁>>代碼示例>>Python>>正文


Python EventDispatcher.__init__方法代碼示例

本文整理匯總了Python中pyglet.event.EventDispatcher.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python EventDispatcher.__init__方法的具體用法?Python EventDispatcher.__init__怎麽用?Python EventDispatcher.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyglet.event.EventDispatcher的用法示例。


在下文中一共展示了EventDispatcher.__init__方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from pyglet.event import EventDispatcher [as 別名]
# 或者: from pyglet.event.EventDispatcher import __init__ [as 別名]
    def __init__(self, x=0, y=0, z=0, width=100, height=100,
                 anchor_x='left', anchor_y='bottom', *args, **kwargs):
        ''' Create a displayable widget.

        :Parameters:
            `x` : float
                X coordinate of the widget relative to anchor_x.
            `y` : float
                Y coordinate of the widget relative to anchor_y.
            `z` : float
                Z coordinate of the widget plane.
            `width` : int
                Width of the widget.
            `height` : int
                Height of the widget.
            `anchor_x` : str
                Horizontal alignment of the widget.
                See `Widget.anchor_x` for details.
            `anchor_y` : str
                Vertical alignment of the widget.
                See `Widget.anchor_y` for details.
        '''
        EventDispatcher.__init__(self)
        self._x, self._y, self._z = x, y, z
        self._root_x, self._root_y, self._root_z = 0,0,0
        self._width = width
        self._height = height
        self.anchor_x = anchor_x
        self.anchor_y = anchor_y
        self._children = []
        self._elements = {}
        self._moveable = True
        self._focusable = True
        self._sizeable = True
        self._hidden = False
開發者ID:Sankluj,項目名稱:PyWidget,代碼行數:37,代碼來源:widget.py

示例2: __init__

# 需要導入模塊: from pyglet.event import EventDispatcher [as 別名]
# 或者: from pyglet.event.EventDispatcher import __init__ [as 別名]
    def __init__(self):
        EventDispatcher.__init__(self)
        assert isinstance(self._event_stack, tuple)
        self._event_stack = [self.default_event_handlers]

        # list of elements that have responded to an on_element_enter event
        self.entered_elements = list()
開發者ID:bitcraft,項目名稱:pyglet,代碼行數:9,代碼來源:event.py

示例3: __init__

# 需要導入模塊: from pyglet.event import EventDispatcher [as 別名]
# 或者: from pyglet.event.EventDispatcher import __init__ [as 別名]
    def __init__(self, client):
        EventDispatcher.__init__(self)
        self.client = client

        # We need to keep track of which block we are pressing (if any). This
        # way we can have it so you have to press on and let up on a block
        # before it registers. (which is important as that's how people's
        # software works and how they expect the game to work)
        self.pressed_block = None
開發者ID:msarch,項目名稱:py,代碼行數:11,代碼來源:lesson1.py

示例4: __init__

# 需要導入模塊: from pyglet.event import EventDispatcher [as 別名]
# 或者: from pyglet.event.EventDispatcher import __init__ [as 別名]
    def __init__(self, image=None):
        if image is None:
            image = ResourceManager.get_player_image()

        ShootingSprite.__init__(self, image, rotation=90, bound_to_window=True)
        EventDispatcher.__init__(self)

        self.health = 100
        self.max_health = 100
        self.armor = None
        self.missle_damage = 10
        self.hit_damage = 100
        self.score = 0
        self.detonate = True
開發者ID:Krzycho,項目名稱:python-shooter,代碼行數:16,代碼來源:player.py

示例5: __init__

# 需要導入模塊: from pyglet.event import EventDispatcher [as 別名]
# 或者: from pyglet.event.EventDispatcher import __init__ [as 別名]
    def __init__(self):
        Layer.__init__(self)
        EventDispatcher.__init__(self)

        self.waves = []
        self.current_wave = None
        self.wave_delay = 3
        self.countdown_label = None
        self.countdown_texts = []
        self.is_started = False
        self.is_next_wave_notified = False
        self.is_enemies_deployed = False
        self.next_level_notified = False
        self.bonuses = []
開發者ID:Krzycho,項目名稱:python-shooter,代碼行數:16,代碼來源:enemy_layer.py

示例6: __init__

# 需要導入模塊: from pyglet.event import EventDispatcher [as 別名]
# 或者: from pyglet.event.EventDispatcher import __init__ [as 別名]
 def __init__(self, x=0, y=0):
     EventDispatcher.__init__(self)
     self.pos = Vec(x, y)
開發者ID:naymen,項目名稱:MELA,代碼行數:5,代碼來源:base.py

示例7: __init__

# 需要導入模塊: from pyglet.event import EventDispatcher [as 別名]
# 或者: from pyglet.event.EventDispatcher import __init__ [as 別名]
 def __init__( self, client ):
     EventDispatcher.__init__(self)
     self.client 	= client
     self.setStart 	= False
     self.setEnd 	= False
     self.erase		= False
開發者ID:brandonl,項目名稱:a-maze,代碼行數:8,代碼來源:astar.py

示例8: __init__

# 需要導入模塊: from pyglet.event import EventDispatcher [as 別名]
# 或者: from pyglet.event.EventDispatcher import __init__ [as 別名]
 def __init__(self, **kwargs):
     Widget.__init__(self, **kwargs)
     EventDispatcher.__init__(self)
     if not self.bounds:
         self.bounds = "always"
     self.is_focused = True
開發者ID:msarch,項目名稱:py,代碼行數:8,代碼來源:main.py

示例9: __init__

# 需要導入模塊: from pyglet.event import EventDispatcher [as 別名]
# 或者: from pyglet.event.EventDispatcher import __init__ [as 別名]
 def __init__(self, master):
     EventDispatcher.__init__(self)
     self.master = master
     self.owner = master
開發者ID:Ecialo,項目名稱:Codename-Parzalon,代碼行數:6,代碼來源:actor.py


注:本文中的pyglet.event.EventDispatcher.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。