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?
This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Does Lua Have A "xor" Function For Printing?
Started by GamerNebulae, 12 August 2013 - 09:30 AMPosted 12 August 2013 - 11: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?
Posted 12 August 2013 - 01: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.
Posted 12 August 2013 - 01:48 PM
You mean a loading bar? I believe someone has an API on it. I will try to find out who and show you.
Would be very nice.
Posted 12 August 2013 - 02: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
Posted 12 August 2013 - 02:21 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 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.
Posted 12 August 2013 - 02:24 PM
The bitwise xor? I just told you the bit api has one… And CraftOS has the bit api…
Posted 12 August 2013 - 02:36 PM
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.
Posted 12 August 2013 - 02:42 PM
I'm not sure what you mean. I never heard of something like "xor function for printing".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.
Posted 12 August 2013 - 02: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?
I've got one… Look on my programs thread…Would be very nice.You mean a loading bar? I believe someone has an API on it. I will try to find out who and show you.
Posted 12 August 2013 - 02:55 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?I've got one… Look on my programs thread…Would be very nice.You mean a loading bar? I believe someone has an API on it. I will try to find out who and show you.
Damn I looked on your website instead, thats it, yuppppp.
Posted 12 August 2013 - 02:56 PM
Yeh my webhost must have up and died or something, because my webspace has just gone and disappeared…Damn I looked on your website instead, thats it, yuppppp.