コード例 #1
0
    def __init__(self):
        '''
        Constructor
        '''
        SogalForm.__init__(self, fading = True, fading_duration = 0.3, enableMask = True,backgroundColor = (0,0,0,0.6))
        self.reparentTo(aspect2d,sort = 101)
        

        self.frame = DirectScrolledFrame(parent = self, canvasSize = CANVASSIZE, 
                                         frameSize = FRAMESIZE, 
                                         autoHideScrollBars = AUTO_HIDE_SCROLLBARS,
                                         )
        
        self.reloadTheme()
        
        self.height = TOP
        self.shiftedHeight = 0
        self.shifter = NodePath('text_history_shifter')
        self.shifter.reparentTo(self.frame.getCanvas())
        
        if not prop_set_up:
            nameprops = TextProperties()  # @UndefinedVariable
            nameprops.setTextScale(0.75)
            TextPropertiesManager.getGlobalPtr().setProperties("th_name", nameprops)  # @UndefinedVariable
 
        self.labels = []
コード例 #2
0
    def __init__(self):

        self.frameMain = DirectFrame(frameSize=(base.a2dLeft, base.a2dRight,
                                                base.a2dBottom, base.a2dTop),
                                     frameColor=(0.05, 0.05, 0.05, 1))
        self.frameMain.setTransparency(1)

        tpBig = TextProperties()
        tpBig.setTextScale(1.5)
        tpSmall = TextProperties()
        tpSmall.setTextScale(0.75)
        tpUs = TextProperties()
        tpUs.setUnderscore(True)
        tpMgr = TextPropertiesManager.getGlobalPtr()
        tpMgr.setProperties("big", tpBig)
        tpMgr.setProperties("small", tpSmall)
        tpMgr.setProperties("us", tpUs)

        creditsText = ""
        with open("credits.txt") as f:
            creditsText = f.read()
        self.lblCredits = DirectLabel(text=creditsText,
                                      text_fg=(1, 1, 1, 1),
                                      text_bg=(0, 0, 0, 0),
                                      frameColor=(0, 0, 0, 0),
                                      text_align=TextNode.ACenter,
                                      scale=0.1,
                                      pos=(0, 0, base.a2dTop - 0.2))
        self.lblCredits.setTransparency(1)
        self.lblCredits.reparentTo(self.frameMain)

        self.creditsScroll = LerpPosInterval(self.lblCredits,
                                             12.0, (0, 0, base.a2dTop + 3.5),
                                             startPos=(0, 0, base.a2dBottom),
                                             name="CreditsScroll")

        self.btnBack = DirectButton(text="BACK",
                                    text_fg=(1, 1, 1, 1),
                                    text_align=TextNode.ALeft,
                                    scale=0.1,
                                    pad=(0.15, 0.15),
                                    pos=(base.a2dLeft + 0.08, 0,
                                         base.a2dBottom + 0.05),
                                    frameColor=(
                                        (0.2, 0.2, 0.2, 0.8),
                                        (0.4, 0.4, 0.4, 0.8),
                                        (0.4, 0.4, 0.4, 0.8),
                                        (0.1, 0.1, 0.1, 0.8),
                                    ),
                                    relief=1,
                                    command=base.messenger.send,
                                    extraArgs=["Credits-Back"],
                                    pressEffect=False,
                                    rolloverSound=None,
                                    clickSound=None)
        self.btnBack.setTransparency(1)
        self.btnBack.reparentTo(self.frameMain)

        self.hide()
コード例 #3
0
    def __init__(self):

        self.frameMain = DirectFrame(
            frameSize = (base.a2dLeft, base.a2dRight,
                         base.a2dBottom, base.a2dTop),
            frameColor = (0.05, 0.05, 0.05, 1))
        self.frameMain.setTransparency(1)

        tpBig = TextProperties()
        tpBig.setTextScale(1.5)
        tpSmall = TextProperties()
        tpSmall.setTextScale(0.75)
        tpUs = TextProperties()
        tpUs.setUnderscore(True)
        tpMgr = TextPropertiesManager.getGlobalPtr()
        tpMgr.setProperties("big", tpBig)
        tpMgr.setProperties("small", tpSmall)
        tpMgr.setProperties("us", tpUs)

        creditsText = ""
        with open("credits.txt") as f:
            creditsText = f.read()
        self.lblCredits = DirectLabel(
            text = creditsText,
            text_fg = (1,1,1,1),
            text_bg = (0,0,0,0),
            frameColor = (0,0,0,0),
            text_align = TextNode.ACenter,
            scale = 0.1,
            pos = (0, 0, base.a2dTop - 0.2))
        self.lblCredits.setTransparency(1)
        self.lblCredits.reparentTo(self.frameMain)

        self.creditsScroll = LerpPosInterval(
            self.lblCredits,
            12.0,
            (0, 0, base.a2dTop + 3.5),
            startPos=(0, 0, base.a2dBottom),
            name="CreditsScroll")

        self.btnBack = DirectButton(
            text = "BACK",
            text_fg = (1,1,1,1),
            text_align = TextNode.ALeft,
            scale = 0.1,
            pad = (0.15, 0.15),
            pos = (base.a2dLeft + 0.08, 0, base.a2dBottom + 0.05),
            frameColor = (
                (0.2,0.2,0.2,0.8),
                (0.4,0.4,0.4,0.8),
                (0.4,0.4,0.4,0.8),
                (0.1,0.1,0.1,0.8),
                ),
            relief = 1,
            command = base.messenger.send,
            extraArgs = ["Credits-Back"],
            pressEffect = False,
            rolloverSound = None,
            clickSound = None)
        self.btnBack.setTransparency(1)
        self.btnBack.reparentTo(self.frameMain)

        self.hide()