예제 #1
0
 def __init__(self):
     VisualState.__init__(self)
     self.textStyle = ''
     self.iconTextureName = ''
     self.iconTextureMapping = None
     self.iconColour = (255, 255, 255, 255)
     return
예제 #2
0
 def onLoad(self, dataSection):
     VisualState.onLoad(self, dataSection)
     if dataSection.has_key('background'):
         backgroundSection = dataSection._background
         self.backgroundTextureName = backgroundSection.readString('textureName', '')
         if backgroundSection.has_key('mapping'):
             mappingSection = backgroundSection._mapping
             mappingType, mapping = self._readMappingSection(mappingSection)
             self.backgroundTextureMappingType = mappingType
             self.backgroundTextureMapping = mapping
         else:
             self.backgroundTextureMapping = None
         self.backgroundColour = backgroundSection.readVector4('colour', (255, 255, 255, 255))
     if dataSection.has_key('thumb'):
         thumbSection = dataSection._thumb
         self.thumbTextureName = thumbSection.readString('textureName', '')
         if thumbSection.has_key('mapping'):
             mappingSection = thumbSection._mapping
             mappingType, mapping = self._readMappingSection(mappingSection)
             self.thumbTextureMappingType = mappingType
             self.thumbTextureMapping = mapping
         else:
             self.thumbTextureMapping = None
         self.thumbColour = thumbSection.readVector4('colour', (255, 255, 255, 255))
     return
예제 #3
0
 def __init__(self):
     VisualState.__init__(self)
     self.textStyle = ''
     self.iconTextureName = ''
     self.iconTextureMapping = None
     self.iconColour = (255, 255, 255, 255)
     return
예제 #4
0
 def onLoad(self, dataSection):
     VisualState.onLoad(self, dataSection)
     if dataSection.has_key('background'):
         backgroundSection = dataSection._background
         self.backgroundTextureName = backgroundSection.readString('textureName', '')
         if backgroundSection.has_key('mapping'):
             mappingSection = backgroundSection._mapping
             mappingType, mapping = self._readMappingSection(mappingSection)
             self.backgroundTextureMappingType = mappingType
             self.backgroundTextureMapping = mapping
         else:
             self.backgroundTextureMapping = None
         self.backgroundColour = backgroundSection.readVector4('colour', (255, 255, 255, 255))
     if dataSection.has_key('thumb'):
         thumbSection = dataSection._thumb
         self.thumbTextureName = thumbSection.readString('textureName', '')
         if thumbSection.has_key('mapping'):
             mappingSection = thumbSection._mapping
             mappingType, mapping = self._readMappingSection(mappingSection)
             self.thumbTextureMappingType = mappingType
             self.thumbTextureMapping = mapping
         else:
             self.thumbTextureMapping = None
         self.thumbColour = thumbSection.readVector4('colour', (255, 255, 255, 255))
     return
예제 #5
0
 def __init__(self):
     VisualState.__init__(self)
     self.backgroundTextureName = ''
     self.backgroundTextureMapping = None
     self.backgroundColour = (255, 255, 255, 255)
     self.thumbTextureName = ''
     self.thumbTextureMapping = None
     self.thumbColour = (255, 255, 255, 255)
     return
예제 #6
0
 def __init__(self):
     VisualState.__init__(self)
     self.backgroundTextureName = ''
     self.backgroundTextureMapping = None
     self.backgroundColour = (255, 255, 255, 255)
     self.thumbTextureName = ''
     self.thumbTextureMapping = None
     self.thumbColour = (255, 255, 255, 255)
     return
예제 #7
0
 def onSave(self, dataSection):
     VisualState.onSave(self, dataSection)
     if self.textStyle:
         dataSection.writeString('textStyle', self.textStyle)
     iconSection = dataSection.createSection('icon')
     iconSection.writeString('textureName', self.iconTextureName)
     iconSection.writeString('materialFX', self.iconMaterialFX)
     if self.iconTextureMapping:
         mappingSection = iconSection.createSection('mapping')
         self._writeMappingSection(mappingSection, self.iconTextureMappingType, self.iconTextureMapping)
     iconSection.writeVector4('colour', self.iconColour)
예제 #8
0
 def onSave(self, dataSection):
     VisualState.onSave(self, dataSection)
     if self.textStyle:
         dataSection.writeString('textStyle', self.textStyle)
     iconSection = dataSection.createSection('icon')
     iconSection.writeString('textureName', self.iconTextureName)
     iconSection.writeString('materialFX', self.iconMaterialFX)
     if self.iconTextureMapping:
         mappingSection = iconSection.createSection('mapping')
         self._writeMappingSection(mappingSection, self.iconTextureMappingType, self.iconTextureMapping)
     iconSection.writeVector4('colour', self.iconColour)
예제 #9
0
 def apply(self, componentScript):
     VisualState.apply(self, componentScript)
     if hasattr(componentScript, 'sliderBackground'):
         componentScript.sliderBackground.textureName = self.backgroundTextureName
         if self.thumbTextureMapping:
             applyMapping(componentScript.sliderBackground, self.backgroundTextureMappingType, self.backgroundTextureMapping)
         componentScript.sliderBackground.colour = self.backgroundColour
     if hasattr(componentScript, 'sliderThumb'):
         componentScript.sliderThumb.textureName = self.thumbTextureName
         if self.thumbTextureMapping:
             applyMapping(componentScript.sliderThumb, self.thumbTextureMappingType, self.thumbTextureMapping)
         componentScript.sliderThumb.colour = self.thumbColour
예제 #10
0
 def apply(self, componentScript):
     VisualState.apply(self, componentScript)
     if hasattr(componentScript, 'sliderBackground'):
         componentScript.sliderBackground.textureName = self.backgroundTextureName
         if self.thumbTextureMapping:
             applyMapping(componentScript.sliderBackground, self.backgroundTextureMappingType, self.backgroundTextureMapping)
         componentScript.sliderBackground.colour = self.backgroundColour
     if hasattr(componentScript, 'sliderThumb'):
         componentScript.sliderThumb.textureName = self.thumbTextureName
         if self.thumbTextureMapping:
             applyMapping(componentScript.sliderThumb, self.thumbTextureMappingType, self.thumbTextureMapping)
         componentScript.sliderThumb.colour = self.thumbColour
예제 #11
0
 def onSave(self, dataSection):
     VisualState.onSave(self, dataSection)
     backgroundSection = dataSection.createSection('background')
     backgroundSection.writeString('textureName', self.backgroundTextureName)
     if self.backgroundTextureMapping:
         mappingSection = backgroundSection.createSection('mapping')
         self._writeMappingSection(mappingSection, self.backgroundTextureMappingType, self.backgroundTextureMapping)
     backgroundSection.writeVector4('colour', self.backgroundColour)
     thumbSection = dataSection.createSection('thumb')
     thumbSection.writeString('textureName', self.thumbTextureName)
     if self.thumbTextureMapping:
         mappingSection = thumbSection.createSection('mapping')
         self._writeMappingSection(mappingSection, self.thumbTextureMappingType, self.thumbTextureMapping)
     thumbSection.writeVector4('colour', self.thumbColour)
예제 #12
0
 def apply(self, componentScript):
     VisualState.apply(self, componentScript)
     if getattr(componentScript, 'buttonLabel', None) is not None and self.textStyle:
         TextStyles.setStyle(componentScript.buttonLabel, self.textStyle)
     if hasattr(componentScript, 'buttonIcon'):
         componentScript.buttonIcon.textureName = self.iconTextureName
         if self.iconTextureMapping:
             Utils.applyMapping(componentScript.buttonIcon, self.iconTextureMappingType, self.iconTextureMapping)
         componentScript.buttonIcon.colour = self.iconColour
         if self.iconMaterialFX != '':
             componentScript.buttonIcon.materialFX = self.iconMaterialFX
         else:
             componentScript.buttonIcon.materialFX = 'BLEND'
     return
예제 #13
0
 def onSave(self, dataSection):
     VisualState.onSave(self, dataSection)
     backgroundSection = dataSection.createSection('background')
     backgroundSection.writeString('textureName', self.backgroundTextureName)
     if self.backgroundTextureMapping:
         mappingSection = backgroundSection.createSection('mapping')
         self._writeMappingSection(mappingSection, self.backgroundTextureMappingType, self.backgroundTextureMapping)
     backgroundSection.writeVector4('colour', self.backgroundColour)
     thumbSection = dataSection.createSection('thumb')
     thumbSection.writeString('textureName', self.thumbTextureName)
     if self.thumbTextureMapping:
         mappingSection = thumbSection.createSection('mapping')
         self._writeMappingSection(mappingSection, self.thumbTextureMappingType, self.thumbTextureMapping)
     thumbSection.writeVector4('colour', self.thumbColour)
예제 #14
0
 def apply(self, componentScript):
     VisualState.apply(self, componentScript)
     if getattr(componentScript, 'buttonLabel', None) is not None and self.textStyle:
         TextStyles.setStyle(componentScript.buttonLabel, self.textStyle)
     if hasattr(componentScript, 'buttonIcon'):
         componentScript.buttonIcon.textureName = self.iconTextureName
         if self.iconTextureMapping:
             Utils.applyMapping(componentScript.buttonIcon, self.iconTextureMappingType, self.iconTextureMapping)
         componentScript.buttonIcon.colour = self.iconColour
         if self.iconMaterialFX != '':
             componentScript.buttonIcon.materialFX = self.iconMaterialFX
         else:
             componentScript.buttonIcon.materialFX = 'BLEND'
     return
예제 #15
0
 def onLoad(self, dataSection):
     VisualState.onLoad(self, dataSection)
     self.textStyle = dataSection.readString('textStyle', '')
     if dataSection.has_key('icon'):
         iconSection = dataSection._icon
         self.iconMaterialFX = iconSection.readString('materialFX', '')
         self.iconTextureName = iconSection.readString('textureName', '')
         if iconSection.has_key('mapping'):
             mappingSection = iconSection._mapping
             mappingType, mapping = self._readMappingSection(mappingSection)
             self.iconTextureMappingType = mappingType
             self.iconTextureMapping = mapping
         else:
             self.iconTextureMapping = None
         self.iconColour = iconSection.readVector4('colour', (255, 255, 255, 255))
     return
예제 #16
0
 def onLoad(self, dataSection):
     VisualState.onLoad(self, dataSection)
     self.textStyle = dataSection.readString('textStyle', '')
     if dataSection.has_key('icon'):
         iconSection = dataSection._icon
         self.iconMaterialFX = iconSection.readString('materialFX', '')
         self.iconTextureName = iconSection.readString('textureName', '')
         if iconSection.has_key('mapping'):
             mappingSection = iconSection._mapping
             mappingType, mapping = self._readMappingSection(mappingSection)
             self.iconTextureMappingType = mappingType
             self.iconTextureMapping = mapping
         else:
             self.iconTextureMapping = None
         self.iconColour = iconSection.readVector4('colour', (255, 255, 255, 255))
     return