- Timestamp:
- May 16, 2019, 2:27:40 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapicursor.h
r12363 r12377 2 2 #define MOUSEAPICURSOR_H 3 3 #include <overlays/OrxonoxOverlay.h> 4 #include "core/CoreIncludes.h" 5 #include "tools/interfaces/Tickable.h" 6 #include "overlays/OverlayGroup.h" 4 #include <core/CoreIncludes.h> 5 #include <tools/interfaces/Tickable.h> 7 6 #include "mouseapi.h" 8 #include "core/XMLPort.h" 9 7 #include <core/XMLPort.h> 10 8 11 9 #if OGRE_VERSION >= 0x010900 … … 17 15 #endif 18 16 19 #include "tools/TextureGenerator.h"20 #include "util/StringUtils.h"17 #include <tools/TextureGenerator.h> 18 #include <util/StringUtils.h> 21 19 22 20 namespace orxonox{ … … 25 23 { 26 24 private: 25 //Pointer to the cursor overlay 27 26 Ogre::PanelOverlayElement* cursor; 27 //Is Cursor activated? 28 28 bool running = false; 29 //Name of the image-file used as the cursor shape 29 30 std::string cursorname = "cursor.png"; 31 //Color of the cursor 32 Vector3 color = {1,1,1}; 30 33 public: 31 34 MouseAPICursor(Context* context); 32 35 ~MouseAPICursor(); 36 //Update cursor position 33 37 virtual void tick(float dt) override; 38 //XMLPort: ability to set cursor shape & color 34 39 virtual void XMLPort(ticpp::Element &xmlelement, XMLPort::Mode mode) override; 40 //Update cursol look (shape & color) 41 inline void updateCursor(){ 42 cursor->setMaterialName(TextureGenerator::getMaterialName( 43 cursorname, Ogre::ColourValue(color[0],color[1],color[2],1))); 44 } 35 45 inline void setCursorName(const std::string& name) 36 46 { 37 47 cursorname = name; 38 cursor->setMaterialName(TextureGenerator::getMaterialName( 39 cursorname, Ogre::ColourValue::White)); 48 updateCursor(); 40 49 } 41 50 inline std::string getCursorName(void) const 42 51 { 43 52 return cursorname; 53 } 54 inline void setCursorColor(const Vector3& cl) 55 { 56 color = cl; 57 updateCursor(); 58 } 59 inline Vector3 getCursorColor(void) const 60 { 61 return color; 44 62 } 45 63
Note: See TracChangeset
for help on using the changeset viewer.