mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 06:20:21 +02:00
IGUIEnvironment::drawAll has now a parameter to allow disabling the automatic resize to driver screensize.
That makes it easier to use partial screens, while using automatic alignment. Default is still automatic resizing as before, thought it got changed a bit as it looked a bit strange. Before it only set the lower-right corner, but compared to driver screensizes, so it behaved a bit strange when the leftTop corner of the rootGuiElement was changed (different than when the rightBottom corner was set). Could be the idea before was that only clipping matters. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6163 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@ -191,19 +191,18 @@ void CGUIEnvironment::loadBuiltInFont()
|
||||
|
||||
|
||||
//! draws all gui elements
|
||||
void CGUIEnvironment::drawAll()
|
||||
void CGUIEnvironment::drawAll(bool useScreenSize)
|
||||
{
|
||||
if (Driver)
|
||||
if (useScreenSize && Driver)
|
||||
{
|
||||
core::dimension2d<s32> dim(Driver->getScreenSize());
|
||||
if (AbsoluteRect.LowerRightCorner.X != dim.Width ||
|
||||
AbsoluteRect.LowerRightCorner.Y != dim.Height)
|
||||
AbsoluteRect.UpperLeftCorner.X != 0 ||
|
||||
AbsoluteRect.LowerRightCorner.Y != dim.Height ||
|
||||
AbsoluteRect.UpperLeftCorner.Y != 0
|
||||
)
|
||||
{
|
||||
// resize gui environment
|
||||
DesiredRect.LowerRightCorner = dim;
|
||||
AbsoluteClippingRect = DesiredRect;
|
||||
AbsoluteRect = DesiredRect;
|
||||
updateAbsolutePosition();
|
||||
setRelativePosition(core::recti(0,0,dim.Width, dim.Height));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
virtual ~CGUIEnvironment();
|
||||
|
||||
//! draws all gui elements
|
||||
virtual void drawAll() _IRR_OVERRIDE_;
|
||||
virtual void drawAll(bool useScreenSize) _IRR_OVERRIDE_;
|
||||
|
||||
//! returns the current video driver
|
||||
virtual video::IVideoDriver* getVideoDriver() const _IRR_OVERRIDE_;
|
||||
|
Reference in New Issue
Block a user