Esempio n. 1
0
 def load(self):
     font = CIGlobals.getToonFont()
     box = DGG.getDefaultDialogGeom()
     self.finalScoreContainer = DirectFrame()
     self.finalScoreBg = OnscreenImage(image=box,
                                       color=(1, 1, 0.75, 1),
                                       scale=(1.9, 1.4, 1.4),
                                       parent=self.finalScoreContainer)
     self.finalScoreTitle = OnscreenText(text="Waiting for final scores...",
                                         pos=(0, 0.5, 0),
                                         font=font,
                                         scale=(0.12),
                                         parent=self.finalScoreContainer)
     self.finalScoreNameLbl = OnscreenText(text="",
                                           scale=0.095,
                                           pos=(-0.85, 0.3, 0),
                                           font=font,
                                           align=TextNode.ALeft,
                                           parent=self.finalScoreContainer)
     self.finalScorePointLbl = OnscreenText(text="",
                                            scale=0.095,
                                            pos=(0.85, 0.3, 0),
                                            font=font,
                                            align=TextNode.ARight,
                                            parent=self.finalScoreContainer)
     self.finalScoreContainer.hide()
     self.finalScoreContainer.setBin('gui-popup', 60)
     del font
     del box
Esempio n. 2
0
 def enterPlay(self):
     DistributedMinigame.enterPlay(self)
     base.localAvatar.attachCamera()
     base.localAvatar.startSmartCamera()
     base.localAvatar.enableAvatarControls()
     base.localAvatar.startTrackAnimToSpeed()
     base.localAvatar.setWalkSpeedNormalNoJump()
     self.brLabel = OnscreenText(text="",
                                 parent=base.a2dTopRight,
                                 fg=(1, 1, 1, 1),
                                 shadow=(0, 0, 0, 1),
                                 pos=(-0.1, -0.1, 0),
                                 align=TextNode.ARight)
     self.bdLabel = OnscreenText(text="",
                                 parent=base.a2dTopLeft,
                                 fg=(1, 1, 1, 1),
                                 shadow=(0, 0, 0, 1),
                                 pos=(0.1, -0.1, 0),
                                 align=TextNode.ALeft)
     self.bsLabel = OnscreenText(text="",
                                 parent=base.a2dTopLeft,
                                 fg=(1, 1, 1, 1),
                                 shadow=(0, 0, 0, 1),
                                 pos=(0.1, -0.2, 0),
                                 align=TextNode.ALeft)
     self.accept('enterMGDeliveryGagShop', self.__maybeDropOffBarrel)
     self.accept('alt', self.__maybeThrowGag)
Esempio n. 3
0
 def __init__(self):
     NodePath.__init__(self, 'wave-gui')
     self.reparentTo(base.a2dBottomCenter)
     self.setBin('fixed', 60)
     self.setTransparency(True, 1)
     self.setAlphaScale(0.75, 1)
     self.setZ(0.1)
     self.frame = DirectFrame(image='materials/ui/wave_ui_base.png',
                              parent=self,
                              relief=None,
                              image_scale=(.373, 1, .094))
     self.waveText = OnscreenText(text="Wave 4",
                                  pos=(0, 0.0175, 0),
                                  scale=0.06,
                                  parent=self.frame)
     self.progress = DirectWaitBar(scale=(.324, 1, .3),
                                   relief=None,
                                   barColor=(1, 0.75, 0, 1),
                                   parent=self.frame,
                                   pos=(0, 0, -0.0293))
     self.progress.setBin('fixed', 61)
     self.progress['range'] = 50
     self.progress['value'] = 35
     self.progressText = OnscreenText(text=str(self.progress['value']) +
                                      " / " + str(self.progress['range']),
                                      scale=0.04,
                                      parent=self.frame,
                                      pos=(0, -0.04, 0))
     self.progressText.setBin('fixed', 62)
     self.hide()
 def __init__(self, index):
     DirectFrame.__init__(self, scale=0.5)
     stickergui = loader.loadModel(
         'phase_3.5/models/gui/stickerbook_gui.bam')
     self['image'] = stickergui.find('**/paper_note')
     self.setPos(self.spots[index])
     self.headingText = OnscreenText(parent=self,
                                     text='',
                                     font=CIGlobals.getToonFont(),
                                     pos=self.HeadingTextPos,
                                     scale=self.HeadingTextScale)
     self.taskInfoText = OnscreenText(parent=self,
                                      text='',
                                      font=CIGlobals.getToonFont(),
                                      pos=self.TaskInfoTextPos,
                                      scale=self.NonHeadingTextScale)
     self.progressText = OnscreenText(parent=self,
                                      text='',
                                      font=CIGlobals.getToonFont(),
                                      pos=self.ProgressTextPos,
                                      scale=self.ProgressTextScale)
     self.rewardText = OnscreenText(parent=self,
                                    text='',
                                    font=CIGlobals.getToonFont(),
                                    pos=self.RewardTextPos,
                                    scale=self.RewardTextScale)
     self.hide()
Esempio n. 5
0
    def generateMenu(self):

        for i in self.info_texts:
            item = OnscreenText(
                text=i,
                style=1,
                fg=(1, 1, 1, 1),
                font=self.font,
                pos=(0, ((len(self.info_texts) + len(self.item_texts) -
                          self.info_texts.index(i)) * 0.1) + self.offset),
                align=TextNode.ACenter,
                drawOrder=1,
                parent=render2d,
                scale=0.1 * self.scale_factor)
            item.hide()
            self.info_table.append(item)

        for j in self.item_texts:
            item = OnscreenText(
                text=j,
                style=1,
                fg=(1, 1, 1, 1),
                font=self.font,
                pos=(0, (
                    (len(self.item_texts) - self.item_texts.index(j)) * 0.1) +
                     self.offset),
                align=TextNode.ACenter,
                drawOrder=1,
                parent=render2d,
                scale=0.06 * self.scale_factor)
            item.hide()
            self.menu_items.append(item)
        self.selectionDown()
 def __init__(self):
     DirectFrame.__init__(self,
                          parent=base.a2dTopLeft,
                          relief=None,
                          pos=(0.275, 1, -0.7),
                          sortOrder=0)
     self.pointsSfx = loader.loadSfx('phase_4/audio/sfx/MG_maze_pickup.ogg')
     self.points = 0
     gui = loader.loadModel('phase_4/models/gui/purchase_gui.bam')
     panel = gui.find('**/yellowPanel')
     self.bg = OnscreenImage(image=panel, parent=self)
     self.title = OnscreenText(text='Capture Points',
                               font=CIGlobals.getMinnieFont(),
                               parent=self,
                               scale=0.0475,
                               pos=(0, 0.18),
                               fg=(1, 0, 0, 1),
                               shadow=(0.2, 0.2, 0.2, 1))
     self.amt_label = OnscreenText(text=str(self.points),
                                   font=CIGlobals.getToonFont(),
                                   parent=self,
                                   scale=0.15,
                                   pos=(0, 0.03525),
                                   shadow=(0.5, 0.5, 0.5, 0.6))
     self.info = OnscreenText(
         text=
         'First Toon to 100 points wins!\nEarn points by standing on the\nhill after capturing it.',
         parent=self,
         font=CIGlobals.getToonFont(),
         scale=0.035,
         pos=(0, -0.05),
         fg=(1.5, 0, 0, 1),
         shadow=(0.2, 0.2, 0.2, 1))
     self.hide()
     return
 def makeMoreDetailsPanel(self):
     self.actionFSM.request('off')
     self.removeMoreDetailsPanel()
     self.removeActionPanel()
     self.makeActionPanel()
     zoneId = self.avatarInfo[5]
     shardId = self.avatarInfo[6]
     isOnline = self.avatarInfo[7]
     shardName = 'Unknown District'
     hoodName = ZoneUtil.getHoodId(zoneId, 1)
     for district in base.cr.activeDistricts.values():
         if district.doId == shardId:
             shardName = district.getDistrictName()
             break
     if not isOnline:
         hoodName = 'Offline'
         shardName = 'Offline'
     self.locationText = OnscreenText('Location: {0}'.format(hoodName),
                                      parent=self.actionFrame,
                                      pos=(-0.3, 0.05, 0),
                                      align=TextNode.ALeft,
                                      scale=0.04)
     self.shardText = OnscreenText('District: {0}'.format(shardName),
                                   parent=self.actionFrame,
                                   pos=(-0.3, 0.0, 0),
                                   align=TextNode.ALeft,
                                   scale=0.04)
     self.detailsExitBtn = DirectButton(geom=CIGlobals.getCancelBtnGeom(),
                                        parent=self.actionFrame,
                                        relief=None,
                                        scale=0.8,
                                        pos=(-0.3, 0.0, -0.175),
                                        command=self.removeMoreDetailsPanel)
    def __init__(self, page, widgetname, slrange, slcommand, pos = (0, 0, 0)):
        DirectFrame.__init__(self, parent = page.book, pos = pos)

        self.page = page

        self.text = OnscreenText(text = widgetname + ":", pos = (-0.7, 0, 0), align = TextNode.ALeft, parent = self)
        self.slider = DirectSlider(range=slrange, pageSize=0.1, command=slcommand, scale=0.3,
                                        orientation=DGG.HORIZONTAL, pos=(0.35, 0, 0.025), parent = self)
        self.valText = OnscreenText(text = "", pos = (0.7, -0.005, -0.005), align = TextNode.ALeft, parent = self)
Esempio n. 9
0
 def enterCountdown(self):
     render.show()
     if self.gameMode == GGG.GameModes.CTF:
         self.blueFrame = DirectFrame(pos=(-0.1, 0, -0.85))
         self.blueScoreLbl = OnscreenText(
             text="Blue: 0",
             scale=0.1,
             parent=self.blueFrame,
             fg=GGG.TeamColorById[GGG.Teams.BLUE],
             shadow=(0, 0, 0, 1),
             align=TextNode.ARight)
         self.blueArrow = loader.loadModel('phase_3/models/props/arrow.bam')
         self.blueArrow.setColor(GGG.TeamColorById[GGG.Teams.BLUE])
         self.blueArrow.reparentTo(self.blueFrame)
         self.blueArrow.setPos(-0.1, 0, 0.15)
         self.blueArrow.setScale(0.1)
         self.redFrame = DirectFrame(pos=(0.1, 0, -0.85))
         self.redScoreLbl = OnscreenText(
             text="Red: 0",
             scale=0.1,
             parent=self.redFrame,
             fg=GGG.TeamColorById[GGG.Teams.RED],
             shadow=(0, 0, 0, 1),
             align=TextNode.ALeft)
         self.redArrow = loader.loadModel('phase_3/models/props/arrow.bam')
         self.redArrow.setColor(GGG.TeamColorById[GGG.Teams.RED])
         self.redArrow.reparentTo(self.redFrame)
         self.redArrow.setPos(0.1, 0, 0.15)
         self.redArrow.setScale(0.1)
         self.infoLbl = OnscreenText(text="Playing to: 3",
                                     scale=0.1,
                                     pos=(0, -0.95),
                                     fg=(1, 1, 1, 1),
                                     shadow=(0, 0, 0, 1))
         base.taskMgr.add(self.__updateArrows,
                          self.uniqueName('updateArrows'))
     camera.setPos(0, 0, 0)
     camera.setHpr(0, 0, 0)
     self.toonFps.fsm.request('alive')
     text = OnscreenText(text="",
                         scale=0.1,
                         pos=(0, 0.5),
                         fg=(1, 1, 1, 1),
                         shadow=(0, 0, 0, 1))
     self.track = Sequence(Func(text.setText, "5"), Wait(1.0),
                           Func(text.setText, "4"), Wait(1.0),
                           Func(text.setText, "3"), Wait(1.0),
                           Func(text.setText, "2"), Wait(1.0),
                           Func(text.setText, "1"), Wait(1.0),
                           Func(text.setText, "FIGHT!"),
                           Func(self.fsm.request, 'play'), Wait(1.0),
                           Func(text.destroy))
     self.track.start()
     self.sendUpdate('gunChoice',
                     [self.toonFps.weaponName, base.localAvatar.doId])
    def __init__(self, book, parentFSM):
        self.book = book
        self.parentFSM = parentFSM
        StateData.__init__(self, 'namePageDone')
        self.fsm = ClassicFSM('NamePage', [
            State('off', self.enterOff, self.exitOff),
            State('basePage', self.enterBasePage, self.exitBasePage)
        ], 'off', 'off')
        self.fsm.enterInitialState()
        self.parentFSM.getStateNamed('namePage').addChild(self.fsm)
        self.nameServ = base.cr.nameServicesManager
        self.baseRequestIndex = 0
        self.requestsPerCluster = 5

        # GUI elements
        self.requestsContainer = {}
        self.loadingLabel = None
        self.selectedName = None
        self.nameButtons = []
        self.avId2NameData = {}

        geom = CIGlobals.getDefaultBtnGeom()
        self.acceptBtn = DirectButton(
            geom=geom,
            text_scale=0.04,
            relief=None,
            scale=0.5,
            text="Accept",
            pos=(0.5, posY, 0),
            text_pos=(0, -0.01),
            command=self.acceptName,
        )
        self.acceptBtn.hide()
        self.declineBtn = DirectButton(
            geom=geom,
            text_scale=0.04,
            relief=None,
            scale=0.5,
            text="Decline",
            pos=(0.75, posY, 0),
            text_pos=(0, -0.01),
            command=self.declineName,
        )
        self.declineBtn.hide()
        self.avIdLbl = OnscreenText(text="",
                                    scale=0.08,
                                    pos=(0.3, 0, 0.5),
                                    align=TextNode.ACenter)
        self.avIdLbl.hide()
        self.accIdLbl = OnscreenText(text="",
                                     scale=0.08,
                                     pos=(0.3, 0, 0.3),
                                     align=TextNode.ACenter)
        self.accIdLbl.hide()
    def __init__(self, page):
        OptionsCategory.__init__(self, page)
        DirectObject.__init__(self)

        self.logoNode, self.logoImg = CIGlobals.getLogoImage(
            self.page.book, 0.75, (0, 0, 0.48))

        self.creditsScreen = None

        self.exitConfirmDlg = None

        font = CIGlobals.getToonLogoFont()

        self.gVersionText = OnscreenText(metadata.getBuildInformation(),
                                         parent=self.page.book,
                                         pos=(0, 0.15, 0.15),
                                         font=font,
                                         fg=(1, 1, 1, 1))
        self.gBuildDate = OnscreenText(text=metadata.BUILD_DATE,
                                       parent=self.page.book,
                                       pos=(0, 0.085, 0.085),
                                       scale=0.06,
                                       font=font,
                                       fg=(1, 1, 1, 1))

        self.eVersionText = OnscreenText(text="Engine Version {0}".format(
            PandaSystem.getVersionString()),
                                         parent=self.page.book,
                                         pos=(0, -0.05),
                                         font=font,
                                         fg=(1, 1, 1, 1))
        self.eBuildDate = OnscreenText(text=PandaSystem.getBuildDate(),
                                       parent=self.page.book,
                                       pos=(0, -0.115),
                                       scale=0.06,
                                       font=font,
                                       fg=(1, 1, 1, 1))

        self.exitToontown = CIGlobals.makeDefaultBtn(
            "Exit Toontown",
            pos=(-0.62, -0.62, -0.62),
            parent=self.page.book,
            scale=1.2,
            command=self.showConfirmDlg,
            geom_scale=(0.8, 0.8, 0.8))

        self.credits = CIGlobals.makeDefaultBtn("Credits",
                                                pos=(0.0, 0.5, -0.62),
                                                parent=self.page.book,
                                                scale=1.2,
                                                command=self.rollCredits,
                                                geom_scale=(0.8, 0.8, 0.8))
 def makeSelectionGUI(self):
     font = CIGlobals.getMickeyFont()
     box = loader.loadModel('phase_3/models/gui/dialog_box_gui.bam')
     imp = CIGlobals.getToonFont()
     geom = CIGlobals.getDefaultBtnGeom()
     self.container = DirectFrame()
     self.bg = OnscreenImage(image=box,
                             color=(1, 1, 0.75, 1),
                             scale=(1.9, 1.4, 1.4),
                             parent=self.container)
     self.title = OnscreenText(text='Join  a  Team',
                               pos=(0, 0.5, 0),
                               font=font,
                               scale=0.12,
                               parent=self.container,
                               fg=(1, 0.9, 0.3, 1))
     self.btnFrame = DirectFrame(parent=self.container, pos=(0.14, 0, 0))
     self.team1BtnFrame = DirectFrame(parent=self.btnFrame,
                                      pos=(-0.5, 0, 0))
     self.team2BtnFrame = DirectFrame(parent=self.btnFrame,
                                      pos=(0.22, 0, 0))
     self.team1Btn = DirectButton(parent=self.team1BtnFrame,
                                  relief=None,
                                  pressEffect=0,
                                  image=self.team1BtnImg,
                                  image_scale=(0.9, 1, 1),
                                  scale=0.4,
                                  command=self.choseTeam,
                                  extraArgs=[TEAM1])
     self.team1Plyrs_Lbl = OnscreenText(parent=self.team1BtnFrame,
                                        text=str(self.playersByTeam[TEAM1]),
                                        pos=(0, -0.46, 0),
                                        font=imp)
     self.team2Btn = DirectButton(parent=self.team2BtnFrame,
                                  relief=None,
                                  pressEffect=0,
                                  image=self.team2BtnImg,
                                  image_scale=(0.9, 1, 1),
                                  scale=0.4,
                                  command=self.choseTeam,
                                  extraArgs=[TEAM2])
     self.team2Plyrs_Lbl = OnscreenText(parent=self.team2BtnFrame,
                                        text=str(self.playersByTeam[TEAM2]),
                                        pos=(0, -0.46, 0),
                                        font=imp)
     self.teamFull_Lbl = OnscreenText(parent=self.container,
                                      text='',
                                      pos=(0, -0.6, 0),
                                      font=imp)
     return
    def __init__(self):
        DirectObject.__init__(self)

        base.setBackgroundColor(0, 0, 0)

        self.textParent = base.credits2d.attachNewNode('textParent')
        self.textParent.setBin("gui-popup", 61)
        self.textParent.setDepthWrite(False)
        self.textParent.setTransparency(True)

        self.logoImage = OnscreenImage('phase_3/maps/CogInvasion_Logo.png',
                                       parent=self.textParent,
                                       scale=(0.685, 1.0, 0.325))
        self.logoImage.setTransparency(1)

        text = self.buildCreditsText()
        self.creditsText = OnscreenText(parent=self.textParent,
                                        font=CIGlobals.getToonFont(),
                                        fg=(1, 1, 1, 1),
                                        scale=0.065,
                                        pos=(0, -0.5, 0),
                                        text=text,
                                        shadow=(0, 0, 0, 1))

        self.posInterval = None

        self.backgroundImg = OnscreenImage('phase_3/maps/credits_fade.png',
                                           parent=render2d)
        self.backgroundImg.setTransparency(True)
        self.backgroundImg.setColor(0, 0, 0, 1.0)
        self.backgroundImg.setBin("gui-popup", 62)
        self.backgroundImg.setDepthWrite(False)

        self.exitText = OnscreenText(parent=base.credits2d,
                                     font=CIGlobals.getToonFont(),
                                     fg=(1.0, 0, 0, 1.0),
                                     shadow=(0, 0, 0, 1),
                                     scale=0.085,
                                     pos=(0, -0.96, 0),
                                     text='Press any key to exit')
        self.exitText.hide()
        self.exitText.setBin("gui-popup", 63)
        self.exitText.setDepthWrite(False)
        self.exitText.setTransparency(True)

        self.creditsAudioMgr = AudioManager.createAudioManager()
        self.creditsAudioMgr.setVolume(0.65)
        self.bgm = self.creditsAudioMgr.getSound(
            'phase_4/audio/bgm/new_years_fireworks_music.ogg')
def addTitle(text):
    return OnscreenText(text=text,
                        style=1,
                        fg=(1, 1, 1, 1),
                        pos=(1.3, -0.95),
                        align=TextNode.ARight,
                        scale=.07)
Esempio n. 15
0
    def __init__(self, gsg, trackId = None, name = None, color = None, trackBarScale = None):
        DirectFrame.__init__(self)
        self.gsg = gsg
        self.trackId = trackId
        if trackId is not None:
            self.trackName = GagGlobals.TrackNameById[trackId]
            color = GagGlobals.TrackColorByName[self.trackName]
        else:
            if name:
                self.trackName = name
            if not color:
                color = (1, 1, 1, 1)
                
        self.trackColor = color
            
        self['image'] = 'phase_14/maps/track_bar.png'
        self['image_scale'] = (1.119, 0, 0.152)
        if trackBarScale:
            self['image_scale'][0] *= trackBarScale[0]
            self['image_scale'][2] *= trackBarScale[1]
        self['relief'] = None
        
        self['image_color'] = (color[0], color[1], color[2], 1)

        self.trackText = OnscreenText(text = self.trackName.upper(), fg = (0, 0, 0, 0.65), shadow = (0, 0, 0, 0),
                                      pos = (-0.825, -0.022), scale = 0.12 * (3.0/4.0), align = TextNode.ACenter, parent = self)
        self.gagBtns = []

        self.currentGag = 0
Esempio n. 16
0
    def start(self, avatar):
        self.avatar = avatar
        self.cleanupLocationSeeker()
        self.buildButton()
        self.button.reparentTo(self.avatar.find('**/def_joint_left_hold'))

        track = Sequence(
            ActorInterval(self.avatar,
                          self.buttonAnim,
                          startFrame=0,
                          endFrame=self.chooseLocFrame,
                          playRate=self.playRate))

        if self.avatar == base.localAvatar:
            self.locationSeeker = LocationSeeker(self.avatar, self.minDistance,
                                                 self.maxDistance)
            self.locationSeeker.setShadowType(self.isCircle, self.shadowScale)
            self.avatar.acceptOnce(
                self.locationSeeker.getLocationSelectedName(),
                base.localAvatar.releaseGag)
            track.append(Func(self.locationSeeker.startSeeking))

            self.helpInfo = OnscreenText(
                text='Move the shadow with your mouse\nClick to release',
                pos=(0, -0.75),
                font=CIGlobals.getToonFont(),
                fg=(1, 1, 1, 1),
                shadow=(0, 0, 0, 1))

        track.start()
 def enterSysMsgSection(self):
     geom = CIGlobals.getDefaultBtnGeom()
     self.infoLbl = OnscreenText(
         text="Inform all online players about something.", pos=(0, 0.45))
     self.msgEntry = DirectEntry(
         initialText="System Message...",
         scale=0.055,
         width=15,
         numLines=4,
         command=self.sendSystemMessageCommand,
         focusInCommand=base.localAvatar.chatInput.disableKeyboardShortcuts,
         focusOutCommand=base.localAvatar.chatInput.enableKeyboardShortcuts,
         pos=(-0.4, 0, 0))
     self.sendBtn = DirectButton(
         geom=geom,
         text_scale=0.04,
         relief=None,
         scale=1.0,
         text="Send",
         pos=(0, 0, -0.35),
         text_pos=(0, -0.01),
         command=self.sendSystemMessageCommand,
     )
     self.cancelBtn = DirectButton(geom=geom,
                                   text_scale=0.04,
                                   relief=None,
                                   scale=1.0,
                                   text="Cancel",
                                   pos=(-0.45, 0.15, -0.55),
                                   text_pos=(0, -0.01),
                                   command=self.fsm.request,
                                   extraArgs=['basePage'])
Esempio n. 18
0
    def lose(self, wait=5.0, duration=2.0):
        if self.lost:
            return

        def adjustMusicVol(vol):
            self.musicManager.setVolume(vol)

        def adjustSfxVol(vol):
            self.sfxManagerList[0].setVolume(vol)

        from direct.gui.DirectGui import OnscreenText, DGG
        from direct.interval.IntervalGlobal import Parallel, Sequence, Wait, LerpFunc, Func
        fadeIval = base.transitions.getFadeOutIval(duration)
        diedText = OnscreenText(text="You failed to save Flippy!\nYou lose!",
                                fg=(1, 1, 1, 1))
        diedText.reparentTo(aspect2d, DGG.FADE_SORT_INDEX + 1)
        diedText.setAlphaScale(0)
        textFadeIval = diedText.colorScaleInterval(duration, (1, 1, 1, 1),
                                                   (1, 1, 1, 0))
        Sequence(
            Wait(wait),
            Parallel(
                fadeIval, textFadeIval,
                LerpFunc(adjustMusicVol, duration,
                         self.musicManager.getVolume(), 0.0),
                LerpFunc(adjustSfxVol, duration,
                         self.sfxManagerList[0].getVolume(), 0.0)),
            Func(self.leaveGame)).start()

        self.lost = True
Esempio n. 19
0
    def createMenu(self):
        """
		self.menuBg = loader.loadModel("phase_3/models/gui/loading-background.bam")
		self.menuBg.find('**/fg').removeNode()
		
		#self.trolleyTex = loader.loadTexture("phase_3.5/maps/trolley.jpg", "phase_3.5/maps/trolley_a.rgb")
		#self.trolley = OnscreenImage(image=self.trolleyTex, scale=(0.5, 0, 0.6))
		#self.trolley.setTransparency(True)
		
		#self.logo = loader.loadTexture("phase_3/maps/toontown_online_logo.tif")
		#self.logoImg = OnscreenImage(image=self.logo, scale=(0.6, 0, 0.225), pos=(0, 0, 0.5))
		#self.logoImg.setTransparency(True)
		
		self.logo = loader.loadTexture("phase_3/maps/CogInvasion_Logo.png")
		self.logoImg = OnscreenImage(image = self.logo, scale = (1.0, 0, 0.6))
		self.logoImg.setTransparency(True)
		self.logoImg.reparentTo(hidden)
		
		self.bg_img = OnscreenImage(image=self.menuBg, parent=render2d)
		"""
        base.graphicsEngine.renderFrame()
        base.graphicsEngine.renderFrame()
        self.version_lbl = OnscreenText(text="ver-" + game.version,
                                        scale=0.06,
                                        pos=(-1.32, -0.97, -0.97),
                                        align=TextNode.ALeft,
                                        fg=(0.9, 0.9, 0.9, 7))
Esempio n. 20
0
    def startTraverseAnimationControls(self, animName):
        if not self.__traverseGUI:
            if not self.getNumFrames(animName) is None:
                frame = self.getCurrentFrame(animName)

                if frame is None:
                    frame = 0
                    self.pose(animName, 0)

                self.accept('h',
                            self.__traverseAnimation,
                            extraArgs=[animName, -1])
                self.accept('j',
                            self.__traverseAnimation,
                            extraArgs=[animName, 1])

                self.__traverseGUI = OnscreenText(
                    text=
                    'Current Frame: {0}\n\'H\' Decrease Frame, \'J\' Increase Frame'
                    .format(str(frame)),
                    pos=(0, -0.75),
                    font=CIGlobals.getToonFont(),
                    fg=(1, 1, 1, 1),
                    shadow=(0, 0, 0, 1))
            else:
                self.notify.info(
                    'Tried to traverse unknown animation: {0}'.format(
                        animName))
Esempio n. 21
0
 def text2d(self,
            pos,
            text,
            scale=.07,
            align=TextNode.ALeft,
            color=C_BLACK):
     t = OnscreenText(text, pos=pos, align=align, fg=color, scale=scale)
 def __init__(self, cr):
     try:
         self.DistributedCogBattle_initialized
         return
     except:
         self.DistributedCogBattle_initialized = 1
     DistributedObject.__init__(self, cr)
     self.hoodIndex = None
     self.totalCogs = None
     self.cogsRemaining = None
     self.cogProgressBar = None
     self.DNCSigns = []
     self.introMessageSeq = None
     self.victorySeq = None
     self.turretManager = None
     self.isGettingBeans = False
     self.getBeansLabel = OnscreenText(
         text="Hurry and pick up all of the jellybeans!",
         fg=(1, 1, 1, 1),
         shadow=(0, 0, 0, 1),
         pos=(0, 0.7),
         font=CIGlobals.getMinnieFont())
     self.getBeansLabel.hide()
     self.timer = Timer()
     self.timer.setZeroCommand(self.getBeansTimeUp)
     # Give toons 30 seconds to get the beans at the end.
     self.timer.setInitialTime(60)
     self.endMusic = base.loadMusic(
         'phase_7/audio/bgm/encntr_toon_winning_indoor.mid')
     self.balloonSound = base.loadSfx(
         'phase_3/audio/sfx/GUI_balloon_popup.ogg')
 def enterKickSection(self):
     geom = CIGlobals.getDefaultBtnGeom()
     self.infoLbl = OnscreenText(text="Kick or Ban?", pos=(0, 0.45))
     self.kickBtn = DirectButton(geom=geom,
                                 text_scale=0.04,
                                 relief=None,
                                 scale=1.0,
                                 text="Kick",
                                 pos=(0, 0, 0.1),
                                 text_pos=(0, -0.01),
                                 command=self.book.finishedResume,
                                 extraArgs=[KickBanDialog, [0]])
     self.banBtn = DirectButton(geom=geom,
                                text_scale=0.04,
                                relief=None,
                                scale=1.0,
                                text="Ban",
                                pos=(0, 0, 0.0),
                                text_pos=(0, -0.01),
                                command=self.book.finishedResume,
                                extraArgs=[KickBanDialog, [1]])
     self.cancelBtn = DirectButton(geom=geom,
                                   text_scale=0.04,
                                   relief=None,
                                   scale=1.0,
                                   text="Cancel",
                                   pos=(-0.45, 0.15, -0.45),
                                   text_pos=(0, -0.01),
                                   command=self.fsm.request,
                                   extraArgs=['basePage'])
Esempio n. 24
0
 def load(self):
     StateData.load(self)
     self.loadingLabel = OnscreenText(text='Loading...',
                                      font=CIGlobals.getToonFont(),
                                      pos=(0, 0.1, 0),
                                      scale=0.08,
                                      parent=aspect2d)
 def enterFrozen(self):
     self.loadIceCube()
     base.playSfx(self.iceFormSfx)
     base.cr.playGame.getPlace().fsm.request('stop', [0])
     base.localAvatar.stop()
     base.playSfx(choice(self.frozenSfxArray))
     self.iccsIval = LerpColorScaleInterval(
         self.iceCube,
         duration=0.5,
         colorScale=VBase4(0.76, 0.76, 1.0, 1.0),
         startColorScale=self.iceCube.getColorScale(),
         blendType='easeInOut')
     self.iccsIval.start()
     props = WindowProperties()
     props.setCursorHidden(True)
     base.win.requestProperties(props)
     self.frame = DirectFrame(pos=(0, 0, 0.7))
     self.powerBar = DirectWaitBar(frameColor=(1, 1, 1, 1),
                                   range=100,
                                   value=0,
                                   scale=(0.4, 0.5, 0.25),
                                   parent=self.frame,
                                   barColor=(0.55, 0.7, 1.0, 1.0))
     self.label = OnscreenText(text="SHAKE MOUSE",
                               shadow=(0, 0, 0, 1),
                               fg=(0.55, 0.7, 1.0, 1.0),
                               pos=(0, -0.1, 0),
                               parent=self.frame)
     taskMgr.add(self.__watchMouseMovement, 'BRWater-watchMouseMovement')
     taskMgr.add(self.__lowerPowerBar, 'BRWater-lowerPowerBar')
     mw = base.mouseWatcherNode
     if mw.hasMouse():
         self.lastMouseX = mw.getMouseX()
    def __init__(self):
        # Let's load up the DirectFrame
        DirectFrame.__init__(self,
                             parent=base.a2dTopLeft,
                             relief=None,
                             pos=(0.275, 1, -0.7),
                             sortOrder=0)

        # The variables we're going to be using.
        self.pointsSfx = loader.loadSfx('phase_4/audio/sfx/MG_maze_pickup.ogg')
        self.points = 0

        # Background because it won't work for whatever reason.
        gui = loader.loadModel('phase_4/models/gui/purchase_gui.bam')
        panel = gui.find('**/yellowPanel')
        self.bg = OnscreenImage(image=panel, parent=self)

        # Let's setup the header text.
        self.title = OnscreenText(text='Capture Points',
                                  font=CIGlobals.getMinnieFont(),
                                  parent=self,
                                  scale=0.0475,
                                  pos=(0, 0.18),
                                  fg=(1, 0, 0, 1),
                                  shadow=(0.2, 0.2, 0.2, 1))

        # Let's setup the amount text.
        self.amt_label = OnscreenText(text=str(self.points),
                                      font=CIGlobals.getToonFont(),
                                      parent=self,
                                      scale=0.15,
                                      pos=(0, 0.03525),
                                      shadow=(0.5, 0.5, 0.5, 0.6))

        # Let's setup the info text.
        self.info = OnscreenText(
            text=
            'First Toon to 100 points wins!\nEarn points by standing on the\nhill after capturing it.',
            parent=self,
            font=CIGlobals.getToonFont(),
            scale=0.035,
            pos=(0, -0.05),
            fg=(1.5, 0, 0, 1),
            shadow=(0.2, 0.2, 0.2, 1))

        # We're not ready to show the GUI yet.
        self.hide()
Esempio n. 27
0
 def __init__(self, point_cloud_size=17776):
     Navigator3D.__init__(self)
     self._point_cloud = None
     self._point_cloud_coloring = None
     self._cuboids = []
     self.points_vb = PointCloudVertexBuffer(point_cloud_size)
     self._user_text = OnscreenText('', style=1, fg=(1, 1, 1, 1), scale=.04)
     self._user_text.setPos(-0.9, 0.9)
Esempio n. 28
0
 def enter(self):
     if not self.isEntered:
         if self.wantHeader:
             # Create the header at the top of the page.
             self.header = OnscreenText(text=self.title,
                                        pos=(0, 0.62, 0),
                                        scale=0.12)
     StateData.enter(self)
 def __init__(self, index):
     DirectFrame.__init__(self, scale=0.5)
     stickergui = loader.loadModel(
         'phase_3.5/models/gui/stickerbook_gui.bam')
     self['image'] = stickergui.find('**/paper_note')
     self['image_scale'] = (1.3, 1, 1)
     self.setPos(self.spots[index])
     self.useProgressBar = False
     self.headingText = OnscreenText(parent=self,
                                     text="",
                                     font=CIGlobals.getToonFont(),
                                     pos=self.HeadingTextPos,
                                     scale=self.HeadingTextScale)
     self.taskInfoText = OnscreenText(parent=self,
                                      text="",
                                      font=CIGlobals.getToonFont(),
                                      pos=self.TaskInfoTextPos,
                                      scale=self.NonHeadingTextScale)
     self.progressText = OnscreenText(parent=self,
                                      text="",
                                      font=CIGlobals.getToonFont(),
                                      pos=self.ProgressTextPos,
                                      scale=self.ProgressTextScale)
     self.progressBar = DirectWaitBar(
         parent=self,
         relief=DGG.SUNKEN,
         frameSize=(-0.95, 0.95, -0.1, 0.12),
         borderWidth=(0.025, 0.025),
         scale=0.4,
         frameColor=(251.0 / 255, 252.0 / 255, 176.0 / 255, 1.0),
         barColor=(0.5, 0.7, 0.5, 1),
         text='0/0',
         text_font=CIGlobals.getToonFont(),
         text_scale=0.19,
         text_fg=(0.05, 0.14, 0.4, 1),
         text_align=TextNode.ACenter,
         text_pos=(0, -0.05),  #-0.02
         pos=self.ProgressBarPos)
     self.progressBar.hide()
     self.rewardText = OnscreenText(parent=self,
                                    text="",
                                    font=CIGlobals.getToonFont(),
                                    pos=self.RewardTextPos,
                                    scale=self.RewardTextScale,
                                    fg=(1, 0.1, 0.1, 1.0))
     self.hide()
def announceHood(hood):
    nameLbl = OnscreenText(text="%s\n%s" % (hood, ZoneUtil.Playground),
                           scale=0.15,
                           font=CIGlobals.getMickeyFont(),
                           pos=(0, -0.65),
                           fg=(1, 0.3, 0.5, 1.0))
    Sequence(Wait(2.5), Func(startFade, nameLbl), Wait(1),
             Func(nameLbl.destroy)).start()