how to scale an 2dimage?

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
warren

how to scale an 2dimage?

Post by warren »

hi,
i´m using iTexture to load an image from a file, and then draw2dimage to render it. But, no one version of this method allow to scale the image before render. I`d been searching on the forum for a similar question and for a relationed method on the reference guide... could somebody help me??

TNX!!
TreyOne Games
Posts: 18
Joined: Wed Dec 14, 2005 12:44 am

Post by TreyOne Games »

i believe that is covered in the tut's...ill check when i get a chance :?
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

u can't scale a 2d image! irrlicht doesn't support this.
But you could applay the image as a texture to a mesh and scale the mesh.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
hybrid

Post by hybrid »

What about

Code: Select all

        //! constructor
        CImage(IImage* imageToCopy,
                const core::position2d<s32>& pos, const core::dimension2d<s32>& size);
And there's also some resizing in CColorConverter. Nothing accelerated, though. Otherwise this would be done by textures which have to be of special sizes, yet. So in general not useful for this purpose.
warren

Post by warren »

well...its hard to believe that there is no anymethod to do something so basic, but, right is that Irrlicht is specialized on 3d design...

I cant find CImage interfaze on the reference, because i´m using SDK 0.7 (dont ask me why :roll: )
So, i´ll try to do it on a planar mesh and scale it.

Thanks for help me!!
grettings!!
Guest

Post by Guest »

Check out emils sprite class on irrforge wiki - it can do basically what you want (great smooth scaling/rotation at screen depth) which can be used for anything 2D. It uses relative scaling with floats compared to irrlichts ints which is why the scaling sucks out of the box on irrlicht.
Post Reply