Exemple #1
0
 def LoadAttrs(self, attrs):
     src = attrs.src
     if attrs.texture:
         sprite = Sprite(parent=self, align=uiconst.TOALL, state=uiconst.UI_DISABLED)
         sprite.rectWidth = attrs.width
         sprite.rectHeight = attrs.height
         sprite.texture = attrs.texture
     elif src.startswith('icon:'):
         uthread.new(self.LoadIcon)
 def LoadAttrs(self, attrs):
     src = attrs.src
     if attrs.texture:
         sprite = Sprite(parent=self,
                         align=uiconst.TOALL,
                         state=uiconst.UI_DISABLED)
         sprite.rectWidth = attrs.width
         sprite.rectHeight = attrs.height
         sprite.texture = attrs.texture
     elif src.startswith('icon:'):
         uthread.new(self.LoadIcon)
Exemple #3
0
 def LoadImage(self, *args):
     if not getattr(self, 'attrs', None):
         return
     browserImageSvc = sm.GetServiceIfRunning('browserImage')
     if not browserImageSvc:
         return
     texture, tWidth, tHeight = browserImageSvc.GetTextureFromURL(getattr(self.attrs, 'src', ''), getattr(self.attrs, 'currentURL', ''), fromWhere='Img::Load')
     if texture:
         sprite = Sprite(parent=self, align=uiconst.TOALL, pos=(0, 0, 0, 0))
         sprite.rectWidth = tWidth
         sprite.rectHeight = tHeight
         sprite.rectTop = 0
         sprite.rectLeft = 0
         sprite.texture = texture
         sprite.state = uiconst.UI_DISABLED
 def LoadImage(self, *args):
     if not getattr(self, 'attrs', None):
         return
     browserImageSvc = sm.GetServiceIfRunning('browserImage')
     if not browserImageSvc:
         return
     texture, tWidth, tHeight = browserImageSvc.GetTextureFromURL(
         getattr(self.attrs, 'src', ''),
         getattr(self.attrs, 'currentURL', ''),
         fromWhere='Img::Load')
     if texture:
         sprite = Sprite(parent=self, align=uiconst.TOALL, pos=(0, 0, 0, 0))
         sprite.rectWidth = tWidth
         sprite.rectHeight = tHeight
         sprite.rectTop = 0
         sprite.rectLeft = 0
         sprite.texture = texture
         sprite.state = uiconst.UI_DISABLED