Jump to content

[Python] Adicionar Percentagem De Hp Dos Moobs


Dynamic Things
 Share

Recommended Posts

Boas, o titulo penso que não foi de todo o mais esclarecedor, então sendo assim deixo-vos aqui uma imagem do que vamos fazer.

2015-07-28_12-09-06.jpg

Vamos extrair o root

Abrir uiTarget.py

Procurar por:

def __init__(self):

A baixo de:

	hpGauge = ui.Gauge()
	hpGauge.SetParent(self)
	hpGauge.MakeGauge(130, "red")
	hpGauge.Hide()

Adicionar:

	hpPercenttxt = ui.TextLine()
	hpPercenttxt.SetParent(self)
	hpPercenttxt.SetPosition(160, 13)
	hpPercenttxt.SetText("")
	hpPercenttxt.Hide()

Procurar por:

               self.hpGauge = hpGauge

Adicionar em baixo:

	self.hpPercenttxt = hpPercenttxt

Procurar por:

def SetHP(self, hpPercentage):

Por baixo de:

self.UpdatePosition()

Adicionar:

		self.hpPercenttxt.SetPosition(200 + 7*self.nameLength-205, 13)
		self.hpPercenttxt.Show()

Procurar por

	self.hpGauge.SetPercentage(hpPercentage, 100)

Adicionar por baixo:

               self.hpPercenttxt.SetText("%d%%" % (hpPercentage))

Feito isso podem compactar o root, e testar se está tudo ok.

Cumprimentos Dynamic Things

Link to comment
Share on other sites

  • 1 year later...
  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...