All GuiElement alpha chanel

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
giuseppegam
Posts: 39
Joined: Thu Jan 11, 2007 2:45 am

All GuiElement alpha chanel

Post by giuseppegam »

Hi,
are all elements of guielement on alpha chanel, leave as normal?

Imagem game
Image

Code: Select all

#include <irrlicht.h>
#include <sqlite3.h>
using namespace irr;
#include "funcoes.h"
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int room=1;
sqlite3 *db;
#pragma comment(lib, "Irrlicht.lib")


// objetos globais
IrrlichtDevice* device = 0;
IVideoDriver* driver =0;
ISceneManager* smgr = 0;
IGUIEnvironment* guienv = 0;
#include <event_receiver.h>
int main(int argc, char **argv)
{
MyEventReceiver receiver;
// Seta informações da engine    
device = createDevice(EDT_OPENGL, dimension2d<s32>(1024, 768), 24,true, false, false, &receiver);
device->setWindowCaption(L"Quiz! - 2004-2008 GAM STUDIO");
driver = device->getVideoDriver();
guienv = device->getGUIEnvironment();   
//inicia o título

//Insere os elementos no guienv de login
guienv->addEditBox(L"Nome do Grupo",rect<s32>(500, 400, 650, 420), true, 0, 1);
guienv->addEditBox(L"Codigo do Grupo",rect<s32>(500, 450, 650, 470), true, 0, 2);

//Insere o botão para logar
guienv->addButton(rect<s32>(500,500,550,535), 0, 3, L"Logar");

while(device->run())
	{                    
		driver->beginScene(true, true, SColor(255,255,255,255));
		//coloca o fundo na tela
		driver->draw2DImage(driver->getTexture("media/fundo.jpg"), core::position2d<s32>(0,0),core::rect<s32>(0,0,1024,768),0, video::SColor(255,255,255,255), true);
        guienv->drawAll();
        driver->endScene();
	}

return 0;
}

JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

parley voo onglaze?

are you wanting individual GUI elements to have different alpha values?

in short you can't, as standard, though you could probably write your own GUI element to provide this.

but you can give different types of GUI elements different alpha values, this can sort of be seen in the MeshViewer example which gives each set of GUI elements full alpha at the start so they're not transparent.
Image Image Image
giuseppegam
Posts: 39
Joined: Thu Jan 11, 2007 2:45 am

Post by giuseppegam »

Hello, you did not understand, all my GUI element are transparent, as in the picture, but I want them normal, I do not know where I was in error set them transparent.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

The UserInterface tutorial has a scrollbar that changes the transparency of all of the gui elements. You can copy your code from there.

Travis
Post Reply