Yeah with this code it just draws the specified image every frame, for that frame only, it doesn't leave any image on screen after the frame has passed like an IGUIImage woulda, so as Acki says just decrease the size of the rectangle and it should show up smaller on the screen.
// setup
m_Energy = GUIEnv()->addImage(irr::core::rect< irr::s32 >(765,200,780,400));
m_Energy->setImage(driver()->getTexture("bar.png"));
// in main loop
int hi=(int)(400-(pRacer.energyleft/pRacer.totalEnergy)*200);
m_Energy->setRelativePosition(core::rect<s32>(765,hi,780,400));
Definition of an Upgrade: Take old bugs out, put new ones in.
error C2440: '=' : cannot convert from 'class irr::gui::IGUIImage *' to 'class irr::gui::IGUIEnvironment *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
error C2039: 'setImage' : is not a member of 'IGUIEnvironment'
c:\program files\microsoft visual studio\vc98\include\iguienvironment.h(45) : see declaration of 'IGUIEnvironment'
error C2039: 'setRelativePosition' : is not a member of 'IGUIEnvironment'
c:\program files\microsoft visual studio\vc98\include\iguienvironment.h(45) : see declaration of 'IGUIEnvironment'
I don't know how to fix it. I look over in doc of irrlicht engine but i don't understand. Please help me and sorry about my stupid.