Program Colored Background
Program Colored Background
Hi, i have read through most of the tutorials but i couldn't find anything on how to add a background color to the program, i have started to build a program and i would like a black background if i may, but am unsure on how to do this, does it involve something along the lines on loading a texture and picking pixels from the texture to apply to the background?
have a look at the driver->beginScene(...) command, it takes a color parameter for the background !!!
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
hmmm, using gui images could be problematic, as you usually draw the gui after the scene...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
This code creates a black backround.
driver->beginScene(true, true, video::SColor(0,0,0,0));
The whole code can be found here.
http://irrlicht.sourceforge.net/docu/example002.html
driver->beginScene(true, true, video::SColor(0,0,0,0));
The whole code can be found here.
http://irrlicht.sourceforge.net/docu/example002.html
Yeah righto thanks for this guys, i have this::
driver->beginScene(true, true, SColor(0,0,0,0));
So i am confused with something else, how can (0,0,0,0) make colors? is there like a color chart or something people follow to figure this out? And for now i am just building a flat black background, but please if you understand how colors are made from (0,0,0,0) please tell, l am very interested...
driver->beginScene(true, true, SColor(0,0,0,0));
So i am confused with something else, how can (0,0,0,0) make colors? is there like a color chart or something people follow to figure this out? And for now i am just building a flat black background, but please if you understand how colors are made from (0,0,0,0) please tell, l am very interested...
-
- Posts: 115
- Joined: Mon May 17, 2010 7:42 am
these 4 arguments are the 4 color components
the first is Alpha (transparency)
the second is Red
the 3rd is Green
the 4th is Blue.
usally they can be setted from 0 to 255.
Alpha is ininfluent if you use it only for the background color so you can set it freely (for now)
if you want set a specific color you have to select the color for example with "paint" and look at the three components. if you want pure red as BG color you have to set
(0,255,0,0)
for the yellow:
(0,255,255,0)
ecc...
don't expect to find colors as
Baground->setColor("blue");.
Irrlicht for now use only number for colors' compontent and this is the best way.
the first is Alpha (transparency)
the second is Red
the 3rd is Green
the 4th is Blue.
usally they can be setted from 0 to 255.
Alpha is ininfluent if you use it only for the background color so you can set it freely (for now)
if you want set a specific color you have to select the color for example with "paint" and look at the three components. if you want pure red as BG color you have to set
(0,255,0,0)
for the yellow:
(0,255,255,0)
ecc...
don't expect to find colors as
Baground->setColor("blue");.
Irrlicht for now use only number for colors' compontent and this is the best way.