Setcolormask problem
BlitzMax Forums/BlitzMax Programming/Setcolormask problem
| ||
SetMaskColor(255, 0, 0) image:Timage = LoadAnimImage("Data/player.bmp",128,128,0,31) I have this code... The image I load has a red background (255,0,0) but somehow when I draw it it also draws the red part... I don't get it... Is the mask and drawing affected by some functions? (my code is preety large so something there might cause that) |
| ||
Have you remembered to use SetBlend MASKBLEND before you draw the image? |
| ||
SetScale 1,1 SetColor 255, 255, 255 SetAlpha 1 SetBlend MASKBLEND SetRotation 0 DrawImage image,x,y,framethis is the code with the drawing |
| ||
In addition, you say your code is large. What happens when you run a simple program such as :graphics 800,600 setmaskcolor 255,0,0 local image:timage=loadanimimage("data/player.bmp",128,128,0,31) drawimage image,100,100,0 flip waitkey() ? (obviously adjust if you're using GL driver etc)? Also try it with graphics 800,600,32 mode plus load the image into a 32bit image viewer and check the colour. I have been caught out thinking something is 255,0,0 when it was 250,5,5 (or similar). |
| ||
the color 255,0,0 indeed but... in your example it still draw the red surround. So I guess the problem is from the image... but the bmp are not supossed to have alpha informations? Btw If I use png... I won't have to think about mask colors as the alpha value will take care of this right? (can they be generated in 3d max?) |
| ||
Nevermind... I used GlueIt to put the frames next to each other and that messed up the alpha thing... now I used game maker (the only thing its good at) to do that and it works perfectly :) |
| ||
local image:timage=loadanimimage("data/player.bmp",128,128,0,31) that command is missing the flag for the Mask setmaskcolor 255,0,255 loadanimimage("data/player.bmp",128,128,0,31,MASKEDIMAGE) |
| ||
local image:timage=loadanimimage("data/player.bmp",128,128,0,31) It isn't needed.that command is missing the flag for the Mask MASKEDIMAGE is included in the default AutoImageFlags (as is FILTEREDIMAGE). |
| ||
It never was for me... I always had to run the loadimage command like that.. |
| ||
It never was for me... Never 'was'? What about now? |