Painting on glass fixed, mostly. It block's light from entering, and doesn't connect, as it technically is no longer 'glass' but soon I will work on these issues.
So a LOT of thought went into designing my color picker(not counting the math), and since Minecraft has a massive pixel upscale on the gui by default, My gui has ran into a problem, if the center color gradient was any smaller, you would lose pixels, and consequently, lose some of the color choices, but, currently, the window is too large on some people's screens.
Next I am going to be working on moving things around on the menu to see if I can find a better configuration, but if any of you have ideas on a god way to do this, let me know.
This is technical, for modders:
I have been asked a couple of times, so i will share the math involved in making the smoothly transitioning color gradient, that accepts a starting color for it's generation. I do not use the cheap and inaccurate method of generating a simple vertical gradient and overlaying a grayscale png over it, plus grabbing the resulting color displayed would not be predictable on all OS's.
Here is How I do it:
First I generated a color bar that will generate all the pure color interactions of the other 2 pure colors. 3 colors, in all possible pairs, makes 6 possible interactions. With each color being 256 colors, that makes 1536 colors in the color bar.
int pix[] = new int[1536];
//Holds the values for the respected pixel
int red, blue, green;
//counter variable
int locx;
for (int y = 0; y < 6; y++) {
for (int x = 0; x < 256; x++) {
switch (y) {
case 0:
red = 255;
blue = x;
green = 0;
break;
case 1:
blue = 255;
red = 255 - x;
green = 0;
break;
case 2:
blue = 255;
green = x;
red = 0;
break;
case 3:
green = 255;
blue = 255 - x;
red = 0;
break;
case 4:
green = 255;
red = x;
blue = 0;
break;
case 5:
red = 255;
green = 255 - x;
blue = 0;
break;
}
//This is the simplified literal representation of how pixel values are stored in each int for 24-bit rgb.
//in 32 bit rgb(transparency), the opacity is 256 numbers offset to: opacity * 16777216
pix[locx++] = red * 65536 | green * 256 | blue;
}
}
After you do that, write that pixel array to a BufferedImage, and keep it around. You only have to generate the color bar once, and keeping the original allows you to grab pixel data directly, and not from the frame buffer, which would be unpredictable, as each OS could be handling and modifying the frame buffer differently.
The Actual Gradient is the only really advanced part, at least as far as wrapping your head around the math.
for (int y = 0; y < 256; y++) {
for (int x = 0; x < 256; x++) {
//the 'startColors' variables are set by clicking on the color bar, i take the adjusted coordinates
//and pull out the original pixel that was located at that coordinate. This allows everything to work
//exactly as intended, even if your video card or OS [u][i]incorrectly[/i][/u] renders it's portion of the framebuffer.
pix[locx++] = (startRed + ((255 - startRed) * y / 255)) * x / 255 * 65536 | (startGreen + ((255 - startGreen) * y / 255)) * x / 255 * 256 | (startBlue + ((255 - startBlue) * y / 255)) * x / 255;
}
}
yep! That's it, 3 lines, only 1 if you don't count the loops.
I'll break it down a bit:
thisPixelRedValue = (startRed + ((255 - startRed) * y / 255)) * x / 255
Start by finding how close this number is to it's maximum, 255, and then multiply it by the percentage of the vertical location of this pixel. I then offset this value by adding how much of this color was in the colorbar choice. Finally I multiply it by the percentage of the horizontal location, shading horizontally as well.
It's a little bit big on my screen, but I can still click the button. Maybe do a rectangular colour picker? (Says he who has no idea how to code, lol)
Thank you for the speedy update. )
I am not sure how to do this, while keeping the colors transitioning smoothly and without losing pixel precision by vertically squishing the main gradient. I think I am going to center the gradient, and put all text and buttons to the side, so the color values can still be read and the close button can be reached, and in the worst case, you lose a few colors along the bottom on the gradient.
New reworked gui that better takes advantage of available space. Now everyone should be able to at least see the color codes and the close button.
Also I added a built in calculator that will tell you roughly how much dye a paint selection will consume.
NICE! Looks good
I have a request, can you add a preview box in that empty space that holds your last selection? Sometimes it is hard to tell exactly the color you chose.
I have a request, can you add a preview box in that empty space that holds your last selection? Sometimes it is hard to tell exactly the color you chose.
Done.
Just redownload and replace the one in your mods folder.
Also, all the recent changes were just applied to the 1.3.2, including some bug fixes. I will not do this often, as doing stuff twice isn't my idea of fun. I will occasionally convert the 1.4.2 back to 1.3.2 to update it, as long as there still is continued interest If you want fast updates, use 1.4.2.
I am creating a mod spotlight for this awesome mod! So stay tuned for it!
Sweet
Guys, if you are interested, I just released a mod I made for myself a long time ago. I Quickly rewrote it for 1.4.2 and I think some of you might like it. When anything living takes damage, the damage they took bounce off their heads with a cool little effect. You can get to that forum release here.
Guys, if you are interested, I just released a mod I made for myself a long time ago. I Quickly rewrote it for 1.4.2 and I think some of you might like it. When anything living takes damage, the damage they took bounce off their heads with a cool little effect. You can get to that forum release here.
Thanks, I basically made it out of necessity when testing the damage output of the paint gun, back when it was still PaintAnyBlock, maybe others will find it useful as well.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumJust redownload for the updated version.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNo, i got called to active duty(Reserve). So i am glad it didn't 'die'! xD
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumAnd we have 16,777,216 different colour choices in this mod. That is a lot of colors for you to be a fan of
Can't tell if sarcasm...
Also can't tell if sarcasm...
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNext I am going to be working on moving things around on the menu to see if I can find a better configuration, but if any of you have ideas on a god way to do this, let me know.
This is technical, for modders:
I have been asked a couple of times, so i will share the math involved in making the smoothly transitioning color gradient, that accepts a starting color for it's generation. I do not use the cheap and inaccurate method of generating a simple vertical gradient and overlaying a grayscale png over it, plus grabbing the resulting color displayed would not be predictable on all OS's.
Here is How I do it:
First I generated a color bar that will generate all the pure color interactions of the other 2 pure colors. 3 colors, in all possible pairs, makes 6 possible interactions. With each color being 256 colors, that makes 1536 colors in the color bar.
int pix[] = new int[1536]; //Holds the values for the respected pixel int red, blue, green; //counter variable int locx; for (int y = 0; y < 6; y++) { for (int x = 0; x < 256; x++) { switch (y) { case 0: red = 255; blue = x; green = 0; break; case 1: blue = 255; red = 255 - x; green = 0; break; case 2: blue = 255; green = x; red = 0; break; case 3: green = 255; blue = 255 - x; red = 0; break; case 4: green = 255; red = x; blue = 0; break; case 5: red = 255; green = 255 - x; blue = 0; break; } //This is the simplified literal representation of how pixel values are stored in each int for 24-bit rgb. //in 32 bit rgb(transparency), the opacity is 256 numbers offset to: opacity * 16777216 pix[locx++] = red * 65536 | green * 256 | blue; } }After you do that, write that pixel array to a BufferedImage, and keep it around. You only have to generate the color bar once, and keeping the original allows you to grab pixel data directly, and not from the frame buffer, which would be unpredictable, as each OS could be handling and modifying the frame buffer differently.
The Actual Gradient is the only really advanced part, at least as far as wrapping your head around the math.
for (int y = 0; y < 256; y++) { for (int x = 0; x < 256; x++) { //the 'startColors' variables are set by clicking on the color bar, i take the adjusted coordinates //and pull out the original pixel that was located at that coordinate. This allows everything to work //exactly as intended, even if your video card or OS [u][i]incorrectly[/i][/u] renders it's portion of the framebuffer. pix[locx++] = (startRed + ((255 - startRed) * y / 255)) * x / 255 * 65536 | (startGreen + ((255 - startGreen) * y / 255)) * x / 255 * 256 | (startBlue + ((255 - startBlue) * y / 255)) * x / 255; } }yep! That's it, 3 lines, only 1 if you don't count the loops.
I'll break it down a bit:
thisPixelRedValue = (startRed + ((255 - startRed) * y / 255)) * x / 255
Start by finding how close this number is to it's maximum, 255, and then multiply it by the percentage of the vertical location of this pixel. I then offset this value by adding how much of this color was in the colorbar choice. Finally I multiply it by the percentage of the horizontal location, shading horizontally as well.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI am not sure how to do this, while keeping the colors transitioning smoothly and without losing pixel precision by vertically squishing the main gradient. I think I am going to center the gradient, and put all text and buttons to the side, so the color values can still be read and the close button can be reached, and in the worst case, you lose a few colors along the bottom on the gradient.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumAlso I added a built in calculator that will tell you roughly how much dye a paint selection will consume.
NICE!
I have a request, can you add a preview box in that empty space that holds your last selection? Sometimes it is hard to tell exactly the color you chose.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumDone.
Just redownload and replace the one in your mods folder.
Also, all the recent changes were just applied to the 1.3.2, including some bug fixes. I will not do this often, as doing stuff twice isn't my idea of fun. I will occasionally convert the 1.4.2 back to 1.3.2 to update it, as long as there still is continued interest If you want fast updates, use 1.4.2.
Uploaded with ImageShack.us
-
View User Profile
-
View Posts
-
Send Message
Curse Premium-
View User Profile
-
View Posts
-
Send Message
Curse Premium-
View User Profile
-
View Posts
-
Send Message
Curse PremiumSweet
Guys, if you are interested, I just released a mod I made for myself a long time ago. I Quickly rewrote it for 1.4.2 and I think some of you might like it. When anything living takes damage, the damage they took bounce off their heads with a cool little effect. You can get to that forum release here.
-
View User Profile
-
View Posts
-
Send Message
Curse Premium-
View User Profile
-
View Posts
-
Send Message
Curse PremiumLove it, thanks.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumNo Problem
I love it
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThanks, I basically made it out of necessity when testing the damage output of the paint gun, back when it was still PaintAnyBlock, maybe others will find it useful as well.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumTry it and see, i may need to add a custom renderer for custom textures tho.