Blockland Files > Add-Ons

Image2Brick

Pages: (1/4) > >>

jes00:


(Took about 5 seconds)




(Example of background color selection and background exclusion)


(Don't do this. I don't remember how long it took, but it was over 2 hours)



Cons:

* Entirely in TorqueScript, unlike other Image2Brick mods.
* Probably slower than other Image2Brick mods.
* Can't close GUI, open the console, or put your mouse or practically anything else over the image while the mod is running.
* Estimated time gets less accurate the bigger the build is.
Other things:

* Any size image works.
* Easily pause and resume the build.
* Works with any brick.
* There are small red and blue lines as X and Y indicators on the image that represent the build's progress.
* The build starts in the lower left-hand corner and builds up/forward row by row.
* You can click and drag on the image to resize it.
* Optional proportional image scaling(only works with manual input, not dragging).
* If the image has transparency, you can change the background color.
* If you select a transparent background color, the correct transparent brick color will be selected.
* Re-color the image in the GUI(ish).
* You can build the image upright or flat on the ground.
* If you select a background color and then exclude the background, then the most transparent color in the server will be selected to replace the background color(if you have it set to tall). If flat is selected then the background colored bricks won't be planted at all.
File selector module by Nexus.

The keybind to open the GUI is under Options > Controls > Building.

Happy spamming.

https://www.dropbox.com/s/6sscm425c9w930s/Client_Image2Brick.zip?dl=1

Nicepoint:

Oh damn

Dilbert:

how do you read image files from torquescript? does it load it as a bitmap in the game and then read the pixels?

failbros2:

inb4 even more people make even more research img2brick

jes00:


--- Quote from: Dilbert on June 17, 2019, 01:47:35 PM ---how do you read image files from torquescript

--- End quote ---
If you make a GuiBitmapCtrl then you can get individual pixel colors from it with .getPixelColor(x, y); but the y coordinate is actually the coordinate relative to the Blockland window instead of the GuiBitmapCtrl(or something like that), so I made this function to fix it. It's also kind of trash because if the pixel is obstructed by anything(if it's something outside of the Blockland application then it's fine) then it'll get the color of the thing obstructing it.

--- Code: ---function guiBitmapCtrl::getRealPixelColor(%obj, %x, %y)
{
%realY = -2 * getWord(%obj.getScreenPosition(), 1);
%realY += getWord(getRes(), 1) - %y;
%realY--;

return %obj.getPixelColor(%x, %realY);
}

--- End code ---

--- Quote from: failbros2 on June 17, 2019, 01:50:45 PM ---inb4 even more people make even more research img2brick

--- End quote ---
Real images are so big that they take forever and ever to do.

Pages: (1/4) > >>

Go to full version