Topic: How to get a texture from a large tile map
i use mesh and want to use only a small part of a big image
how to do this
i can make this with texture = driver.getTexture("big pix.bmp")
BMAX 1.30 + Irrlicht wrapper 1.4.2
GMan's Mods & Stuff → Programming → How to get a texture from a large tile map
i use mesh and want to use only a small part of a big image
how to do this
i can make this with texture = driver.getTexture("big pix.bmp")
greetings i will try to work out the sequence for you tonight, but if you want to try it on your own you will need to:
- load the image into an IImage
- then create a new IImage from a part of that image
- then addTexture using the part image.
all the functionality you need is on the IVideoDriver object.
Yes, good idea
have you an exeple for copiing IIMAGE to another ?
I don't know the IImage can you explain this fucnction?
big thanks...
and big thanks for the BMAX wrapper, is very useful and powerful !
this is untested but should get you where you want to go:
' example of pulling first 120x120 from a larger image
Local big_image:IImage = driver.createImageFromFile("big pix.bmp")
Local small_image:IImage = driver.createImageFromImagePart(big_image, _POSITION2DI(0,0), _DIMENSION2DI(120,120))
Local texture:ITexture = driver.addTextureFromImage("small_image_name", small_image)
Compile Error
Identifier 'createImageFromImagePart' not found
which version of the mod are you using?
latest : Irrlicht Mod for Irrlicht v1.4.2 + BMAX v1.30
this work now (?) probaly i used an old version...
ok
but the new answer is :
driver.addTextureFromImage("small_image_name", small_image)
i don't understand why "small_image_name" is redéfined, it was initialized before too.
?
that is creating an ITexture from an IImage that you can then use wherever you need the texture. "small_image_name" is just a text name for the texture and should be replaced by whatever you would like to call it.
GMan's Mods & Stuff → Programming → How to get a texture from a large tile map
Powered by PunBB, supported by Informer Technologies, Inc.