Ill have a look at it and give any other ideas if need be else it seems good,
Keep it up
Code: Select all
while(device->run())
{
driver->beginScene(true, true, video::SColor(0,255,255,255));
smgr->drawAll();
guienv->drawAll();
// animate sprites
sprite1.play();
sprite2.play();
...
driver->endScene();
}could check, not because the picture is wrong with size, the image texture.png is correct, my image is error.arras wrote:I use Adobe Photoshop or GIMP.
Code: Select all
#include <irrlicht.h>
using namespace irr;
#include "AnimSprite.h"
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib")
// objetos globais
IrrlichtDevice* device = 0;
IVideoDriver* driver =0;
ISceneManager* smgr = 0;
IGUIEnvironment* guienv = 0;
int main(int argc, char **argv)
{
// Seta informações da engine
device = createDevice(EDT_OPENGL, dimension2d<s32>(1024, 768), 24,true, false, false);
device->setWindowCaption(L"Quiz! - 2004-2008 GAM STUDIO");
driver = device->getVideoDriver();
smgr = device->getSceneManager();
guienv = device->getGUIEnvironment();
IImage* seta =0;
// Inicia o loop para abertura do video
seta = driver->createImageFromFile("seta_esq.png");
ITexture *texture = driver->addTexture("texture", seta);
//driver->makeColorKeyTexture(texture, core::position2d<s32>(0,0));
seta->drop();
AnimSprite sprite1(device, texture ,4,1);
sprite1.addAnimation(0,3,400, true, false);
sprite1.setAnimation(0);
sprite1.setPosition(120,400);
while(device->run())
{
//Coloca a cor de fundo
driver->beginScene(true, true, SColor(255,100,101,140));
//coloca o fundo na tela
driver->draw2DImage(driver->getTexture("media/fundo.jpg"), core::position2d<s32>(0,0),core::rect<s32>(0,0,1024,768),0, video::SColor(255,255,255,255), true);
//coloca a seta na tela
smgr->drawAll();
sprite1.play();
driver->endScene();
}
return 0;
}