コード例 #1
0
    def Draw(self, textObject, x=0, y=0, z=0):
        """ Draw the textobject.
        """
        FontManager.Draw(self, textObject)

        # Get data
        vertices, texCords = textObject._GetFinalData()

        # Translate
        if x or y or z:
            gl.glPushMatrix()
            gl.glTranslatef(x, y, z)

        # Draw
        atlas = self.GetFont(textObject.fontName).atlas
        simpleTextureDraw(vertices, texCords, atlas, textObject.textColor)

        # Un-translate
        if x or y or z:
            gl.glPopMatrix()
コード例 #2
0
 def Draw(self, textObject, x=0, y=0, z=0):
     """ Draw the textobject.
     """
     FontManager.Draw(self, textObject)
     
     # Get data
     vertices, texCords = textObject._GetFinalData()
     
     # Translate
     if x or y or z:
         gl.glPushMatrix()
         gl.glTranslatef(x, y, z)
     
     # Draw
     atlas = self.GetFont(textObject.fontName).atlas
     simpleTextureDraw(vertices, texCords, atlas, textObject.textColor)
     
     # Un-translate
     if x or y or z:
         gl.glPopMatrix()
コード例 #3
0
ファイル: text_freetype.py プロジェクト: turapeach/TOAK
 def Draw(self, textObject, x=0, y=0, z=0):
     # Check if we need to recompile in case TEX_SCALE was changed
     if hasattr(textObject, '_tex_scale') and  textObject._tex_scale != TEX_SCALE:
         textObject.Invalidate()
     
     FontManager.Draw(self, textObject)
     
     # Get data
     vertices, texCords = textObject._GetFinalData()
     
     # Translate
     if x or y or z:
         gl.glPushMatrix()
         gl.glTranslatef(x, y, z)
     
     # Draw
     self.shader.Enable()
     simpleTextureDraw(vertices, texCords, self.atlas, textObject.textColor)
     self.shader.Disable()
     
     # Un-translate
     if x or y or z:
         gl.glPopMatrix() 
コード例 #4
0
    def Draw(self, textObject, x=0, y=0, z=0):
        # Check if we need to recompile in case TEX_SCALE was changed
        if hasattr(textObject,
                   '_tex_scale') and textObject._tex_scale != TEX_SCALE:
            textObject.Invalidate()

        FontManager.Draw(self, textObject)

        # Get data
        vertices, texCords = textObject._GetFinalData()

        # Translate
        if x or y or z:
            gl.glPushMatrix()
            gl.glTranslatef(x, y, z)

        # Draw
        self.shader.Enable()
        simpleTextureDraw(vertices, texCords, self.atlas, textObject.textColor)
        self.shader.Disable()

        # Un-translate
        if x or y or z:
            gl.glPopMatrix()