- Timestamp:
- May 9, 2019, 4:04:30 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapicursor.cc
r12348 r12363 8 8 { 9 9 RegisterObject(MouseAPICursor); 10 //TODO: copy from radar overlay 10 cursor = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton() 11 .createOverlayElement("Panel", "MouseAPI_cursor_" + getUniqueNumberString())); 12 cursor->setMaterialName(TextureGenerator::getMaterialName( 13 cursorname, Ogre::ColourValue::White)); 14 15 overlay_->add2D(this->cursor); 16 scale(Vector2(0.03,0.03)); 17 setVisible(true); 18 } 19 20 MouseAPICursor::~MouseAPICursor() 21 { 22 if(running) 23 MouseAPI::getInstance().deactivate(); 24 } 25 26 void MouseAPICursor::XMLPort(ticpp::Element &xmlelement, XMLPort::Mode mode) 27 { 28 MouseAPI::getInstance().activate(); 29 running = true; 30 SUPER(MouseAPICursor, XMLPort, xmlelement, mode); 31 XMLPortParam(MouseAPICursor, "cursorShape", setCursorName, getCursorName,xmlelement, mode); 32 //XMLPortParam(MouseAPICursor, "cursorColor", setCursorColor, getCursorColor,xmlelement, mode);//TODO: ColoValue::setAsARGB() 33 } 34 35 void MouseAPICursor::tick(float dt) 36 { 37 if(running) 38 { 39 this->cursor->show(); 40 this->show(); 41 this->setPosition(MouseAPI::getInstance().getMousePosition()); 42 } 11 43 } 12 44
Note: See TracChangeset
for help on using the changeset viewer.