kralhakan2009 1
kralhakan2009
Bodyguardd 1
Bodyguardd
Vahsi Uzman 1
Vahsi Uzman
noisiv 1
noisiv
Manwe Work 1
Manwe Work
Bvural41 1
Bvural41
mavzermete 1
mavzermete
kaptanmikro1 1
kaptanmikro1
Reklam vermek için turkmmo@gmail.com

[PY] HP System

  • Konuyu başlatan Konuyu başlatan XxZeMaHSeRxX-Turkmmo
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 32
  • Görüntüleme Görüntüleme 6K
RegalGoalDomesticpigeon.gif


[CODE lang="python" title="ui.py"]# Arat

class Board (Window)

# Ekle

https://www.paste.tc/HwSsiP0c8m

[/CODE]

[CODE lang="python" title="uitarget.py"]# Arat

hpGauge.MakeGauge ( 130 , "red" )

# Değiştir

hpGauge.MakeGauge ( 130 , "red" , "blue" )

# Arat

ui.Gauge

# Değiştir

ui.DynamicGauge
[/CODE]​
 
Son düzenleme:

En Çok Reaksiyon Alan Mesajlar

RegalGoalDomesticpigeon.gif


[CODE lang="python" title="ui.py"]# Arat

class Board (Window)

# Ekle

class DynamicGauge (Gauge):
dynamicGaugePerc = None
newGaugePerc = 0
def __init__ ( self ):
Gauge. __init__ ( self )
def __del__ ( self ):
Gauge. __del__ ( self )

def MakeGauge ( self , width, color1, color2):
Gauge.MakeGauge ( self , width, color2)

imgGauge2 = ExpandedImageBox ()
imgGauge2.SetParent ( self )
imgGauge2.LoadImage ( "d: / ymir work / ui / pattern / gauge_" + color1 + ".tga" )
imgGauge2.Show ()
imgGauge2.SetRenderingRect ( 0 . 0 , 0 . 0 , 0 . 0 , 0 . 0 )
imgGauge2.SetPosition ( self .GAUGE_TEMPORARY_PLACE, 0 )

self .imgGauge2 = imgGauge2

def SetPercentage ( self , curValue, maxValue):
# PERCENTAGE_MAX_VALUE_ZERO_DIVISION_ERROR
if maxValue > 0 . 0 :
percentage = min ( 1 . 0 , float (curValue) / float (maxValue))
else :
percentage = 0 . 0
# END_OF_PERCENTAGE_MAX_VALUE_ZERO_DIVISION_ERROR
gaugeSize = - 1 . 0 + float ( self .width - self .GAUGE_TEMPORARY_PLACE * 2 ) * percentage / self .GAUGE_WIDTH

if self .dynamicGaugePerc = = None :
self .imgGauge.SetRenderingRect ( 0 . 0 , 0 . 0 , ( - 1 . 0 + float ( self .width - self .GAUGE_TEMPORARY_PLACE * 2 ) * percentage / self .GAUGE_WIDTH), 0 . 0 )
self .dynamicGaugePerc = percentage
elif self .dynamicGaugePerc + 0 . 2 < self .newGaugePerc:
self .imgGauge.SetRenderingRect ( 0 . 0 , 0 . 0 , ( - 1 . 0 + float ( self .width - self .GAUGE_TEMPORARY_PLACE * 2 ) * self .newGaugePerc / self .GAUGE_WIDTH), 0 . 0 )
self .dynamicGaugePerc = self .newGaugePerc

self .newGaugePerc = percentage
self .imgGauge2.SetRenderingRect ( 0 . 0 , 0 . 0 , gaugeSize, 0 . 0 )
if percentage = = 0 :
self .imgGauge.Hide ()
else :
self .imgGauge.Show ()

def OnUpdate ( self ):
if self .dynamicGaugePerc > self .newGaugePerc:
self .dynamicGaugePerc = self .dynamicGaugePerc - 0 . 005
self .imgGauge.SetRenderingRect ( 0 . 0 , 0 . 0 , ( - 1 . 0 + float ( self .width - self .GAUGE_TEMPORARY_PLACE * 2 ) * self .dynamicGaugePerc / self .GAUGE_WIDTH), 0 . 0 )
elif self .dynamicGaugePerc < self .newGaugePerc:
self .dynamicGaugePerc = self .newGaugePerc
self .imgGauge.SetRenderingRect ( 0 . 0 , 0 . 0 , ( - 1 . 0 + float ( self .width - self .GAUGE_TEMPORARY_PLACE * 2 ) * self .dynamicGaugePerc / self .GAUGE_WIDTH), 0 . 0 )[/CODE]

[CODE lang="python" title="uitarget.py"]# Arat

hpGauge.MakeGauge ( 130 , "red" )

# Değiştir

hpGauge.MakeGauge ( 130 , "red" , "blue" )

# Arat

ui.Gauge

# Değiştir

ui.DynamicGauge
[/CODE]​

Ellerine Sağlık ?
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst