well, this line seems to be correct...
maybe you didn't put this line between driver->beginScene(...) and driver->endScene() ???
(a little bit more code around this line would help, too)
and make sure you make that function call AFTER smgr->drawAll() as otherwise the scene will be drawn on top of the bar and hence it won't be visible!
you may be doing this already but i suggest you draw 2 boxes to represent your health bar. one which is 100% the size of the health bar and may be white in colour and another box on top of that which is the actual health value in size and green in colour so that the green health bar fills up the white box so you can see the percentage of health easily.
Vintige wrote:Thankyou. Ive put the function after smgr->drawAll() and i can now see the health bar but it doesnt do nothing when i press A and S
That sounds like a job for... DEBUGGER MAN. With the power to set breakpoints, examine variables, and follow execution, no bug can stand against his mighty powers of investigation!
is node a valid pointer (!= 0) ???
did you pass the event receiver to the device ???
also remember the health is decreased only by 1 and only every time you release the key(s), so if you want it to get 0 you'll have to press the key 100 times !!!