Overlays and 3D mesh / cursor problems

scippio

18-01-2008 17:58:13

I have some (maybe stupid) problems:

1) When I moved cursor over button (over edge)... console out: Quickgui : error in Widget::overTransparentPixel getting correct Mouse to widget position :?

2) My Cursor is under ogre overlays :( :

and


3) Cursor, quickgui text etc. .. is under 3D mesh. :?


my test code

....

// logo open play
mLogo = Ogre::OverlayManager::getSingleton().getByName("Core/Logo");
mLogo->show();

....

SrSceneManager::getSingleton().mSceneMgr->setAmbientLight(Ogre::ColourValue( 1, 1, 1 ));
Ogre::Entity *terrain = SrSceneManager::getSingleton().mSceneMgr->createEntity("backTerrain","Cube.mesh");
Ogre::SceneNode *terrainNode = SrSceneManager::getSingleton().mSceneMgr->getRootSceneNode()->createChildSceneNode("terrainNode",Ogre::Vector3(-4.1,-29.5,24.5));
terrainNode->attachObject(terrain);
terrainNode->scale(2,2,5);
//terrainNode->setPosition(Ogre::Vector3(25,25,50));

// logo open play
mLogo = Ogre::OverlayManager::getSingleton().getByName("Core/EPlay");
mLogo->show();

QuickGUI::Sheet *mSheet = SrInterface::getSingleton().mGUIManager->getDefaultSheet();

// texty
QuickGUI::Label *versionLabel = mSheet->createLabel();
versionLabel->setFont("micross.14",true);
versionLabel->setText("Test label");
versionLabel->setPosition(5,580);

// tlacitka
QuickGUI::Button *creditsButton = mSheet->createButton("creditsButton");
creditsButton->setFont("micross.12",true);
creditsButton->setText("TestButton");
creditsButton->setPosition(700,490);

....


material script

material Core/Logo
{
technique
{
pass
{
lighting off
scene_blend alpha_blend
depth_check off

texture_unit
{
texture o.testlogo.png
}
}
}
}

material Core/EPlay
{
technique
{
pass
{
lighting off
scene_blend alpha_blend
depth_check off

texture_unit
{
texture o.eplay.png
}
}
}
}


overlay script

Core/LogoOverlay
{
zorder 500
// block
container Panel(Core/LogoPanel)
{
metrics_mode pixels
horz_align right
vert_align top
top 0
left -236
width 236
height 60
material Core/Logo
}
}

Core/EPlay
{
zorder 500
// block
container Panel(Core/Logo2Panel)
{
metrics_mode pixels
horz_align left
vert_align bottom
top -96
left 10
width 80
height 76
material Core/EPlay
}
}

kungfoomasta

18-01-2008 18:11:31

1. There is a problem with how I generate the values used to test if cursor is over a transparent pixel. I don't get this errors but some people do. Haven't been able to look into it..

2. Can you try the following and see if you get better results?

mGUIManager->setRenderQueueID(RENDER_QUEUE_MAX);

scippio

18-01-2008 18:30:04

I add it and all QuickGUI content hdies :shock: :?


new QuickGUI::Root();
QuickGUI::SkinSetManager::getSingleton().loadSkin("qgui",QuickGUI::SkinSet::IMAGE_TYPE_PNG,Ogre::ResourceGroupManager::BOOTSTRAP_RESOURCE_GROUP_NAME);
mGUIManager = QuickGUI::Root::getSingleton().createGUIManager(cam->getViewport());
mGUIManager->setSceneManager(mgr);

mGUIManager->setRenderQueueID(Ogre::RENDER_QUEUE_MAX);

QuickGUI::MouseCursor *cur = mGUIManager->getMouseCursor();
cur->setHideCursorWhenOSCursorOffscreen(false);

kungfoomasta

18-01-2008 18:52:36

Odd... I'll try it at home and see if I get the same results. I think I should just switch rendering from "renderQueueStarted" to "renderQueueEnded", since it seems more appropriate to have the UI above Overlays by default.