So an IGUIImage object would be able to return an ITexture, e.g:
Code: Select all
ITexture* tex = MyIGUIImageObj->getITexture();
IGUIImage* img = MyITextureObj->getIGUIImage();
Code: Select all
ITexture* tex = MyIGUIImageObj->getITexture();
IGUIImage* img = MyITextureObj->getIGUIImage();
Code: Select all
void CGameState::addMouseCursor(CGameManager* pManager, c8* Cursor_file)
{
m_pMouseCursor = pManager->getVideoDriver()->getTexture(Cursor_file);
pManager->getVideoDriver()->makeColorKeyTexture(m_pMouseCursor, SColor(0,0,0,0));
IGUIImage *image = pManager->getGUIEnvironment()->addImage(rect<s32>(0,0,32,32));
image->setImage(m_pMouseCursor);
image->setScaleImage(true);
image->setRelativePosition(rect<s32>(100,100,200,200));
}
Code: Select all
pManager->getVideoDriver()->draw2DImage(
m_pMouseCursor,
// So the center of the icon will be the place getting checked on mouse clicks
position2di(m_MousePos.X - m_pMouseCursor->getSize().Width/2+1, m_MousePos.Y-15),
rect<s32>(position2di(0,0),m_pMouseCursor->getSize()), 0, SColor(255,255,255,255), true);