Transparent Flip?
Displaying 1-6 of 6 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
cyrismustang

Hi, I'm new to Verge.

I'm not sure how Blitting works. I understand there's a transparency blit, which works fine when I load an image. However, when I try to use a flip blit, there's no more transparency. I can't quite figure out how to combine a flip and a transparency.

Anyone know? Thanks in advance.

Posted on 2010-09-15 09:46:14

Overkill

With FlipBlit(), I think you're supposed to draw onto onto another image before drawing to the screen. So load your image, make a "flipped" image (FlipBlit from the original onto a second image of the same size), and then use TBlit with that image.

Posted on 2010-09-15 10:32:52

cyrismustang

Thanks for the help, that worked.

Is there any explanation as to why the image cannot blit itself?

Posted on 2010-09-15 17:47:51

mcgrue

Do you mean you want to just stick it, once, on a place on the screen or map, and just have it "work"?

Or do you mean something else?

Posted on 2010-09-15 20:44:02

cyrismustang

No, I got the desired effect. However, I was wondering what a blit technically is, since an image that blits itself produces funny effects.

Posted on 2010-09-17 14:46:54

Overkill

A "blit" is just jargon for drawing a sprite or image. See http://en.wikipedia.org/wiki/Bit_blit. Just keep in mind even their process there isn't entirely accurate for what we do for software drawing, but it could give you a rough idea of how it works.

To be honest, Draw would be a lot more straightforward, but it's the weird terminology we've lived with.

At any rate, if you draw an image onto itself, you will definitely see weird effects, and this is because the source and destination are the same. So as it starts drawing to the destination image, the source image gets affected because they're the same image. The drawing algorithms generally only look at a few pixels at a time to save memory and time in software. So unless you draw an exact copy of the image with no translation/scaling/flipping/rotating, you're bound to see those sorts of effects.

But yeah, I've done drawing an image onto itself a few times, sometimes by accident. It's pretty weird!

Flipping or rotating-by-multiples-of-90s are I think some of the few effects you COULD do without needing to draw or create a secondary image, by doing it in-place. But Verge doesn't ever bother checking if the special case if src == dest since it's easy enough to just blit onto another image.

Posted on 2010-09-17 15:42:28 (last edited on 2010-09-17 15:45:27)


Displaying 1-6 of 6 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.