draw2Dimage scale image

Discussion about Irrlicht's Java wrapper
Post Reply
gbrinon
Posts: 11
Joined: Tue May 19, 2009 3:02 pm

draw2Dimage scale image

Post by gbrinon »

Hi,

I'm trying to display a splash screen whitch could be scaled according to the resolution of the irrlicht device.

When i try to use the draw2Dimage with recti in parameters, the image repeats itself in the square i try to define. I've found nowhere some kind of flag whitch could specify "scale image"

Can someone show me how i could display an image whitch has a resolution of 640x480 (for example) scaled in a square of 800x600.

Thanks a lot :)
Guillaume ... hopes HEMERA project will be finished before world's end ;)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

And you need it for jIrr? Otherwise, Irrlicht offers the proper draw2dImage method - simply take one of the others that do exist. Don't know if all of them are available in jirr, though.
gbrinon
Posts: 11
Joined: Tue May 19, 2009 3:02 pm

Post by gbrinon »

Actually i try to display a splash screen in a logon screen.
The game is designed to support resolutions from 800x600 to 1280x1024.
(I have an eeePC and a desktop computer :oops: )

I tried first to make it with the addImage of the IGUIEnvironment but i found no wayto scale the image.

Then i changed the way to display this splash screen and put the draw2dImage method in the draw loop.

There are lots of draw2dImage i tried maybe 5 or 6 of them, but in the parameters none of it seems to accept some kind of : "boolean scaleThisDamnImage".

I've found no real documentation on Jirr, the best I could do was to make the image repeats itself :?

Someone had the same problem ? Or maybe there is a completely different way to display a splash screen i'm not narrow-minded (i think)
Guillaume ... hopes HEMERA project will be finished before world's end ;)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Just check the API docs of Irrlicht for more documentation - the methods should behave the same. The things you're looking for are sourceRect, destRect, and clipRect. source defines the area used from the original image, destRect defines the position and size of the destination image, which is optionally clipped against the clipRect.
gbrinon
Posts: 11
Joined: Tue May 19, 2009 3:02 pm

Post by gbrinon »

Thanks, i'll check that, i think i've already tried, but maybe i can do better :)

EDIT :

It works, i had just misunderstood the meaning of each parameters :oops:

Thanks
Guillaume ... hopes HEMERA project will be finished before world's end ;)
Post Reply