Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Risen Phoenix on July 20, 2006, 01:38:00 pm

Title: [83+ xLIB] and, or, xor
Post by: Risen Phoenix 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
Title: [83+ xLIB] and, or, xor
Post by: Liazon 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
Title: [83+ xLIB] and, or, xor
Post by: Dragon__lance on July 20, 2006, 02:06:00 pm
hehehe,check out xlib guru! :)smile.gif
Title: [83+ xLIB] and, or, xor
Post by: Liazon 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.