Пример #1
0
    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
Пример #2
0
 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
Пример #3
0
    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
Пример #4
0
 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.change = pygame.sprite.Group([Navigation()]) #load next and prev buttons
     self.pos = None
     self.sprites = pygame.sprite.OrderedUpdates()
     self.sprites.add([self.CloseButton, self.change, self.cursor])
     self.text()
Пример #5
0
    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()
Пример #6
0
 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()
Пример #7
0
    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)
Пример #8
0
    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)
Пример #9
0
 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")]
     )
Пример #10
0
    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
Пример #11
0
 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]
     }
Пример #12
0
 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
             }
     }
Пример #13
0
 def __init__(self, screen):
     Activity.__init__(self, screen)
     self.background = common.load_image(constants.illustration_024)[0]
     self.instruction_text()
Пример #14
0
 def __init__(self, screen):
     Activity.__init__(self, screen)
     self.correct = set()
Пример #15
0
 def __init__(self, fsm, pilot, mon_data):
     Activity.__init__(self)
     self.fsm = fsm
     self.pilot = pilot
     self.mon_data = mon_data
     self.canceled = False
Пример #16
0
 def __init__(self):
     Activity.__init__(self, None)
Пример #17
0
 def __init__(self, fsm, core, mon_data):
    Activity.__init__(self)
    self.fsm = fsm
    self.core = core
    self.mon_data = mon_data
    self.canceled = False
Пример #18
0
 def __init__(self, screen):
     Activity.__init__(self, screen)
     self.informative_text()
Пример #19
0
 def __init__(self, icarus):
     Activity.__init__(self, icarus)
     self.canceled = False
Пример #20
0
 def __init__(self, icarus):
    Activity.__init__(self, icarus)
    self.canceled = False
Пример #21
0
 def __init__(self, screen):
     Activity.__init__(self, screen)
     self.selection = None
     self.count = 0
Пример #22
0
 def __init__(self, icarus):
     Activity.__init__(self, icarus)
Пример #23
0
 def __init__(self, screen):
     Activity.__init__(self, screen)
Пример #24
0
 def __init__(self, screen):
     Activity.__init__(self, screen)
     self.back1 = common.load_image(constants.illustration_005)[0]
     self.back2 = common.load_image(constants.illustration_006)[0]
     self.background = self.back1
Пример #25
0
 def __init__(self, icarus):
    Activity.__init__(self, icarus)
Пример #26
0
 def __init__(self, fsm, pilot, mon_data):
    Activity.__init__(self)
    self.fsm = fsm
    self.pilot = pilot
    self.mon_data = mon_data
    self.canceled = False
Пример #27
0
 def __init__(self):
     Activity.__init__(self, None)