|
Post by jamesbowman on Jun 19, 2014 16:03:20 GMT -8
The FT800 does support PALETTED - so you can modify the alpha of the colors in the palette that way.
The other way -- which IMHO is a bit less 'retro' -- is to use stencil or alpha compositing with a 1-bit bitmap to control transparency. Chapter 14 of the book covers alpha transparency.
|
|
|
Post by neuroflux on Jun 21, 2014 4:34:53 GMT -8
The FT800 does support PALETTED - so you can modify the alpha of the colors in the palette that way. The other way -- which IMHO is a bit less 'retro' -- is to use stencil or alpha compositing with a 1-bit bitmap to control transparency. Chapter 14 of the book covers alpha transparency. Nice one my son! Awesome. I have one more issue then I'll meander on my way So... I use GD.BitmapSize(NEAREST, REPEAT, REPEAT, 480, 272); GD.Vertex2ii(0,0,GRASS_HANDLE); GD.BitmapSize(NEAREST, REPEAT, REPEAT, 128, 64); GD.Vertex2ii(0,0,WOOD_HANDLE); But the second BitmapSize() doesn't execute (or at least it seems that way). The bitmap just draws the original size (32x32). Edit: I've tried GD.flush() and even GD.finish() to try to force a redraw (but I'm not sure if that's the correct usage)
|
|
|
Post by jamesbowman on Jun 21, 2014 7:20:56 GMT -8
OK, BitmapSize() needs to know the handle that it should be changing. So the code needs to set the BitmapHandle, then set its BitmapSize, BitmapLayout, BitmapSource:
GD.BitmapHandle(GRASS_HANDLE); GD.BitmapSize(NEAREST, BORDER, BORDER, 480, 272); GD.Vertex2ii(0, 0, GRASS_HANDLE);
GD.BitmapHandle(WOOD_HANDLE); GD.BitmapSize(NEAREST, REPEAT, REPEAT, 128, 64); GD.Vertex2ii(0, 0, WOOD_HANDLE); The other fix is changing the first size from REPEAT/REPEAT to BORDER/BORDER: repeating bitmaps must have power-of-2 sizes.
|
|
|
Post by neuroflux on Jun 21, 2014 8:19:32 GMT -8
OK, BitmapSize() needs to know the handle that it should be changing. So the code needs to set the BitmapHandle, then set its BitmapSize, BitmapLayout, BitmapSource: GD.BitmapHandle(GRASS_HANDLE); GD.BitmapSize(NEAREST, BORDER, BORDER, 480, 272); GD.Vertex2ii(0, 0, GRASS_HANDLE);
GD.BitmapHandle(WOOD_HANDLE); GD.BitmapSize(NEAREST, REPEAT, REPEAT, 128, 64); GD.Vertex2ii(0, 0, WOOD_HANDLE); The other fix is changing the first size from REPEAT/REPEAT to BORDER/BORDER: repeating bitmaps must have power-of-2 sizes. Genius my friend. Thank you! It's quite quiet in these forums - I'm surprised, the Gameduino 2 is nice to work with - currently using mine as a small game creation thingy until I get the rest of my robotics parts, then it'll become an face that has emotions.
|
|
|
Post by Steve on Jun 25, 2014 10:54:43 GMT -8
I ask because I had a .png file that was 44x44 pixels that I used gd2asset to convert to a .gd2 file, but when I ran my sketch the Gameduino2 kept showing an error message (white text on a blue background) saying that it could not load the .gd2 file. When I resized the .png file to 64x64 and created a new .gd2 file using gd2asset, the Gameduino2 loaded the .gd2 file without issue. Each time I tried a new .gd2 file, I had an appropriate .h file to load the assets. The image/tile size is the only thing that I changed to get the image to load. I have not read anything to indicate that the tile size would have been a problem, but I am still wondering why my 44x44 pixel tile did not load. Did I overlook something? I had this problem as well. I fixed it by making sure the filename was DOS compatible with 8 characters plus 3 character extension : (8.3) ********.***
|
|