by fzammetti » Sep 2, 2003 @ 3:22am
Pejo: I just tried your sample finally... All I get is a blank screen. I do notice that you used GD 2.03 for it, I tried it under 2.04. Perhaps a difference in the versions?
Johan: I have to admit I didn't understand your suggestion to try it. If I was getting it at all though, I suspect it won't work for me.
What I'm basically trying to do is this... If you imagine a driving game with trees on the side... as you go down the road, trees in the distance get larger and larger. It's essentially that kind of a thing.
However, they need to not only get larger, but they also need to diverge from a center point, moving outwards towards the edge of the screen (or in my case, a smaller 200x200 area).
To do this in PF, I could simply create a rect of say 0,0,10,10. I could then easily calculate the coordinates to center this rect on the screen, then tell PF to stretch blit to that rect the image of my tree. Because I know before the blit that the final image will be 10x10 and will be a complete version of my image (it'll look horrible of course if it's much larger than that in reality), it's easy to calculate what it's x/y coordinate should be as it moves outward.
Then, I can simply expand my rect to say 0,0,12,12 and then 0,0,14,14 and so on, and move the x coordinate of the blt left or right by the same number of pixels so they will diverge as they expand. Fairly simple.
The only way I can see to do this in GD is to myself calculate the size of the image with each percentage increase and calculate my x/y coordinates based on that. That could be slightly indeterminant though because depending on the percentages I pick, the outcomes may not be integers, and I have to take that into effect. Contrast that with just specifying an absolute rect size, which can easily always be integer, and always even for that matter, to make location calculations that much easier.
Nonw of that shouldn be a terribly big deal to implement in GD, and I'm going to go off and do so now, but that's where I was making a feature suggestion... The PF stretch blt approach makes this trivial and is a pretty powerful thing to have and I think would make a nice addition to GD as well. I don't think it should replace what you already have, but perhaps could supplement it nicely.
Thanks to every for the suggestions!
...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"