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


Python Activity.__init__方法代码示例

本文整理汇总了Python中activity.Activity.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Activity.__init__方法的具体用法?Python Activity.__init__怎么用?Python Activity.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在activity.Activity的用法示例。


在下文中一共展示了Activity.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
    def __init__(self, screen, items):
        Activity.__init__(self, screen)
        self.screen = screen
        
        # Position of the categories menu
        self.cat_pos = (675, 60)
        
        # Position of the activities menu
        self.act_pos = (270, 105)

        # items holds the categories
        self.menu = Menu(self.cat_pos)

        # submenus holds the different activities separated by category
        self.submenus = {}

        # Wich category is active
        self.active = None

        if items:
            for item in items:
                if not self.submenus.has_key(item.category):
                    submenu = MenuActivity(self.act_pos)
                    self.submenus[item.category] = submenu
                self.submenus[item.category].add(item)

            for item in self.submenus.keys():
                self.menu.add(ItemCategory(item, self.cat_pos))

        introduction = (u"Este contenido educativo", 
                        u"está diseñado con actividades ", 
                        u"lúdicas para la adquisición de ",
                        u"conceptos y hábitos que contribuyen ",
                        u"a formar niñas y niños saludables.",
                        u" ",
                        u"Esperamos que pases momentos ",
                        u"agradables y divertidos ",
                        u"mientras aprendes.")

        font_default = pygame.font.SysFont(constants.font_default[0],
                                           constants.font_default[1])

        isize = font_default.size(introduction[0])[1]

        introduction_pos = (constants.screen_mode[0] / 2.0 + 3, 100)
        
        introduction_ = []
        for i in introduction:
            line = font_default.render(i, True, (102, 102, 102))
            introduction_.append(line)
        self.text = ((introduction_, introduction_pos),)

        self.finger = Finger()
        self.sprites = pygame.sprite.Group()
        self.icons = pygame.sprite.Group()
        self.icons.add([Icons('stop')])
        self.sprites.add((self.finger, self.icons))
        
        self.pos = None
        return
开发者ID:milmazz,项目名称:pygame-salud,代码行数:62,代码来源:menu.py

示例2: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
 def __init__(self, screen):
     Activity.__init__(self, screen)
     self.CloseButton = pygame.sprite.RenderUpdates(([Icons('stop')]))
     self.finger = Finger()
     self.Cursor = pygame.sprite.RenderUpdates((self.finger))
     self.pos = None
     self.messages_filename = constants.poetry
开发者ID:milmazz,项目名称:pygame-salud,代码行数:9,代码来源:reads.py

示例3: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
    def __init__(self, screen, pos):
        Activity.__init__(self, screen)

 
        self.couple = set()
        self.couples = []

        self.sprites0 = pygame.sprite.OrderedUpdates()
        self.sprites1 = pygame.sprite.OrderedUpdates()
        self.pointer_ = pygame.sprite.OrderedUpdates()
        self.items = pygame.sprite.Group()
        self.icons = pygame.sprite.Group()

        self.icons.add([Icons('stop')])

        self.sprites0.add(self.icons)

        for i in pos.keys():
            item = Item(i, pos[i])
            self.sprites0.add(item)
            self.items.add(item)

        self.pointer = Pointer()
        self.pointer_.add(self.pointer)

        self.arrows = []
        self.arrow = None
开发者ID:milmazz,项目名称:pygame-salud,代码行数:29,代码来源:links.py

示例4: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
    def __init__(self, screen):
        Activity.__init__(self, screen)
        self.wrong_pos = [
                Rect(490, 272, 21, 29),
                Rect(439, 315, 47, 21),
                Rect(435, 355, 34, 29),
                Rect(458, 376, 45, 47),
                Rect(517, 372, 63, 36),
                Rect(614, 370, 37, 41),
                Rect(525, 421, 33, 30),
                Rect(567, 454, 25, 20),
                Rect(510, 473, 34, 33),
                Rect(467, 505, 36, 23),
                Rect(541, 516, 33, 28),
                Rect(639, 432, 53, 45),
                Rect(738, 329, 41, 23),
                Rect(722, 206, 29, 21),
                Rect(713, 176, 33, 20),
                Rect(653, 196, 30, 26),
                Rect(519, 271, 61, 52),
                Rect(583, 290, 24, 22),
                Rect(591, 318, 29, 38),
                Rect(401, 536, 105, 61),
                Rect(720, 248, 74, 33),
                ]

        self.found = 0

        self.screen = screen
        path = os.path.join(constants.data_folder, "backgrounds", 'illustration_020_021.png')
        self.background, rect = common.load_image(path)

        self.title = ("¡Orden en mi habitación!",)
        self.instructions = ("Observa estas dos habitaciones. Una está ordenada",
                "y la otra desordenada: descubre las 21 diferencias y",
                "márcalas con una X en la habitación desordenada")

        self.icons = pygame.sprite.Group()
        self.icons.add([Icons('stop')])

        self.pointer_ = Xs()
        self.pointer = sprite.RenderUpdates([self.pointer_, self.icons])
        self.xs = sprite.RenderUpdates()

        self.xs.draw(self.screen)
        self.pointer.draw(self.screen)

        self.check = sprite.RenderUpdates()
        
        self.room = Rect(403, 129, 393, 467)
        pygame.display.update()
开发者ID:milmazz,项目名称:pygame-salud,代码行数:53,代码来源:room.py

示例5: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
 def __init__(self, screen):
     Activity.__init__(self, screen)
     self.close_button = pygame.sprite.RenderUpdates(([Icons('stop')]))
     self.finger = Finger()
     self.cursor = pygame.sprite.RenderUpdates((self.finger))
     self.pos = None
     self.line_start = (0, 0)
     self.draw_color = (0, 0, 0)
     self.line_width = 3
     self.line_end = None
     self.text()
     self.transparent = pygame.Rect(297, 96, 400, 408)
     # Color palette
     self.palette = {}
     self.mk_palette(constants.rgb_colors)
     # Thickness
     self.thickness = {}
     self.mk_thickness()
开发者ID:milmazz,项目名称:pygame-salud,代码行数:20,代码来源:painting.py

示例6: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
    def __init__(self, screen):
        Activity.__init__(self, screen)
        self.background = common.load_image(constants.illustration_019)[0]
        words = {
                'saludable': (114, 236),
                'risa': (41, 264),
                'alimentos': (143, 283),
                'agua': (41, 307),
                'descanso': (101, 346),
                'amor': (89, 375),
                'limpieza': (26, 407),
                'deporte': (149, 445),
                'sol': (59, 463),
                'aire': (109, 490),
                'aseo': (55, 514),
                'banarse': (193, 542),
                }

        self.title = ("¡Palabras largas, palabras cortas!",)
        self.instructions = ("Estas palabras están relacionadas con la salud.",
                        "  ",
                        "Arrastra hacia la bolsa roja",
                        "las palabras que tienen",
                        "menos de 5 letras y hacia la",
                        "bolsa azul las que tienen",
                        "más de 5 letras.")
        self.informative_text(self.title, self.instructions)
        self.hand = Hand()
        self.icons = pygame.sprite.Group()
        self.icons.add([Icons('stop')])
        self.words = pygame.sprite.Group()
        self.sprites = pygame.sprite.OrderedUpdates()
        for word, pos in words.items():
            word_ = Word(word, pos)
            self.sprites.add(word_)
            self.words.add(word_)
        self.sprites.add([self.icons, self.hand])
        self.sprites.draw(self.screen)
        self.selected = None
        self.bags = (Bag('cortas', (430, 150, 170, 150), (475, 175, 100, 120)), 
                     Bag('largas', (430, 375, 170, 160), (480, 395, 105, 130)))
                
        return
开发者ID:milmazz,项目名称:pygame-salud,代码行数:45,代码来源:words.py

示例7: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
 def __init__(self, screen):
     Activity.__init__(self, screen)
     self.count = 0
     self.id = ""
     # Change the mouse pointer by a hand
     self.button_down = 0
     self.selection = 0
     self.hand = Hand()
     self.sprites    = pygame.sprite.OrderedUpdates()
     self.pictures   = pygame.sprite.Group() # Picture that can be move
     self.transparent= pygame.sprite.Group() # Picture that cann't be move
     self.icons      = pygame.sprite.Group()
     self.icons.add([Icons('stop')])
     self.transparent.add([ \
       ImagePuzzle(302, 100, 1, "5"), \
       ImagePuzzle(500, 100, 2, "5"), \
       ImagePuzzle(302, 250, 3, "5"), \
       ImagePuzzle(500, 250, 4, "5")]
     )
开发者ID:milmazz,项目名称:pygame-salud,代码行数:21,代码来源:puzzle.py

示例8: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
    def __init__(self, window, app, antfile):
        Gtk.ListBoxRow.__init__(self)
        Activity.__init__(self, app, antfile)

        self.window = window

        grid = Gtk.Grid(margin=6)
        grid.set_column_spacing(10)
        self.add(grid)

        self.image = Gtk.Image(icon_name='preferences-system-time-symbolic',
            icon_size=self.ICON_SIZE)

        self.label = Gtk.Label()
        self.label.set_ellipsize(Pango.EllipsizeMode.END)
        self.label.set_valign(Gtk.Align.CENTER)
        self.label.set_halign(Gtk.Align.START)

        self.spinner = Gtk.Spinner()
        self.spinner.set_valign(Gtk.Align.CENTER)
        self.spinner.set_halign(Gtk.Align.END)
        self.spinner.set_hexpand(True)
        self.spinner.set_no_show_all(True)

        self.selector_button = Gtk.CheckButton()
        self.selector_button.set_valign(Gtk.Align.CENTER)
        self.selector_button.set_halign(Gtk.Align.END)
        self.selector_button.set_hexpand(True)
        self.selector_button.set_no_show_all(True)

        grid.attach(self.image, 0, 0, 1, 1)
        grid.attach(self.label, 1, 0, 1, 1)
        grid.attach(self.spinner, 2, 0, 1, 1)
        # don't show spinner yet
        grid.attach(self.selector_button, 3, 0, 1, 1)
        # don't show selector button yet

        if not self.downloaded:
            self.label.set_sensitive(False)
            self.image.set_from_icon_name('dialog-question-symbolic', self.ICON_SIZE)

        self.connect('status-changed', self.status_changed_cb)
        self.status_changed_cb(self, self.status)
开发者ID:jonnylamb,项目名称:fuga,代码行数:45,代码来源:activities.py

示例9: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
 def __init__(self, screen):
     Activity.__init__(self, screen)
     """change the mouse pointer by a hand"""
     self.button_down = 0
     self.rectList = [ 
             pygame.Rect(311, 91, 158, 51),
             pygame.Rect(546, 414, 67, 121),
             pygame.Rect(157, 358, 72, 109),
             ]
     self.sprites = pygame.sprite.OrderedUpdates()
     self.icons = pygame.sprite.Group()
     self.icons.add([Icons('stop')])
     image_check = image_normal = os.path.join(constants.icons_folder,\
             "check.png")
     self.checkImage, self.checkRect = common.load_image\
       (image_check)
     self.hand = Hand()
     self.tex_info = {
         'title': ["Una boca bien sana", None],
         'instructions' : [["Selecciona aquellos objetos", \
                         "que son necesarios para mantener tu boca sana"], None]
     }
开发者ID:milmazz,项目名称:pygame-salud,代码行数:24,代码来源:select.py

示例10: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
 def __init__(self, screen):
     Activity.__init__(self, screen)
     self.correct = set()
     self.rectangleListEnter = [
             pygame.Rect(345, 90, 10, 15),
             pygame.Rect(340, 480, 10, 15),
             pygame.Rect(300, 390, 10, 15),
             pygame.Rect(493, 325, 10, 15),
             pygame.Rect(362, 299, 10, 15)
             ]
     self.pointList = [
             (350, 123),
             (400, 460),
             (277, 279),
             (451, 365)
             ]
     self.checkList = [
             (390, 80),
             (360, 520),
             (260, 340),
             (494, 358),
             (407, 304),
             ]
     self.ball = Ball(self.screen, (200,80))
     self.text_info = {
         'title': {
             'text': u"El laberinto de la salud",
             'offset': None
             },
         'instructions': {
             'text': [u"   Ayuda a Nina a realizar",
                     u"las tareas diarias a través",
                     u"del laberinto. Utiliza las",
                     u"teclas de desplazamiento."],
             'offset': 490
             }
     }
开发者ID:milmazz,项目名称:pygame-salud,代码行数:39,代码来源:labyrinth.py

示例11: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
 def __init__(self, screen):
     Activity.__init__(self, screen)
     self.background = common.load_image(constants.illustration_024)[0]
     self.instruction_text()
开发者ID:milmazz,项目名称:pygame-salud,代码行数:6,代码来源:cooking.py

示例12: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
 def __init__(self):
     Activity.__init__(self, None)
开发者ID:LegendOfOld,项目名称:PenguPilot,代码行数:4,代码来源:dummy.py

示例13: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
 def __init__(self, screen):
     Activity.__init__(self, screen)
     self.informative_text()
开发者ID:milmazz,项目名称:pygame-salud,代码行数:5,代码来源:soups.py

示例14: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
 def __init__(self, icarus):
    Activity.__init__(self, icarus)
    self.canceled = False
开发者ID:aaxixi,项目名称:PenguPilot,代码行数:5,代码来源:move.py

示例15: __init__

# 需要导入模块: from activity import Activity [as 别名]
# 或者: from activity.Activity import __init__ [as 别名]
 def __init__(self, screen):
     Activity.__init__(self, screen)
     self.selection = None
     self.count = 0
开发者ID:milmazz,项目名称:pygame-salud,代码行数:6,代码来源:crazyletter.py


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