DrawImageInsideRect?
BlitzMax Forums/BlitzMax Beginners Area/DrawImageInsideRect?
| ||
Is there any sort of command that is like DrawImageRect but allows you to specify the start draw as well as the size instead of only being able to start from 0,0? Something like:- DrawImageRect(image:TImage, X, Y, StartX, StartY, EndX, EndY, frame) Same sort of theory when you're setting texture coordinates in 3D from a texture. |
| ||
If you use OO you can access the TGLImageFrame structures "Draw" which allowes that ... => graphic.frames[frame].draw ( ... ) |
| ||
I'm sure you could rig something up using SetViewPort. |
| ||
Yikes that sounds quite complex. Do you have any code example? :) The reason is that I'd like to be able to later use the same numbers as 3D texture coordinates with UV mapping. Instead of splitting up my images into separate chunks/anim image. |
| ||
Here you goFunction DrawImageRect2(img:TImage, x#, y#, rx#, ry#, rw#, rh#) SetViewport x, y, rw, rh DrawImage img, x - rx, x - ry SetViewport 0, 0, GFX_WIDTH, GFX_HEIGHT End Function |
| ||
Eikon, you are my hero. Would using SetViewPort be suitable for realtime use? |
| ||
Thanks, ENAY :) I did some testing and B2D's DrawImageRect took an average of around 15ms with a test image, while BMax was around 10ms with the new DrawImageRect2. I don't think you'll have any speed problems. |