Exemplo n.º 1
0
 def __init__(self, parent = aspect2d):
     global GlobalWebcore
     self.parent = parent
     self.mx = 0
     self.my = 0
     self.htmlFile = 'index.html'
     self.transparency = False
     if GlobalWebcore:
         pass
     1
     GlobalWebcore = AwWebCore(AwWebCore.LOGVERBOSE, True, AwWebCore.PFBGRA)
     GlobalWebcore.setBaseDirectory('.')
     for errResponse in xrange(400, 600):
         GlobalWebcore.setCustomResponsePage(errResponse, 'error.html')
     
     self.webView = GlobalWebcore.createWebView(WEB_WIDTH, WEB_HEIGHT, self.transparency, False, 70)
     frameName = ''
     inGameNewsUrl = self.getInGameNewsUrl()
     self.imgBuffer = array.array('B')
     for i in xrange(WEB_WIDTH * WEB_HEIGHT):
         self.imgBuffer.append(0)
         self.imgBuffer.append(0)
         self.imgBuffer.append(0)
         self.imgBuffer.append(255)
     
     if self.useHalfTexture:
         self.leftBuffer = array.array('B')
         for i in xrange(WEB_HALF_WIDTH * WEB_HEIGHT):
             self.leftBuffer.append(0)
             self.leftBuffer.append(0)
             self.leftBuffer.append(0)
             self.leftBuffer.append(255)
         
         self.rightBuffer = array.array('B')
         for i in xrange(WEB_HALF_WIDTH * WEB_HEIGHT):
             self.rightBuffer.append(0)
             self.rightBuffer.append(0)
             self.rightBuffer.append(0)
             self.rightBuffer.append(255)
         
     
     self.setupTexture()
     if self.useHalfTexture:
         self.setupHalfTextures()
     
     self.accept('mouse1', self.mouseDown, [
         AwWebView.LEFTMOUSEBTN])
     self.accept('mouse3', self.mouseDown, [
         AwWebView.RIGHTMOUSEBTN])
     self.accept('mouse1-up', self.mouseUp, [
         AwWebView.LEFTMOUSEBTN])
     self.accept('mouse3-up', self.mouseUp, [
         AwWebView.RIGHTMOUSEBTN])
Exemplo n.º 2
0
    def __init__(self, parent=aspect2d):
        global GlobalWebcore
        self.parent = parent
        self.mx = 0
        self.my = 0
        self.htmlFile = "index.html"
        self.transparency = False
        if GlobalWebcore:
            pass
        1
        GlobalWebcore = AwWebCore(AwWebCore.LOGVERBOSE, True, AwWebCore.PFBGRA)
        GlobalWebcore.setBaseDirectory(".")
        for errResponse in xrange(400, 600):
            GlobalWebcore.setCustomResponsePage(errResponse, "error.html")

        self.webView = GlobalWebcore.createWebView(WEB_WIDTH, WEB_HEIGHT, self.transparency, False, 70)
        frameName = ""
        inGameNewsUrl = self.getInGameNewsUrl()
        self.imgBuffer = array.array("B")
        for i in xrange(WEB_WIDTH * WEB_HEIGHT):
            self.imgBuffer.append(0)
            self.imgBuffer.append(0)
            self.imgBuffer.append(0)
            self.imgBuffer.append(255)

        if self.useHalfTexture:
            self.leftBuffer = array.array("B")
            for i in xrange(WEB_HALF_WIDTH * WEB_HEIGHT):
                self.leftBuffer.append(0)
                self.leftBuffer.append(0)
                self.leftBuffer.append(0)
                self.leftBuffer.append(255)

            self.rightBuffer = array.array("B")
            for i in xrange(WEB_HALF_WIDTH * WEB_HEIGHT):
                self.rightBuffer.append(0)
                self.rightBuffer.append(0)
                self.rightBuffer.append(0)
                self.rightBuffer.append(255)

        self.setupTexture()
        if self.useHalfTexture:
            self.setupHalfTextures()

        self.accept("mouse1", self.mouseDown, [AwWebView.LEFTMOUSEBTN])
        self.accept("mouse3", self.mouseDown, [AwWebView.RIGHTMOUSEBTN])
        self.accept("mouse1-up", self.mouseUp, [AwWebView.LEFTMOUSEBTN])
        self.accept("mouse3-up", self.mouseUp, [AwWebView.RIGHTMOUSEBTN])
Exemplo n.º 3
0
    def __init__(self, parent=aspect2d):
        """Properly initialize ourself."""
        #AwWebViewListener.AwWebViewListener.__init__(self)
        self.parent = parent
        self.mx = 0
        self.my = 0
        self.htmlFile = "index.html"
        self.transparency = False  # this is important looks weird if it's true
        global GlobalWebcore
        if GlobalWebcore:
            # we get a C++ crash if we construct webcore a second time
            pass
        else:
            GlobalWebcore = AwWebCore(AwWebCore.LOGVERBOSE, True,
                                      AwWebCore.PFBGRA)
            GlobalWebcore.setBaseDirectory('.')
            for errResponse in xrange(400, 600):
                GlobalWebcore.setCustomResponsePage(errResponse, "error.html")

        self.webView = GlobalWebcore.createWebView(WEB_WIDTH, WEB_HEIGHT,
                                                   self.transparency, False,
                                                   70)
        #self.webView.setListener(self)
        #self.webView.setCallback("requestFPS");
        frameName = ''
        inGameNewsUrl = self.getInGameNewsUrl()
        #self.webView.loadURL2(inGameNewsUrl)

        self.imgBuffer = array.array('B')
        for i in xrange(WEB_WIDTH * WEB_HEIGHT):
            self.imgBuffer.append(0)
            self.imgBuffer.append(0)
            self.imgBuffer.append(0)
            self.imgBuffer.append(255)

        if self.useHalfTexture:
            self.leftBuffer = array.array('B')
            for i in xrange(WEB_HALF_WIDTH * WEB_HEIGHT):
                self.leftBuffer.append(0)
                self.leftBuffer.append(0)
                self.leftBuffer.append(0)
                self.leftBuffer.append(255)
            self.rightBuffer = array.array('B')
            for i in xrange(WEB_HALF_WIDTH * WEB_HEIGHT):
                self.rightBuffer.append(0)
                self.rightBuffer.append(0)
                self.rightBuffer.append(0)
                self.rightBuffer.append(255)

        self.setupTexture()
        if self.useHalfTexture:
            self.setupHalfTextures()

        #self.interval = LerpHprInterval(self.quad, 2, Vec3(360, 0, 0), Vec3(0, 0, 0))

        #self.accept("escape", sys.exit, [0])
        #self.accept("w", self.writeTex)

        self.accept("mouse1", self.mouseDown, [AwWebView.LEFTMOUSEBTN])
        self.accept("mouse3", self.mouseDown, [AwWebView.RIGHTMOUSEBTN])
        self.accept("mouse1-up", self.mouseUp, [AwWebView.LEFTMOUSEBTN])
        self.accept("mouse3-up", self.mouseUp, [AwWebView.RIGHTMOUSEBTN])