Colour Flash
Blitz3D Forums/Blitz3D Beginners Area/Colour Flash
| ||
Is there any way that I can flash (or colour cycle) a particular colour. Lets say, for instance, that I have a grid of lines, and I plot this to a buffer that is then copied to the backbuffer on every frame. The grid is not re-drawn on every frame, but I would like to cycle the colours in the line that make up the grid. I know that I could do it by re-plotting in adifferent colour, but I don't want to do that. Thanks, Zoot |
| ||
it's not possible to cycle colors in blitz,so you have to redraw the grid each frames if you wan't to change the color. sorry but the only way i know to do such a thing is the folowing example make an image[buffer1] the size of the grid draw the grid in blue on a black background setmask the image to blue make a second picture[buffer2] the same size and set themask to black then do this each frame setbuffer imagebuffer(buffer2) clscolor r,g,b ;your color cycling colors cls drawimage buffer1,0,0;this draw the grid with the grid as transparent color so that leave a black screen with only the grid in the color used by clscolor (your cycling color) setbuffer frontbuffer() drawimage buffer2,0,0;this draw the grid with the black as transparent color on top of your gfx so you'll have your grid in the color you wan't flip ![]() i don't know if it's what you wanted :) |
| ||
here's the complete example code Graphics 800,600,32,3 ;create the buffers buffer1=CreateImage(800,600):MaskImage buffer1,0,0,255 buffer2=CreateImage(800,600):MaskImage buffer2,0,0,0 ;create the grid SetBuffer(ImageBuffer(buffer1)) Color 0,0,255 For x=0 To 800 Step 16 Line x,0,x,600 Line 0,x,800,x Next Repeat Text Rand(800),Rand(600),"just a test" SetBuffer ImageBuffer(buffer2) ClsColor Rand(255),Rand(255),Rand(255) Cls DrawImage buffer1,0,0 SetBuffer FrontBuffer() DrawImage buffer2,0,0 Flip Until KeyDown(1) hope you like :) |
| ||
Thanks - very nice. It will do just what I wanted. Top man! |