[Snippet]Draw Battery Box

Posts 16 of 6 · Page 1 of 1
[Snippet]Draw Battery Box
Code:
void cDraw::Battery(int x, int y,LPDIRECT3DDEVICE9 pDevice)
{
	SYSTEM_POWER_STATUS Bat;
	GetSystemPowerStatus( &Bat );

	D3D.Draw.Box(x,y,115,28,1,0x8F000000,0xFFFF00FF,pDevice,true,false);

	if(Bat.BatteryLifeTime > -1)
		D3D.Draw.GameTextPixel(x+3,y+1,0xFF8F8F00,"Remain: %i / Full: %i",Bat.BatteryLifeTime*60,Bat.BatteryFullLifeTime*60);
	else
		D3D.Draw.GameTextPixel(x+3,y+1,0xFF8F8F00,/*Kotentopf*/"No Battery! No Laptop?");

	if(Bat.BatteryLifePercent != 255){
		D3D.Draw.Healthbar(x+6,y+13,103,13,1,0xFF0FFF00,0xFFFFFFFF,Bat.BatteryLifePercent,100,pDevice,false);
		D3D.Draw.GameTextPixel(x+30,y+13,0xFF8F8F00,"%i Percent",Bat.BatteryLifePercent);
	}
	else{
		D3D.Draw.Healthbar(x+6,y+13,103,13,1,0xFF0FFF00,0xFFFFFFFF,100,100,pDevice,false);
		D3D.Draw.GameTextPixel(x+30,y+13,0xFF8F8F00,"100 Percent");
	}
}
Enjoy or not.

Creditz: Me and MSDN

Oh and before a Minion cry, use the Snippet-Tag: Its not available for me, idk why.
Good Job bro .
Tehe Posted a function that does the same thing as this

Good job bro
I thought this was already posted a while ago.
Quote Originally Posted by master131backup View Post
I thought this was already posted a while ago.
/me ......
Liek Battery p0w3r ftw?
Posts 16 of 6 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Need help?