#ifndef MOUSEAPICURSOR_H #define MOUSEAPICURSOR_H #include #include #include #include "mouseapi.h" #include #if OGRE_VERSION >= 0x010900 # include # include #else # include # include #endif #include #include namespace orxonox{ class MouseAPICursor: public OrxonoxOverlay, public Tickable { private: //Pointer to the cursor overlay Ogre::PanelOverlayElement* cursor; //Is Cursor activated? bool running = false; //Name of the image-file used as the cursor shape std::string cursorname = "cursor.png"; //Color of the cursor Vector3 color = {1,1,1}; public: MouseAPICursor(Context* context); ~MouseAPICursor(); //Update cursor position virtual void tick(float dt) override; //XMLPort: ability to set cursor shape & color virtual void XMLPort(ticpp::Element &xmlelement, XMLPort::Mode mode) override; //Update cursol look (shape & color) inline void updateCursor(){ cursor->setMaterialName(TextureGenerator::getMaterialName( cursorname, Ogre::ColourValue(color[0],color[1],color[2],1))); } inline void setCursorName(const std::string& name) { cursorname = name; updateCursor(); } inline std::string getCursorName(void) const { return cursorname; } inline void setCursorColor(const Vector3& cl) { color = cl; updateCursor(); } inline Vector3 getCursorColor(void) const { return color; } }; } #endif // MOUSEAPICURSOR_H