[SoC 2009 - Accepted] Unified Samples Framework & Browser
- spacegaier
- OGRE Team Member
- Posts: 4304
- Joined: Mon Feb 04, 2008 2:02 pm
- Location: Germany
- x 135
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
But that is still not a key feature of Ogre. The samples / demos should show the most important things you can do with Ogre and an orthographic camera system is definelty none of those. Such a camera system could be used inside another demo that shows one of the central points of Ogre as a minor feature (see omniter's last post).
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
I strongly object to that!
Why is an orthographic camera system not a feature worthy of a demo?
Likewise for the chase camera.
In my opinion, I'd rather see a demo featuring 2.5D using an orthographic camera, than a skydome demo, a particle demo, ...
Same about the chase camera demo.
Chase camera could be using an animation track..
Don't make the mistake of deciding what kinds of features people ought to be interested in.
However, you might change your mind if someone decided to contribute a sample or two..
/* looking at boyamer */
Why is an orthographic camera system not a feature worthy of a demo?
Likewise for the chase camera.
In my opinion, I'd rather see a demo featuring 2.5D using an orthographic camera, than a skydome demo, a particle demo, ...
Same about the chase camera demo.
Chase camera could be using an animation track..
It makes sense because that's what a lot of Ogre users are interested in.omniter wrote:Exactly. So adding orthographic "support" or chase cam "support" to the browser doesn't really make much sense. Adding an orthographic sample might make sense, to demonstrate the engine's ability to render 2D graphics, but chase cam should at most only be featured in a sample about something else.
Don't make the mistake of deciding what kinds of features people ought to be interested in.
However, you might change your mind if someone decided to contribute a sample or two..
/* looking at boyamer */
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- DanielSefton
- Ogre Magi
- Posts: 1235
- Joined: Fri Oct 26, 2007 12:36 am
- Location: Mountain View, CA
- x 10
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
If it demonstrates a specific feature of Ogre, then that's all good.
However, a spring chase camera is not an Ogre feature. Fair enough if it's in combination with something else or uses animation tracks. A 2.5D ortho sample would be ok since it's a part of Ogre.
The samples could get cluttered very quickly if we start adding game-specific stuff. There's a million possible samples for common game dev hurdles aside from chase cameras.
I see what you are saying that more people want interesting practical examples, but Ogre isn't a game engine, it draws stuff on the screen. If they want game samples NeoAxis is down the road.
However, a spring chase camera is not an Ogre feature. Fair enough if it's in combination with something else or uses animation tracks. A 2.5D ortho sample would be ok since it's a part of Ogre.
The samples could get cluttered very quickly if we start adding game-specific stuff. There's a million possible samples for common game dev hurdles aside from chase cameras.
I see what you are saying that more people want interesting practical examples, but Ogre isn't a game engine, it draws stuff on the screen. If they want game samples NeoAxis is down the road.
You can't assume what people are interested in either. It's not about what people are interested in, it's about showing what Ogre can do.Don't make the mistake of deciding what kinds of features people ought to be interested in.
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
A spring-based camera is game specific?
Come on ..
A good camera system is a core feature of any Ogre application.
I vote for a more advanced camera sample.
It's a central feature of Ogre. It deserves a place in the spotlight.
Come on ..
A good camera system is a core feature of any Ogre application.
I vote for a more advanced camera sample.
It's a central feature of Ogre. It deserves a place in the spotlight.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- boyamer
- Orc
- Posts: 459
- Joined: Sat Jan 24, 2009 11:16 am
- Location: Italy
- x 6
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
Agree with jacmoe,why don't have orhographic camera and chase system if we can?
Good camera system would tell anybode who uses Ogre that it can be fitted in any needs,of course for us who had used Ogre for years its an easy task,but think about beginers,if they have good camera system,that +1 point for ogre!So omniter,would be nice more camera features!
Good camera system would tell anybode who uses Ogre that it can be fitted in any needs,of course for us who had used Ogre for years its an easy task,but think about beginers,if they have good camera system,that +1 point for ogre!So omniter,would be nice more camera features!
- Azgur
- Goblin
- Posts: 264
- Joined: Thu Aug 21, 2008 4:48 pm
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
Please do note, omniter's project was a sample browser framework and viewer. This did include the conversion of samples, but not the creation of samples. We're already really lucky he's patching up the current samples and enhancing them.boyamer wrote:Agree with jacmoe,why don't have orhographic camera and chase system if we can?
Good camera system would tell anybode who uses Ogre that it can be fitted in any needs,of course for us who had used Ogre for years its an easy task,but think about beginers,if they have good camera system,that +1 point for ogre!So omniter,would be nice more camera features!
Additionally, an ortho camera is supported by Ogre, you just have to make use of it.
A chase camera is also fairly trivial to create and several examples of this have been posted on the forums.
But if you really consider these 2 features as a valuable addition to Ogre's current set of samples, why don't you create it?
-
- Ogre Magi
- Posts: 1266
- Joined: Tue Aug 12, 2003 1:53 am
- Location: Melbourne, Australia
- x 1
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
Really, those sort of features like chasecam should be in an 'Ogre toolbox' pack of useful, generic classes. Basically a repo of handy, complete, but small classes that can be used for app specific tasks. It'd be nicer than the current wiki, copy/paste situation.
- boyamer
- Orc
- Posts: 459
- Joined: Sat Jan 24, 2009 11:16 am
- Location: Italy
- x 6
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
Would be greate if you can add ComboBox,ListBox,TreeView or maybe create a guide on how to create a custom Widget.
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
No, boyamer: that would never, ever happen.
It's not a GUI. Find a GUI.
It's a tray system specifically for the demos - capice?
It's not a GUI. Find a GUI.
It's a tray system specifically for the demos - capice?
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- boyamer
- Orc
- Posts: 459
- Joined: Sat Jan 24, 2009 11:16 am
- Location: Italy
- x 6
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
Capito(Understand),but i want to use those trays into my project! They look nice!
-
- Gremlin
- Posts: 185
- Joined: Sat May 07, 2005 3:27 pm
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
Boyamer, I think you'd better read a few posts from this thread from end of page 3 to around page 5... There was a complete discussion about exactly this point, which I think explains why the Ogre Team will NOT approve of any official extension of the Samples GUI.
The beauty of Open Source is that you can make your own branch and dissociate the trays from the Samples SDK to add your own expansions, but I think Omniter will not do so ...
The beauty of Open Source is that you can make your own branch and dissociate the trays from the Samples SDK to add your own expansions, but I think Omniter will not do so ...
- boyamer
- Orc
- Posts: 459
- Joined: Sat Jan 24, 2009 11:16 am
- Location: Italy
- x 6
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
Well,i only asked a guide/tutorial on how to create a custom widget,its that too much? after that myabe i'll try to create my own widgets(TreeView,ListView) and so!
- DanielSefton
- Ogre Magi
- Posts: 1235
- Joined: Fri Oct 26, 2007 12:36 am
- Location: Mountain View, CA
- x 10
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
Like Shadow007 said, "the Ogre Team will NOT approve of any official extension of the Samples GUI" - so providing a tutorial on how to create a custom widget would go entirely against that. But the code is self-explanatory, it's all there and you can use it how you like.
- Kojack
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
The original ogre camera track demo was pretty handy, but more so for the use of manually created spline animation tracks.
A camera demo could be interesting. It could show not just ortho (which is incredibly simple to do) or chase cam, but stuff like camera tracks, cavalier projection (like ultima 7, requires a custom camera matrix), fov and aspect changes, angle limits, multiple cameras with render to texture (in game objects like tv screens showing live camera views), etc. Although I'm not saying it should be done for this framework, but it would be interesting at some point (might even do it myself if I get time).
A camera demo could be interesting. It could show not just ortho (which is incredibly simple to do) or chase cam, but stuff like camera tracks, cavalier projection (like ultima 7, requires a custom camera matrix), fov and aspect changes, angle limits, multiple cameras with render to texture (in game objects like tv screens showing live camera views), etc. Although I'm not saying it should be done for this framework, but it would be interesting at some point (might even do it myself if I get time).
- omniter
- OGRE Contributor
- Posts: 424
- Joined: Thu Mar 19, 2009 8:08 am
- Location: Canada
- x 44
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
Hey guys.
Sorry about the lack of updates. Getting ready for school. The loading bar is done. It's a "singleton widget" just like the logo and stats panel. Just call mTrayMgr->showLoadingBar(); before you load resources. When you're done, call mTrayMgr->hideLoadingBar(); You might also want to hide/unhide the cursor. I've also started on a beginner's guide to the samples framework.
Sorry boyamer. There will be no extension for the widgets, nor any guide on how to create your own. If you want to create your own widgets, you can just go through SdkTrays.h and study it. To tell you the truth, the system isn't really made for customization/expansion and I wouldn't recommend using it for anything but samples. Like you said, they look nice, but that is entirely aesthetic. You're welcome to use the textures however you want (maybe not the OGRE logo though).
I don't really have an opinion on the camera demo though.
Sorry about the lack of updates. Getting ready for school. The loading bar is done. It's a "singleton widget" just like the logo and stats panel. Just call mTrayMgr->showLoadingBar(); before you load resources. When you're done, call mTrayMgr->hideLoadingBar(); You might also want to hide/unhide the cursor. I've also started on a beginner's guide to the samples framework.
Sorry boyamer. There will be no extension for the widgets, nor any guide on how to create your own. If you want to create your own widgets, you can just go through SdkTrays.h and study it. To tell you the truth, the system isn't really made for customization/expansion and I wouldn't recommend using it for anything but samples. Like you said, they look nice, but that is entirely aesthetic. You're welcome to use the textures however you want (maybe not the OGRE logo though).
I don't really have an opinion on the camera demo though.
- KungFooMasta
- OGRE Contributor
- Posts: 2087
- Joined: Thu Mar 03, 2005 7:11 am
- Location: WA, USA
- x 16
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
As far as camera functionality goes, I know lots of people always have questions on how to center a camera to focus on a particular unit, particularly for editor type previewing. Just thought I'd throw this idea out there, I'm sure somebody will come and tell me the code is already available. (at least one solution was posted by me at some point )
Creator of QuickGUI!
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
What a waste of timeboyamer wrote:Well,i only asked a guide/tutorial on how to create a custom widget,its that too much? after that myabe i'll try to create my own widgets(TreeView,ListView) and so!
Use MyGUI, CEGUI, QuickGUI, any-GUI - you won't be wasting your time with GUI libraries.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
Now I'm back I just wanted to congratulate omniter for all his great work over the summer, and being part of what I think was our best GSoC year so far. Hope you enjoyed it! School permitting, I hope we'll be seeing more of you in the future!
- omniter
- OGRE Contributor
- Posts: 424
- Joined: Thu Mar 19, 2009 8:08 am
- Location: Canada
- x 44
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
Thanks, sinbad! I totally enjoyed it, and I'll definitely be around. Working on tutorials and the character model now.
-
- Greenskin
- Posts: 127
- Joined: Mon Jan 19, 2009 5:34 pm
- Location: Murfreesboro, TN
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
I am trying to use "SelectMenu"s in the a dialog similar to the showYesNoDialog(...) but they are rendering under other "SelectMenu"s. It seems you fixed this by have the setExpandedMenu(...) function place the menu in the priority layer. But whenever I tell it to use setExpandedMenu(...) it places the expanded menu overlay in the top right no matter what values I give it for position. Can you give me a bit of advice on how to correct this?
Thanks,
Jon Jones
Code: Select all
void SdkTrayManager::showSelectLodgeDialog(const Ogre::DisplayString &caption)
{
Ogre::OverlayElement* e;
mDialogShade->show();
Ogre::StringVector states;
Ogre::StringVector resorts;
// Generate states string list
...
_stateMenu = new SelectMenu("selectionMenu/stateMenu", "State:", 300, 225, 5);
_stateMenu->setItems(states);
// Generate lodge string list
...
_resortMenu = new SelectMenu("selectionMenu/resortMenu", "Resort:", 300, 225, 5);
_resortMenu->setItems(resorts);
e = _stateMenu->getOverlayElement();
mDialogShade->addChild(e);
e->setVerticalAlignment(Ogre::GVA_CENTER);
e->setLeft(-(e->getWidth() / 2));
e->setTop(-(e->getHeight() / 2));
e = _resortMenu->getOverlayElement();
mDialogShade->addChild(e);
e->setVerticalAlignment(Ogre::GVA_CENTER);
e->setLeft(-(e->getWidth() / 2));
e->setTop(_stateMenu->getOverlayElement()->getTop() + _stateMenu->getOverlayElement()->getHeight() + 5);
_lodgeDialog = true; // A global bool telling the system that we are showing a lodge selection dialog box.
}
Jon Jones
- omniter
- OGRE Contributor
- Posts: 424
- Joined: Thu Mar 19, 2009 8:08 am
- Location: Canada
- x 44
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
Hey trnrez, if you're still having that problem, could you show me a screenshot of the problem, and maybe paste all your code? Thanks.
-
- Greenskin
- Posts: 127
- Joined: Mon Jan 19, 2009 5:34 pm
- Location: Murfreesboro, TN
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
I found a work around that works for me but may make uses not specific like mine crash and burn with a fiery demise . Attached are the two screenshots of what is going on with the dialog.
Full showSelectLodgeDialog(...)
This is the modified setExpandedMenu(...) code I used to correct the positioning.
I commented out the two lines mExpandedBox->setLeft(...) and mExpandedBox->setTop(...) from the SelectMenus's _cursorPressed(...) function.
I am sure this is only a fix for my single case but that is how I worked around it. If you need more info or more explanation please let me know.
Thanks!
Full showSelectLodgeDialog(...)
Code: Select all
void SdkTrayManager::showSelectLodgeDialog(const Ogre::DisplayString &caption)
{
Ogre::OverlayElement* e;
mDialogShade->show();
Ogre::StringVector states;
Ogre::StringVector resorts;
QDir stateDir("../media/lodge_configs");
QStringList stateDirList = stateDir.entryList(QDir::Dirs);
Ogre::OverlayManager& om = Ogre::OverlayManager::getSingleton();
_selectBG = (Ogre::OverlayContainer*)om.createOverlayElementFromTemplate("SdkTrays/Tray", "BorderPanel", "selectionMenu/background");
mDialogShade->addChild(_selectBG);
_selectBG->setVerticalAlignment(Ogre::GVA_CENTER);
_selectBG->setHorizontalAlignment(Ogre::GHA_CENTER);
_selectLabel = new Label("selectionMenu/Label", "Resort Selection", 300);
e = _selectLabel->getOverlayElement();
mDialogShade->addChild(e);
e->setVerticalAlignment(Ogre::GVA_CENTER);
e->setLeft(-(e->getWidth() / 2));
e->setTop(-(167 / 2));
states.push_back("Colorado");
states.push_back("New York");
resorts.push_back("Arapahoe Basin");
_stateMenu = new SelectMenu("selectionMenu/stateMenu", "State:", 300, 225, 5);
_stateMenu->setItems(states);
_stateMenu->_assignListener(this);
_resortMenu = new SelectMenu("selectionMenu/resortMenu", "Resort:", 300, 225, 5);
_resortMenu->setItems(resorts);
_acceptButton = new Button("selectionMenu/acceptButton", "Accept", 100);
_rejectButton = new Button("selectionMenu/rejectButton", "Reject", 100);
e = _stateMenu->getOverlayElement();
mDialogShade->addChild(e);
e->setVerticalAlignment(Ogre::GVA_CENTER);
e->setLeft(-(e->getWidth() / 2));
e->setTop(_selectLabel->getOverlayElement()->getTop() + _selectLabel->getOverlayElement()->getHeight() + 5);
e = _resortMenu->getOverlayElement();
mDialogShade->addChild(e);
e->setVerticalAlignment(Ogre::GVA_CENTER);
e->setLeft(-(e->getWidth() / 2));
e->setTop(_stateMenu->getOverlayElement()->getTop() + _stateMenu->getOverlayElement()->getHeight() + 5);
e = _acceptButton->getOverlayElement();
_acceptButton->_assignListener(this);
mDialogShade->addChild(e);
e->setVerticalAlignment(Ogre::GVA_CENTER);
e->setLeft(-(e->getWidth() + 2));
e->setTop(_resortMenu->getOverlayElement()->getTop() + _resortMenu->getOverlayElement()->getHeight() + 5);
e = _rejectButton->getOverlayElement();
_rejectButton->_assignListener(this);
mDialogShade->addChild(e);
e->setVerticalAlignment(Ogre::GVA_CENTER);
e->setLeft(3);
e->setTop(_resortMenu->getOverlayElement()->getTop() + _resortMenu->getOverlayElement()->getHeight() + 5);
_selectBG->setWidth(320);
_selectBG->setHeight(_selectLabel->getOverlayElement()->getHeight() +
_stateMenu->getOverlayElement()->getHeight() +
_resortMenu->getOverlayElement()->getHeight() +
_acceptButton->getOverlayElement()->getHeight() + 35);
_selectBG->setPosition(_selectLabel->getOverlayElement()->getLeft() - 10, _selectLabel->getOverlayElement()->getTop() - 10);
_lodgeDialog = true;
}
Code: Select all
void SdkTrayManager::setExpandedMenu(SelectMenu* m)
{
if (!mExpandedMenu && m)
{
Ogre::OverlayContainer* c = (Ogre::OverlayContainer*)m->getOverlayElement();
Ogre::OverlayContainer* eb = (Ogre::OverlayContainer*)c->getChild(m->getName() + "/MenuExpandedBox");
Ogre::OverlayContainer* smallBoxCont = (Ogre::OverlayContainer*)c->getChild(m->getName() + "/MenuSmallBox");
eb->_update();
eb->setVerticalAlignment(Ogre::GVA_CENTER);
eb->setHorizontalAlignment(Ogre::GHA_CENTER);
eb->setPosition(c->getLeft() + smallBoxCont->getLeft(), c->getTop() + smallBoxCont->getTop());
c->removeChild(eb->getName());
mPriorityLayer->add2D(eb);
}
else if(mExpandedMenu && !m)
{
Ogre::OverlayContainer* eb = mPriorityLayer->getChild(mExpandedMenu->getName() + "/MenuExpandedBox");
mPriorityLayer->remove2D(eb);
((Ogre::OverlayContainer*)mExpandedMenu->getOverlayElement())->addChild(eb);
}
mExpandedMenu = m;
}
Code: Select all
void _cursorPressed(const Ogre::Vector2& cursorPos)
{
Ogre::OverlayManager& om = Ogre::OverlayManager::getSingleton();
if (mExpanded)
{
if (mScrollHandle->isVisible()) // check for scrolling
{
Ogre::Vector2 co = Widget::cursorOffset(mScrollHandle, cursorPos);
if (co.squaredLength() <= 81)
{
mDragging = true;
mDragOffset = co.y;
return;
}
else if (Widget::isCursorOver(mScrollTrack, cursorPos))
{
Ogre::Real newTop = mScrollHandle->getTop() + co.y;
Ogre::Real lowerBoundary = mScrollTrack->getHeight() - mScrollHandle->getHeight();
mScrollHandle->setTop(Ogre::Math::Clamp<int>(newTop, 0, lowerBoundary));
Ogre::Real scrollPercentage = Ogre::Math::Clamp<Ogre::Real>(newTop / lowerBoundary, 0, 1);
setDisplayIndex(scrollPercentage * (mItems.size() - mItemElements.size()) + 0.5);
return;
}
}
if (!isCursorOver(mExpandedBox, cursorPos, 3)) retract();
else
{
Ogre::Real l = mItemElements.front()->_getDerivedLeft() * om.getViewportWidth() + 5;
Ogre::Real t = mItemElements.front()->_getDerivedTop() * om.getViewportHeight() + 5;
Ogre::Real r = l + mItemElements.back()->getWidth() - 10;
Ogre::Real b = mItemElements.back()->_getDerivedTop() * om.getViewportHeight() +
mItemElements.back()->getHeight() - 5;
if (cursorPos.x >= l && cursorPos.x <= r && cursorPos.y >= t && cursorPos.y <= b)
{
if (mHighlightIndex != mSelectionIndex) selectItem(mHighlightIndex);
retract();
}
}
}
else
{
if (mItems.size() < 2) return; // don't waste time showing a menu if there's no choice
if (isCursorOver(mSmallBox, cursorPos, 4))
{
mExpandedBox->show();
mSmallBox->hide();
// calculate how much vertical space we need
Ogre::Real idealHeight = mItemsShown * (mSmallBox->getHeight() - 8) + 20;
mExpandedBox->setHeight(idealHeight);
mScrollTrack->setHeight(mExpandedBox->getHeight() - 20);
Ogre::Real val = mSmallBox->getLeft() - 4;
//mExpandedBox->setLeft(mSmallBox->getLeft() - 4);
// if the expanded menu goes down off the screen, make it go up instead
if (mSmallBox->_getDerivedTop() * om.getViewportHeight() + idealHeight > om.getViewportHeight())
{
mExpandedBox->setTop(mSmallBox->getTop() + mSmallBox->getHeight() - idealHeight + 3);
// if we're in thick style, hide the caption because it will interfere with the expanded menu
if (mTextArea->getHorizontalAlignment() == Ogre::GHA_CENTER) mTextArea->hide();
}
//mExpandedBox->setTop(mSmallBox->getTop() + 3);
mExpanded = true;
mHighlightIndex = mSelectionIndex;
setDisplayIndex(mHighlightIndex);
if (mItemsShown < mItems.size()) // update scrollbar position
{
mScrollHandle->show();
Ogre::Real lowerBoundary = mScrollTrack->getHeight() - mScrollHandle->getHeight();
mScrollHandle->setTop((int)(mDisplayIndex * lowerBoundary / (mItems.size() - mItemElements.size())));
}
else mScrollHandle->hide();
}
}
}
Thanks!
- Attachments
-
- dialog2.png (63.22 KiB) Viewed 2414 times
-
- dialog.png (63.82 KiB) Viewed 2414 times
- omniter
- OGRE Contributor
- Posts: 424
- Joined: Thu Mar 19, 2009 8:08 am
- Location: Canada
- x 44
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
This probably has to do with the way that _getDerivedLeft and _getDerivedTop works. I'm glad you figured out a work around though. It's a shame I can't test it out right now. Somebody broke the branch and I can't compile it.
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
There was a minor Windows compile error which sneaked in with masterfalcon's Mac/iPhone fixes, I've fixed that. It's working fine for me.omniter wrote:Somebody broke the branch and I can't compile it.
You'll have to use CMake now though. We've been getting the branch ready for merging, and everything has to be done via CMake to support all our compilers / platforms. We let you do it manually for the GSoC to save wasting time, since you weren't up to speed with CMake, but it couldn't stay like that for the merge. We're standardising the build system in the branch so it can be tested on everything before putting it back into trunk.
- masterfalcon
- OGRE Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
- Contact:
Re: [SoC 2009 - Accepted] Unified Samples Framework & Browser
Sorry about that.sinbad wrote:There was a minor Windows compile error which sneaked in with masterfalcon's Mac/iPhone fixes, I've fixed that. It's working fine for me.omniter wrote:Somebody broke the branch and I can't compile it.