Does Lua Have A "xor" Function For Printing?
Started by GamerNebulae, Aug 12 2013 10:30 AM
10 replies to this topic
#1
Posted 12 August 2013 - 10:30 AM
Hello everyone!
I am working on my Nebulae API. It's a progress bar. Is there a xor function for printing stuff so the text blends in with the background?
I am working on my Nebulae API. It's a progress bar. Is there a xor function for printing stuff so the text blends in with the background?
#2
Posted 12 August 2013 - 12:45 PM
You mean a loading bar? I believe someone has an API on it. I will try to find out who and show you.
#4
Posted 12 August 2013 - 01:16 PM
If you mean a bitwise xor, the bit api includes one (bit.bxor, IIRC). But I'm not sure how you plan to implement blending, since you can't combine colors.
If you need a logic xor (for if statements for example), lua doesn't have one. But, there's a few ways to get it. If you only use booleans, the easiest way is:
If you need a logic xor (for if statements for example), lua doesn't have one. But, there's a few ways to get it. If you only use booleans, the easiest way is:
if bool1 == not bool2 then end
#5
Posted 12 August 2013 - 01:21 PM
MysticT, on 12 August 2013 - 01:16 PM, said:
If you mean a bitwise xor, the bit api includes one (bit.bxor, IIRC). But I'm not sure how you plan to implement blending, since you can't combine colors.
If you need a logic xor (for if statements for example), lua doesn't have one. But, there's a few ways to get it. If you only use booleans, the easiest way is:
If you need a logic xor (for if statements for example), lua doesn't have one. But, there's a few ways to get it. If you only use booleans, the easiest way is:
if bool1 == not bool2 then end
I don't need the logic xor. My dad used to program as well and he told me about the function, but I don't think CraftOS has that function.
#6
Posted 12 August 2013 - 01:24 PM
The bitwise xor? I just told you the bit api has one... And CraftOS has the bit api...
#7
Posted 12 August 2013 - 01:36 PM
MysticT, on 12 August 2013 - 01:24 PM, said:
The bitwise xor? I just told you the bit api has one... And CraftOS has the bit api...
Sorry, I was a little vague there. I didn't mean the bitwise xor. I meant the xor function for printing stuff. That would make my life so much easier at the moment, but CraftOS doesn't have that. It makes the text the color of the background. You would need a rather difficult construction for that at the moment.
#8
Posted 12 August 2013 - 01:42 PM
GamerNebulae, on 12 August 2013 - 01:36 PM, said:
Sorry, I was a little vague there. I didn't mean the bitwise xor. I meant the xor function for printing stuff. That would make my life so much easier at the moment, but CraftOS doesn't have that. It makes the text the color of the background. You would need a rather difficult construction for that at the moment.
Now, if you want to set the text color to the same as the background, you don't need any xor, and or whatever. You only need to know the background color (easy if you are setting it), and set the text color to the same one.
#9
Posted 12 August 2013 - 01:53 PM
You're going to have to explain more than "xor function for printing stuff"... This is a term that I've never heard of in all my years of programming, and haven't been taught at uni (suspecting because it doesn't exist)... Maybe your dad can explain it better?
GamerNebulae, on 12 August 2013 - 12:48 PM, said:
I've got one... Look on my programs thread...
#10
Posted 12 August 2013 - 01:55 PM
theoriginalbit, on 12 August 2013 - 01:53 PM, said:
You're going to have to explain more than "xor function for printing stuff"... This is a term that I've never heard of in all my years of programming, and haven't been taught at uni (suspecting because it doesn't exist)... Maybe your dad can explain it better?
GamerNebulae, on 12 August 2013 - 12:48 PM, said:
I've got one... Look on my programs thread...
Damn I looked on your website instead, thats it, yuppppp.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











