DrawImageArea etc...
BlitzMax Forums/BlitzMax Programming/DrawImageArea etc...
| ||
Hi, How do these sound for additions to max2d: DrawSubImage image,x#,y#,sx#,sy#,sw#,sh#,frame=0 DrawSubImageRect image,x#,y#,w#,h#,sx#,sy#,sw#,sh#,frame=0 ...where sx,sy,sw,sh are source image coords, so in total there's... DrawImage DrawImageRect DrawSubImage DrawSubImageRect ? |
| ||
I think so. Will it take the current blend method into account, or just plop it on with a solidblend? Hmmm... how about PasteImage and PasteImageRect? |
| ||
They look like they may be useful. Would they be effectively converting the sx,sy etc., to uv coords under the hood? |
| ||
Hi, > Would they be effectively converting the sx,sy etc., to uv coords under the hood? Yes, they'd be official versions of the current DrawImageArea style routines floating around. |
| ||
That would surely be a good additional to have it as integrated part without the requirement to get one of the floating around solutions. |
| ||
sounds great! |
| ||
Mark, Thats definitely a great addition.. of course that means i'll have some changes to make lol |
| ||
Looks good, would allow people to easily do things like particle systems on a single texture and spritesheets etc. While you're at it how about applying an image to a polygon .... DrawImagePolygon? And what about being able to adjust the individual vertices of the destination shape? With `rect` you have axis-aligned rectangles, but what about `Quad` versions which let you define 4 sets of 2 coordinates so that images can be easily warped? Also how about defining per-vertex colors, and allowing drawing of smooth shaded non-textured polygons? I think these would open lots of possibilities to many people. |
| ||
Sounds fine to me. |
| ||
I would like this. |
| ||
how about this function?? DrawImageStretch? |
| ||
I like it! Good! |
| ||
DrawTexturedPoly(Image:TImage, xyuv#[], ...) This would be great! |
| ||
isnt DrawImageStretch the same thing as DrawSubImageRect? |
| ||
i dont know.. :D |
| ||
drawimagestretch is the ability to place vertices Thats what I would like to see in Blitzmax |
| ||
I like it. It was one of the things I missed from Max. (drawsubimage that is) |
| ||
The SubImage stuff would be a nice addition, but I've always wanted what Zeke's posted there as part of Blitz. (I'd like the texture to adjust so it's not split diagonally, though, ie. so it's interpolated correctly between all four corners.) |
| ||
Any additions to max2d are welcome. |
| ||
I too would welcome what Zeke posted inbuilt too, with the addition that BlitzSuupport suggested and also the ability to have more than 4 vertices to work with, if we had 6, 8 etc we could do a lot of fancy things with it :) |
| ||
in my unofficial max2d module it works great in opengl (no splits or anything like that) |
| ||
To be able to define an irregular quad where you can position each of the four corners separately to make the image warp, without a triangle split wrongly across the middle, you can instead define it as a `triangle fan`, centered at the averaged center position (which has to be recalculated each time you move the corners). You'd then have 4 separate triangles per image instead of 2, but it would look right. |
| ||
The SubImage stuff would be a nice addition, but I've always wanted what Zeke's posted there as part of Blitz. (I'd like the texture to adjust so it's not split diagonally, though, ie. so it's interpolated correctly between all four corners.) Well, currently the Tquad in Max2D is private.. if that is made public it would be possible to adjust the coordinates of the vertices using: Method SetCoords(tx0#,ty0#,tx1#,ty1#,tx2#,ty2#,tx3#,ty3#) What is the purpose of setting areas private? ultimately it just prevents the more advanced users from tweaking Max2D unless they make their own modified version of Max2D |
| ||
Add an optional "x,y" handle point to those routines and I'm in heaven. :) Would come in handy working with tiles, sprites, etc, etc. The default would be 0,0 (top left corner). |
| ||
But please stablize any problems/pitfalls with the projection matrix first. ;) |
| ||
I don't think its possible actually.. no matter what, when you scale images containing single pixels / pixel width lines they will be impacted, particularly when moving. |
| ||
Sounds cool. Not sure that they'd completely replace the single surface mods floating about as they at least store the UV coords in arrays for each frame so there's no extra calculations each time you draw the image. I don't imagine that would happen with these new commands as the sx/sy values would be designed to handle any values, but still welcome additions I'd say. |
| ||
there's no extra calculations each time you draw the image. Well, you can say that about all of the default Max2D commands - they are designed to make things generic and easy to do, but not perhaps to do them as efficiently as you could if you coded something yourself for a specific task. As you say, new features are always welcome, but at the same time, there's always plenty of room to roll your own :-) |
| ||
Exactly, however, with the current Max2D implementation restrictions we have to either duplicate the code or create a whole new branch to make those tweaks. |
| ||
re: Proj matrix The artifacting between lines due to tiles, etc, is not what I'm worrying about. I'm more concerned with proper aspect support going from a wide virtual to non wide physical and vice versa. Or is that already fixed? |
| ||
Sounds like a great addition to add. I`m looking forward to it. Having official versions of these things is very handy as they are so easily missed in the forums which is a shame as there is some nice stuff out there. Jason. |
| ||
MGE, No I don't think letterboxing is built into that.. hmmm... I wonder how hard that would be to implement. |
| ||
I agree that any addition to Blitzmax is welcome as well. Thank you for all your efforts, Mr. Sibly. It's the work of a genius really. |
| ||
If you're taking requests for the Max2D module, I'd like to see a MOD2xBLEND mode. Should be easy enough to add, and would be really useful. :) |
| ||
What would the modulate be used for in terms of `effects` in a game? |
| ||
ImaginaryHuman wrote: What would the modulate be used for in terms of `effects` in a game? I'd use it for some dynamic lighting/shadow effects, but I don't mind if you want to use it for some other effects instead. |
| ||
Another raised hand for mod2x here... its usedful for lighting mostly, otherwise you end up with washed out graphics if you try to put both light and shadow on in separate passes. |