Gauge has no attribute
- Hades ✔
-

- Mesaje: 3363
- Membru din: 22 Aug 2016, 18:35
- Server: Hades World
- Aprecieri: 104
- Mulţumiri: 824
- Discord: Copiază ID
- Contact:
Ai exemplu de gauge pe taskbar, de la hp, probabil e acelasi si in sistem. 
[ Postat de pe Android ]
[ Postat de pe Android ]

Ii lipseau din class Gauge (ui.py):
def SetWidth(self, width):
self.width = max(48, width)
self.imgRight.SetPosition(width - self.SLOT_WIDTH, 0)
self.imgCenter.SetRenderingRect(0.0, 0.0, float((width - self.SLOT_WIDTH*2) - self.SLOT_WIDTH) / self.SLOT_WIDTH, 0.0)
self.SetSize(width, self.SLOT_HEIGHT)
self.SetPercentage(self.lastCurValue, self.lastMaxValue)
def ChangeColor(self, color):
if self.imgGauge:
self.imgGauge.LoadImage("d:/ymir work/ui/pattern/gauge_" + color + ".tga")
def ChangeColor(self, color):
if self.imgGauge:
self.imgGauge.LoadImage("d:/ymir work/ui/pattern/gauge_" + color + ".tga")
def SetPercentage(self, curValue, maxValue):
if maxValue > 0.0:
percentage = min(1.0, float(curValue)/float(maxValue))
else:
percentage = 0.0
self.lastCurValue = curValue
self.lastMaxValue = maxValue
gaugeSize = -1.0 + float(self.width - self.GAUGE_TEMPORARY_PLACE*2) * percentage / self.GAUGE_WIDTH
self.imgGauge.SetRenderingRect(0.0, 0.0, gaugeSize, 0.0)
def SetPercentageBack(self, curValue, maxValue):
if not self.imgGaugeBack.IsShow():
self.imgGaugeBack.Show()
if maxValue > 0.0:
percentage = min(1.0, float(curValue)/float(maxValue))
else:
percentage = 0.0
gaugeSize = -1.0 + float(self.width - self.GAUGE_TEMPORARY_PLACE*2) * percentage / self.GAUGE_WIDTH
self.imgGaugeBack.SetRenderingRect(0.0, 0.0, gaugeSize, 0.0)
def GaugeImgBoxAddFlag(self, flag):
self.imgLeft.AddFlag(flag)
self.imgCenter.AddFlag(flag)
self.imgRight.AddFlag(flag)
self.imgGauge.AddFlag(flag)- [Reizo]
-

- Mesaje: 1301
- Membru din: 22 Oct 2019, 15:44
- Server: SAPPHIRE2
- Regat: Chunjo
- Aprecieri: 409
- Mulţumiri: 4322
- Discord: Copiază ID
- Contact:
Marcat ca rezolvat!
-
- Informaţie
-
Cine este conectat
Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 2 vizitatori



