Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapicursor.h @ 12363

Last change on this file since 12363 was 12363, checked in by tkuonen, 5 years ago

Added MouseCursor

File size: 1.3 KB
Line 
1#ifndef MOUSEAPICURSOR_H
2#define MOUSEAPICURSOR_H
3#include <overlays/OrxonoxOverlay.h>
4#include "core/CoreIncludes.h"
5#include "tools/interfaces/Tickable.h"
6#include "overlays/OverlayGroup.h"
7#include "mouseapi.h"
8#include "core/XMLPort.h"
9
10
11#if OGRE_VERSION >= 0x010900
12#   include <Overlay/OgreOverlayManager.h>
13#   include <Overlay/OgrePanelOverlayElement.h>
14#else
15#   include <OgreOverlayManager.h>
16#   include <OgrePanelOverlayElement.h>
17#endif
18
19#include "tools/TextureGenerator.h"
20#include "util/StringUtils.h"
21
22namespace orxonox{
23
24class MouseAPICursor: public OrxonoxOverlay, public Tickable
25{
26private:
27    Ogre::PanelOverlayElement* cursor;
28    bool running = false;
29    std::string cursorname = "cursor.png";
30public:
31    MouseAPICursor(Context* context);
32    ~MouseAPICursor();
33    virtual void tick(float dt) override;
34    virtual void XMLPort(ticpp::Element &xmlelement, XMLPort::Mode mode) override;
35    inline void setCursorName(const std::string& name)
36    {
37        cursorname = name;
38        cursor->setMaterialName(TextureGenerator::getMaterialName(
39                                                      cursorname, Ogre::ColourValue::White));
40    }
41    inline std::string getCursorName(void) const
42    {
43        return cursorname;
44    }
45
46};
47
48}
49
50#endif // MOUSEAPICURSOR_H
Note: See TracBrowser for help on using the repository browser.