Forum

> > CS2D > General > New Tileset: Magenta non-transparent?
Forums overviewCS2D overviewGeneral overviewLog in to reply

English New Tileset: Magenta non-transparent?

12 replies
To the start Previous 1 Next To the start

old New Tileset: Magenta non-transparent?

VaiN
User Off Offline

Quote
I have created a tileset creator to simplify the process of creating new tilesets for cs2d. All is well, except when loading the tileset in the editor. The magenta (transparent) tile is not transparent. The color is correct as I have even tried copying from a working tileset. And I have also tried re-saving with mspaint and photoshop in case it wasn't saving in the cirrect format. It is being saved as a 24-bit bitmap image is this the correct format? Anyone have any idea why it isn't making the magenta tile transparent?

old Re: New Tileset: Magenta non-transparent?

KaiserWilhelm
User Off Offline

Quote
I have no clue how to fix your problem, but it may just be a glitch in your program. If you copy the code I'm pretty sure someone might be able to help you, as long as its not in some really obscure language. Or Perl, nobody likes Perl (it's just a joke, please don't skin me alive!) But on a more serious foot, where can I download this program? I would love something to simplify the laborious task of making 32X32 pixel squares.

old Re: New Tileset: Magenta non-transparent?

Zune5
COMMUNITY BANNED Off Offline

Quote
I'm not sure what it is called, but theres something you have to change thats not in Paint.

Also, is it a bmp/png?
Did you try deleting all of the tiles but save the transparent tile?
Are you a genius? (Joking.)

old Re: New Tileset: Magenta non-transparent?

VaiN
User Off Offline

Quote
It is definately a glitch in my program. I'm trying to isolate the cause, though I'm almost certain it's a format issue. As far as it being a bmp/png I'm not really sure what you mean. I've tried both formats just to test it and both gave the same result.

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.

old Re: New Tileset: Magenta non-transparent?

RedPillow
User Off Offline

Quote
What you mean by transparent tile?

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.

old Re: New Tileset: Magenta non-transparent?

VaiN
User Off Offline

Quote
Oh ok, if it requires an alpha then its not 24-bit, i thought I read somewhere it should be. Any references to what the format should be? I still can't find any info on it.

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

old Re: New Tileset: Magenta non-transparent?

DC
Admin Off Offline

Quote
both should work:

- 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!

old Re: New Tileset: Magenta non-transparent?

KimKat
GAME BANNED Off Offline

Quote
I had this problem before, I solved it by just flattening the image and change the magenta to magenta again. Then load the tileset again on your map then it shall work.

old Re: New Tileset: Magenta non-transparent?

VaiN
User Off Offline

Quote
Thanks for the tips. It was all because I hadn't specified the format for one Drawing.Bitmap declaration. After setting that to 24-bit it now works fine.

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.

old closed Re: New Tileset: Magenta non-transparent?

SQ
Moderator Off Offline

Quote
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.

This tread name is "New Tileset: Magenta non-transparent?"
Or whatever you just said...
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview