BitmapFromFile
Moderator: Moderators
BitmapFromFile
Hej Ville,
If it ain't too much of a hassle, I'd like to see one of the current limitations of the BitmapFromFile Component ( as mentioned in the Component Reference ) being lifted, namely the fact that Alpha channel information is not imported.
Thanks in advance,
Kjell
If it ain't too much of a hassle, I'd like to see one of the current limitations of the BitmapFromFile Component ( as mentioned in the Component Reference ) being lifted, namely the fact that Alpha channel information is not imported.
Thanks in advance,
Kjell
I'd like to bump this thread, not because of the previous topic, but because it refers to the component.
.
"...Importing bitmaps will increase your exe-file size very quickly..."
.
I'm wondering if this component can have a checkbox option of the usual way of importing textures from a tag-along "Data" file. Besides helping the .exe size, this adds user modding.
.
I'm looking at the FPS demo, and that, along with map .txt file, makes for an attractive user participation option.
.
I suppose this train of thought would lead to sound effects, etc. also.
.
"...Importing bitmaps will increase your exe-file size very quickly..."
.
I'm wondering if this component can have a checkbox option of the usual way of importing textures from a tag-along "Data" file. Besides helping the .exe size, this adds user modding.
.
I'm looking at the FPS demo, and that, along with map .txt file, makes for an attractive user participation option.
.
I suppose this train of thought would lead to sound effects, etc. also.
Hello,
Correct me if I'm wrong ( Ville ), but I believe one of the reasons ZGE builds such small exe's is that it doesn't include importers for file formats such as bmp, 3ds and wav. Instead, files are converted into the "native" engine formats when they are imported by the Editor.
Now this doesn't mean that external data resources wouldn't be possible, on the contrary .. but it wouldn't really be useful for opening up games to customization in that way as Photoshop / Softimage / etc. wouldn't be able to open up the data.
Personally I'd take the "Little Big Planet" route when possible, where all customization is done within the Game itself rather then relying on external software and file formats.
Don't get me wrong though, I'd welcome the ability to load external sound / image files on the fly as well![Smile :)](./images/smilies/icon_smile.gif)
*And a new / separate thread for this feature request might have been a little more appropriate.
K
Correct me if I'm wrong ( Ville ), but I believe one of the reasons ZGE builds such small exe's is that it doesn't include importers for file formats such as bmp, 3ds and wav. Instead, files are converted into the "native" engine formats when they are imported by the Editor.
Now this doesn't mean that external data resources wouldn't be possible, on the contrary .. but it wouldn't really be useful for opening up games to customization in that way as Photoshop / Softimage / etc. wouldn't be able to open up the data.
Personally I'd take the "Little Big Planet" route when possible, where all customization is done within the Game itself rather then relying on external software and file formats.
Don't get me wrong though, I'd welcome the ability to load external sound / image files on the fly as well
![Smile :)](./images/smilies/icon_smile.gif)
*And a new / separate thread for this feature request might have been a little more appropriate.
K
One of the early design decisions about the ZGE-engine was to minimize the number of files needed to redistribute the games. There are several reasons:
- No external dependencies to other files in runtime. If you have the exe then it will work. My opinion is that single file distributions are elegant.
- No external dependencies to other files also in designer. The whole project is in the zgeproj-file.
- Whole program including data can be compressed with exe-compressors
- And as Kjell mentions, no file format parsers are needed in runtime. When you import 3ds, bitmaps and audio into ZGE it is converted to a simple internal format. Having 3ds/jpg/bmp/tga/mp3 parsers built into the runtime would significantly increase runtime size and complexity.
Having said the above, I would imagine that when we start expanding the scripting-functions with functionality it would be very useful to add some kind of "loadTexture('setse.tga');" function. So I won't rule it out totally but it won't happen in short-term.
- No external dependencies to other files in runtime. If you have the exe then it will work. My opinion is that single file distributions are elegant.
- No external dependencies to other files also in designer. The whole project is in the zgeproj-file.
- Whole program including data can be compressed with exe-compressors
- And as Kjell mentions, no file format parsers are needed in runtime. When you import 3ds, bitmaps and audio into ZGE it is converted to a simple internal format. Having 3ds/jpg/bmp/tga/mp3 parsers built into the runtime would significantly increase runtime size and complexity.
Having said the above, I would imagine that when we start expanding the scripting-functions with functionality it would be very useful to add some kind of "loadTexture('setse.tga');" function. So I won't rule it out totally but it won't happen in short-term.
Some stuff has a quite-simple structure so we might come up with a ZLibrary for importing some "simple" bitmaps/models. Actually, if this is the case it will probably be with the advancing of the scripting language. However I can try to get a TGA importer in a ZExpression/file component
although I don't know anything about TARGA files! xD
Jockes apart... if we were to offer the final user a little bit customization... I would prefere them to be able to define some "producer-code" created with the editor itself... EG: you tell them a list of stuff they can overwrite (like the mesh used by a model) and they do create that object in their own ZGE "data" file using our editor. That data will be read when the Exe will be executed and the content would "overwrite" (better, overload) the mesh/bitmaps you defined. This will not be that easy, but could be an elegant solution since ZGE runtime is not "compiled", but only "interpreted".
![Razz :P](./images/smilies/icon_razz.gif)
Jockes apart... if we were to offer the final user a little bit customization... I would prefere them to be able to define some "producer-code" created with the editor itself... EG: you tell them a list of stuff they can overwrite (like the mesh used by a model) and they do create that object in their own ZGE "data" file using our editor. That data will be read when the Exe will be executed and the content would "overwrite" (better, overload) the mesh/bitmaps you defined. This will not be that easy, but could be an elegant solution since ZGE runtime is not "compiled", but only "interpreted".
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
-=Hugo Rossi=-
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
I can see all the sides of this one; on the one hand, yes moding could be done easily with external files, as well as many other things,. (a cool little app that could say, generate a fancy random 3d media show on a folder of image files you run it from) on the other hand it is a sweet deal to have a nice single compressed file with the whole game and no file structure to install, etc. Kjell is right in pointing out that by using the current file writing component in game map/character/ect. editing can be created and saved. In fact I am planing to develop such a system soon for an idea i have,. so user maps will be generated in the game (in an edit mode) and can then be shared easily,. .
iterationGAMES.com
transparency - definable color
There is a boatload of great liberated textures from "do you remember when?" that used other than black for transparency, and used black as part of the design.
There is a boatload of great liberated textures from "do you remember when?" that used other than black for transparency, and used black as part of the design.
I made a marching soldier this way by cobbling together some sprite textures, but it involved a lot of work to change the colors. This feature would make it dead easy.I guess the bitmap-animation is done with a large texture containing all animation frames and then modifying texture coordinates?
I was wondering why it took a few seconds for my game to compile and run, as opposed to the usual almost instantly. Irfanview has an information feature and I noticed my newest bitmap had entries in dpi boxes for printing it out. Blanking these boxes restored ZGE's quick compile.
"great expectations"
![Cool 8)](./images/smilies/icon_cool.gif)
Attached is a example on how to use any color you want as Alpha Mask.
K
- Attachments
-
- Mask.zgeproj
- (4.48 KiB) Downloaded 798 times
Without function:
Code: Select all
float rr,gg,bb;
rr=this.Pixel.R; gg=this.Pixel.G; bb=this.Pixel.B;
this.Pixel.A = 1-(rr==0 && gg==1 && bb==1); // 0,1,1 RGB(0,255,255)
That's a good trick. It's really tough touching up the bordering near black parts when you're using the black as transparent.
I might as well post my work around for converting bitmaps with black as part of their palette. I use Gimp to save them in .xpm format, read it in text editor. The index is easy to change 000000 to 000001, and observing the rest, it's easy to figure which symbol to change to 000000. Then reloaded into gimp and save as 24bit .btm ( watch the advanced options! )
I might as well post my work around for converting bitmaps with black as part of their palette. I use Gimp to save them in .xpm format, read it in text editor. The index is easy to change 000000 to 000001, and observing the rest, it's easy to figure which symbol to change to 000000. Then reloaded into gimp and save as 24bit .btm ( watch the advanced options! )
"great expectations"
Kjell wrote:
Attached is a example on how to use any color you want as Alpha Mask.
K
Such useful tricks (without it, dealing with transparencies in 8 bit pngs is really too impractical!) should really be added to the "tips and tricks" part of the forum, who will ever find them burried in this threadValerious wrote:Without function:Code: Select all
float rr,gg,bb; rr=this.Pixel.R; gg=this.Pixel.G; bb=this.Pixel.B; this.Pixel.A = 1-(rr==0 && gg==1 && bb==1); // 0,1,1 RGB(0,255,255)
![Smile :)](./images/smilies/icon_smile.gif)