Sprite : How do I keep a constant background
BlitzMax Forums/BlitzMax Beginners Area/Sprite : How do I keep a constant background
| ||
I have a sprite that works just fine. However the screen background is black while the sprite background is green.How do I change the entire screen to the color of the sprite's background ? Thanks in advance. MY sprites with their green backgrounds .. ![]() |
| ||
Hello. SetMaskColor. Goodbye. |
| ||
Or, interpreting the question another way, use `SetClsColor` with the color of the sprite sheet, and then `Cls`. |
| ||
Kick Off was awful. Sorry, knee-jerk reaction there. |
| ||
Hee-hee, kickoff was great :) Thanks for the replies. |
| ||
SetMaskColor 0,160,0 makes the green transparent which isn't what I wanted to do.What I want to do is set the background in general outside the sprites to 0,160,0. setclscolor 0,160,0 changes the entire screen to the correct green color but some of the sprite is missing :( My code Graphics 1280,854 'set gfx mode Global FrameTimer = MilliSecs() Global frame:Int = 0 Global myimage:TImage = LoadAnimImage("ko2.png",16,16,0,5) Repeat Cls DrawImage myimage,50,50,frame If MilliSecs() > FrameTimer + 100 FrameTimer = MilliSecs() frame:+1 EndIf If frame > 4 Then frame = 0 Flip FlushMem Until KeyHit(KEY_ESCAPE) |
| ||
Using both setmaskcolor and setclscolor is the solution Graphics 1280,854 'set gfx mode Global FrameTimer = MilliSecs() Global frame:Int = 0 SetMaskColor 0,160,0 Global myimage:TImage = LoadAnimImage("ko2.png",16,16,0,5) SetClsColor 0,160,0 Repeat Cls DrawImage myimage,50,50,frame If MilliSecs() > FrameTimer + 100 FrameTimer = MilliSecs() frame:+1 EndIf If frame > 4 Then frame = 0 Flip FlushMem Until KeyHit(KEY_ESCAPE) Thanks |