Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/hud/src/orxonox/overlays/OverlayGroup.h @ 1618

Last change on this file since 1618 was 1615, checked in by rgrieder, 16 years ago
  • added blankString to String so you can return ""; even if it's a const std::string&
  • fixed several bugs with aspect correct and margin alignment
  • added console commands for OrxonoxOverlays and OverlayGroups for rotate, scale and scroll (you can access the by name (from name=.. in xml file), e.g. "OrxonoxOverlay rotateOverlay SpeedBar 90)
  • converted everything in overlays/ to 4 spaces/tab ;)
  • removed all using namespace Ogre;
  • added background_ Panel to OrxonoxOverlay, since most of the derived classes can use that
  • should work now, but I'll have to test on a tardis box first
  • Property svn:eol-style set to native
File size: 2.2 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Reto Grieder
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _OverlayGroup_H__
30#define _OverlayGroup_H__
31
32#include "OrxonoxPrereqs.h"
33
34#include <map>
35#include <OgrePrerequisites.h>
36#include "core/BaseObject.h"
37#include "util/Math.h"
38
39namespace orxonox
40{
41    class _OrxonoxExport OverlayGroup : public BaseObject
42    {
43    public:
44        OverlayGroup();
45        ~OverlayGroup();
46
47        void XMLPort(Element& xmlElement, XMLPort::Mode mode);
48
49        static void toggleVisibility(const std::string& name);
50        static void scaleGroup(const std::string& name, float scale);
51        static void scrollGroup(const std::string& name, const Vector2& scroll);
52        static void rotateGroup(const std::string& name, Radian angle);
53
54    private:
55        void scale(const Vector2& scale) { this->setScale(scale * this->scale_); }
56        void setScale(const Vector2& scale);
57        Vector2 getScale() const { return this->scale_; }
58
59        void scroll(const Vector2& scroll) { this->setScroll(scroll + this->scroll_); }
60        void setScroll(const Vector2& scroll);
61        Vector2 getScroll() const { return this->scale_; }
62
63        void addElement(OrxonoxOverlay* element);
64        OrxonoxOverlay* getElement(unsigned int index);
65
66        std::map<std::string, OrxonoxOverlay*> hudElements_;
67        Vector2 scale_;
68        Vector2 scroll_;
69    };
70}
71
72#endif /* _OverlayGroup_H__ */
Note: See TracBrowser for help on using the repository browser.