Author Topic: [83+ xLIB] and, or, xor  (Read 2394 times)

0 Members and 1 Guest are viewing this topic.

Risen Phoenix

  • Guest
[83+ xLIB] and, or, xor
« on: July 20, 2006, 01:38:00 pm »
In Xlib and some other libraries, some commands have and,or,xor options.( ex: Xlib sprite command) What do they mean and how do you use them?

Thanks in advance :)smile.gif

Liazon

  • Guest
[83+ xLIB] and, or, xor
« Reply #1 on: July 20, 2006, 01:44:00 pm »
To be quick and simple:

AND
oldscreen-: 1100
sprite------: 1010
newscreen: 1000

OR
oldscreen-: 1100
sprite------: 1010
newscreen: 1110

XOR
oldscreen-: 1100
sprite------: 1010
newscreen: 0110

0 = pixel off/white
1 = pixel on/black

oldscreen AND/OR/XOR sprite = newscreen

Dragon__lance

  • Guest
[83+ xLIB] and, or, xor
« Reply #2 on: July 20, 2006, 02:06:00 pm »
hehehe,check out xlib guru! :)smile.gif

Liazon

  • Guest
[83+ xLIB] and, or, xor
« Reply #3 on: July 21, 2006, 12:34:00 am »
As for how you use them well, getting masked sprites is what first comes to my mind.  Basically you have to AND the sprite mask to the screen so that it clears the area that the sprite takes up.  Then you can XOR/OR the actual sprite into the blank area so the sprite does look messed up/ see-through if you just used one operation.