Forum
CS2D General New Tileset: Magenta non-transparent?New Tileset: Magenta non-transparent?
12 replies 1
Also, is it a bmp/png?
Did you try deleting all of the tiles but save the transparent tile?
Are you a genius? (Joking.)
I'm using VB.Net so maybe someone can help me out? The code for saving the image is simple:
imgTileset.Save(sFile, Imaging.ImageFormat.Bmp)
But that is probably not the cause.
This is the code used to create the transparent tile:
Dim newBitmap As System.Drawing.Bitmap = New Bitmap(iSize, iSize, Drawing.Imaging.PixelFormat.Format24bppRgb)
Dim g As Graphics = Graphics.FromImage(newBitmap)
g.FillRectangle(New SolidBrush(Color.Magenta), New Rectangle(0, 0, iSize, iSize))
Tile.Image = newBitmap
As you can see it's using a bitmap with the 24-bit RGB format and filling it with Color.Magenta
Short of posting all of the source I'm not sure what else to do. I may just go ahead and release it as open source, but there are still bugs I need to work out before it is really ready for release. I'm currently having issues with not being able to overwrite an open tileset as well as this major issue of having a screen full of pink when the tileset is loaded in-game (lol). Other than that it is working great, hopefully I can get this figured out.
Anyway here's a screenshot to feed your curiosity:
http://img8.imageshack.us/img8/6384/vgtilesetcreatormain.jpg
Some features you may like: Easy copy/paste of tiles, dynamic tile count (can add and remove tiles easily), Drag&Drop to re-order, preview a tile as tiled with zoom, and more.
Oh and I'm no genius or professional for that matter, but I've been programming in VB (self taught) since '95. This is my first major attempt at working with images in VB.NET and it has been a great learning experience so far.
To make tile transparent, you must paint it with that pink-color.
And the thing, which paint doesn`t have is ALPHA-CHANNEL.
Alpha-Channel = Transparent channel.
Edit: Evidentally i'm doing something wrong altogether here. I loaded the default de_dust.bmp and re-saved it in photoshop with a different name and when loading it in the editor I get the same problem. That is without using my program at all. The color is R: 255, G: 0, B: 255... Saved it as 32-bit with alpha channels. I'm lost, I thought the game itself only read magenta as transparent. Is there some other way you're supposed to save it?
Here's an example:
http://img33.imageshack.us/img33/3003/magentanottransparent.png
edited 1×, last 24.08.09 08:45:56 am
- Magenta (RGB 255,0,255 / Hex #FF00FF ) turns transparent
- Alpha channel (in PNG format) turns transparent
your magenta pixels do not have the real magenta color 255,0,255 if they do not turn transparent or you are using formats with compression or a wrong colordepth.
use a 24 bit bitmap (bmp, 8 bit for each color) for images with magenta and make sure that your magenta is exactly 255,0,255 / FF00FF
or use png with alpha channel (save for web + check the transparency box in photoshop). in this case you don't have to use magenta but you have to use real transparency of course.
also make sure that your system runs with at least 24 bit colordepth, better 32 bit!
I Also fixed the other issue of not being able to overwrite a file. I'll be releasing this program in a new thread very soon.
The Tileset from the screenshot is one I had thrown together while testing my program. I recolored some tiles from de_dust and made more variations, and also added a lot of tiles from other tilesets. Some of the water tiles need fixed still. Its not all original, but if you want it here it is:
http://img20.imageshack.us/img20/64/dustvg.png
I'm gonna test the hell out of my program and hopefully squash any bugs I may have missed. It should be released by later today.
You should make it in c++ so it's multi-platform and doesn't need .NET.
LilCoder has written
Too bad you made it in visual basic..
You should make it in c++ so it's multi-platform and doesn't need .NET.
You should make it in c++ so it's multi-platform and doesn't need .NET.
This tread name is "New Tileset: Magenta non-transparent?"
Or whatever you just said...
1