Could I set the greenish background to be transparent?
Yes, and there are a few different ways of doing so. The best way would be to modify your image offline, add an alpha layer if there's none, and use the green color to create the alpha mask (I suspect there are many tutorials on the net for doing this).
If you don't want to modify your resource offline, you can either use a custom shader that will output a fully transparent pixel (alpha = 0) if the color matches the green one or you can modify the texture when it's loaded (there's an event for that, listen for it, then gets the texture content with orxDisplay_GetBitmapData, modify it to set the alpha to zero when a pixel is green, and pushes the data back to the texture with orxDisplay_SetBitmapData).
Thanks iarwain, as I said in my former topic, I am developing some tools to use in a project, I am nearly finished with my scene editor (need to export for orx yet), but since most sprites on the internet are not parted nor transparent I am also creating a module to part those images for me.
Those are bad news for me, as I was creating several small images =p
Ok, back to coding, thanks again.
Since you said you wanted to see it, here it is. Still need some better UI and I need to find a way to import it the scene editor, but it parts sprites and let you add an alpha.
Here is the first partition mode. You tell the program where to begin and the size of the tiles:
Important notice: I found this image on google, I used it to test the program, I have no copyrights over it. It is from some of the Tales series games, so all the copyrights of this picture belong to Nanco.
Comments
Yes, and there are a few different ways of doing so. The best way would be to modify your image offline, add an alpha layer if there's none, and use the green color to create the alpha mask (I suspect there are many tutorials on the net for doing this).
If you don't want to modify your resource offline, you can either use a custom shader that will output a fully transparent pixel (alpha = 0) if the color matches the green one or you can modify the texture when it's loaded (there's an event for that, listen for it, then gets the texture content with orxDisplay_GetBitmapData, modify it to set the alpha to zero when a pixel is green, and pushes the data back to the texture with orxDisplay_SetBitmapData).
I'd go with them in this order.
My pleasure!
Those are bad news for me, as I was creating several small images =p
Ok, back to coding, thanks again.
Well, it's probably that, unless you render hundreds of objects at once, you won't really notice the difference on current hardware.
Unless you're targeting iOS/Android, in which case it's possible that batching will have some tangible performance impact.
My pleasure! Looking forward to seeing your editor.
Here is the first partition mode. You tell the program where to begin and the size of the tiles:
https://docs.google.com/file/d/0B0UdeUM9pB-nc0p2WnMzWmRCZU0/edit?usp=sharing
Second mode (the one used in the rest of the pictures), you tell how many partitions you want in each axis (in the case of this image, 12 per 8).
https://docs.google.com/file/d/0B0UdeUM9pB-ncXNaSWRfbHU5U1U/edit?usp=sharing
The result after the split:
https://docs.google.com/file/d/0B0UdeUM9pB-naGs2TmFsQW9kSDg/edit?usp=sharing
Exporting UI, you may click in the checkbox next to a image to add or remove it from the final image.
https://docs.google.com/file/d/0B0UdeUM9pB-ncXZIdnpyMWctS3c/edit?usp=sharing
Exporting UI after I clicked on one of the images, it selected the color of the pixel I clicked and set to the color it will assume to be the alpha = 0. Also I marked the checkbox that turn on the color to alpha option.
https://docs.google.com/file/d/0B0UdeUM9pB-nZFBQbnE2MGViak0/edit?usp=sharing
Final Result:
https://docs.google.com/file/d/0B0UdeUM9pB-nQm1ZR2tzX0VlZUE/edit?usp=sharing
Important notice: I found this image on google, I used it to test the program, I have no copyrights over it. It is from some of the Tales series games, so all the copyrights of this picture belong to Nanco.
I didn't think there were still old school sprite sheet using a color key for transparency out there!