2d Sprite movment!

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
FAT_BOT
Posts: 6
Joined: Sat Mar 19, 2005 1:48 am
Location: Australia

2d Sprite movment!

Post by FAT_BOT »

How would i go about doing this?
Guest

Post by Guest »

you could do it in several ways:

first way: http://irrlicht.sourceforge.net/tut006.html

or better way (and thats the way i suggest you): use flat 3d objects (a flat rectangle) and make a 2d view out of a 3d camera (disable Z). then apply your sprite as a texture to the flat object and turn off mipmapping. that way you have 3D that looks like perfect 2D but you have the advantage of:

1. i think its a lot faster (more fps)
2. you can move, scale, rotate, blend, color and even more (which could not be done with the 2D elements or way harder)
3. you can have different layers of sprites more easier
4. the camera handling is easier, too
5. i dont think its harder than real 2D, i even think that its easier

as you see, 3D -> 2D seems to be the better way.

if you choose way 1, you have to set the coordinates of the sprite yourself (rect<int>(startx, starty, endx, endy))

if you choose way 2, you just have to call: YourSprite->setPosition(vector3df position)


its your decision :)
Conquistador
Posts: 340
Joined: Wed Sep 28, 2005 4:38 pm
Location: Canada, Eh!

re:

Post by Conquistador »

Search function.

Tutorials.

Go nuts.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

...and lets not be forgetting Emil's 2d sprite class-
http://www.irrforge.org/index.php/Playi ... h_Irrlicht
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Guest

Post by Guest »

i think emils class is basically the thing i was talking about (3D as 2D) so its a good idea to take a look at it and get yourself an idea on how to do it.

if you do not like custom scene nodes or you dont understand them, dont worry, you can do it without them, too :)
Dandrolvorn
Posts: 15
Joined: Thu Apr 20, 2006 4:31 pm

Post by Dandrolvorn »

Hello ;)

The link to irrforge is down, has anyone another link to this class?

greets Dandro
Post Reply