2D image motion

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
PlayG7SeveN
Posts: 22
Joined: Wed Apr 18, 2007 4:17 pm

2D image motion

Post by PlayG7SeveN »

Code: Select all

alt=devicemenu->getGUIEnvironment()->addImage(drivermenu->getTexture("media/alt.bmp"),
core::position2d<s32>(0,387));
I WANT THE PICTURE AND MOVED
(0,769)

HOW CAN I DO THIS ?
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

IGUIImage* imagename = guienv->addImage();
imagename->setPosition(); or imagename->setRelativePosition();
Fill in the arguments yourself. Don't forget to turn off capslock.
PlayG7SeveN
Posts: 22
Joined: Wed Apr 18, 2007 4:17 pm

Post by PlayG7SeveN »

http://www.youtube.com/watch?v=bvpHKi-JKnU


I WANT BECOME LIKE IN THE GAME.

I WANT SLIP THE PICTURE DOWN or UP ..
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Then just do as Dances suggested, or use draw2DImage in the main render loop (you have to draw the image each cycle then).
And please fix your CAPS LOCK key or I'll remove your posts.
PlayG7SeveN
Posts: 22
Joined: Wed Apr 18, 2007 4:17 pm

Post by PlayG7SeveN »

CAN YOU WRITE THIS CODE..I AM MORE INEXPERIENCED ...I STARTING NEW... CAN YOU SHOW AN EXAMPLE... and I DON'T KNOW MORE ENGLISH
PlayG7SeveN
Posts: 22
Joined: Wed Apr 18, 2007 4:17 pm

Post by PlayG7SeveN »

YOU CAN TELL but ME WITH code
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

Please stop using all capital letters. It looks like you're angry when you type with all capitals.

before your scene loop:

IGUIImage* alt = devicemenu->getGUIEnvironment()->addImage(drivermenu->getTexture("media/alt.bmp"),
core::position2d<s32>(0,387));

ITimer* timer =devicemenu->getTimer();

u32 time = 0;

in your scene loop:

time = timer->getTime();

while((timer->getTime() - time) <= (769 - 387))
alt->setPosition(core::position2d<s32>(0, time + 387));

... or something like that -.-
PlayG7SeveN
Posts: 22
Joined: Wed Apr 18, 2007 4:17 pm

Post by PlayG7SeveN »

Deleting intermediate files and output files for project 'saa - Win32 Debug'.
--------------------Configuration: saa - Win32 Debug--------------------
Compiling...
main.cpp
Compiling Irrlicht with Visual Studio 6.0, support for DX9 is disabled.
i:\program files\microsoft visual studio\myprojects\saa\anamenu.h(63) : error C2039: 'setPosition' : is not a member of 'IGUIImage'
j:\irrlicht1.3\irrlicht-1.3\irrlicht-1.3\include\iguiimage.h(17) : see declaration of 'IGUIImage'
Error executing cl.exe.

saa.exe - 1 error(s), 0 warning(s)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Use setRelativePosition (const core::rect< s32 > &r) and note that you have to define the image rectangle, not just the starting position.
PlayG7SeveN
Posts: 22
Joined: Wed Apr 18, 2007 4:17 pm

Post by PlayG7SeveN »

Code: Select all

alt->setRelativePosition(core::rect<s32>(0, time + 387));
I TESTED THIS

I TOOK ONE SUCH MISTAKE ..

--------------------Configuration: saa - Win32 Debug--------------------
Compiling...
main.cpp
Compiling Irrlicht with Visual Studio 6.0, support for DX9 is disabled.
i:\program files\microsoft visual studio\myprojects\saa\anamenu.h(63) : error C2665: 'rect<int>::rect<int>' : none of the 5 overloads can convert parameter 1 from type 'const int'
Error executing cl.exe.

main.obj - 1 error(s), 0 warning(s)
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

hybrid wrote:Use setRelativePosition (const core::rect< s32 > &r) and note that you have to define the image rectangle, not just the starting position.
Please read the previous answers before 'asking' a next question. And PLEASE don't use capitals.
rooly
Posts: 224
Joined: Tue Oct 25, 2005 4:32 pm
Location: Louisiana, USA, backwater country
Contact:

Post by rooly »

When banks compete, you win.
When ISPs compete, you win.
When electronics retailers compete, you win.
When governments compete...you get drafted.
Post Reply