Changeset 12285 for code/branches/MouseAPI_FS19/src/modules/MouseAPI
- Timestamp:
- Apr 4, 2019, 5:46:25 PM (6 years ago)
- Location:
- code/branches/MouseAPI_FS19/src/modules/MouseAPI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapiexample.cc
r12271 r12285 9 9 { 10 10 RegisterObject(MouseAPIExample); 11 //mouseapi = MouseAPI::getInstance();12 11 13 12 } … … 19 18 } 20 19 21 void MouseAPIExample::tick(float dt)22 {23 ControllableEntity::tick(dt);24 25 }26 27 20 void MouseAPIExample::testfunction(MouseButtonCode::ByEnum mouse) 28 21 { 29 orxout() << "MouseAPIExample: Object Clicked\n"; 22 float randomnumber = (rand()%100 + 1)/100.0; 23 this->setScale(randomnumber); 24 orxout() << "Blah\n"; 25 30 26 } 31 27 … … 35 31 MouseAPI::getInstance().activate(); 36 32 MouseAPI::getInstance().addClickableObject(this->getWorldPosition(),10,std::list<MouseButtonCode::ByEnum>{MouseButtonCode::Left},[this](MouseButtonCode::ByEnum mouse){this->testfunction(mouse);}); 37 38 33 } 39 34 } -
code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapiexample.h
r12271 r12285 9 9 #include "worldentities/ControllableEntity.h" 10 10 #include "core/CoreIncludes.h" 11 #include <list> 12 #include <stdlib.h> 11 13 12 14 namespace orxonox … … 19 21 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 20 22 void testfunction(MouseButtonCode::ByEnum mouse); 21 virtual void tick(float dt) override;23 static std::list<MouseAPIExample> blocks; 22 24 }; 23 25 }
Note: See TracChangeset
for help on using the changeset viewer.