Last change
on this file since 12263 was
12255,
checked in by mkarpf, 6 years ago
|
Test Level Created
Carefull: Level is buggy and freezes Screen!
|
File size:
726 bytes
|
Rev | Line | |
---|
[12255] | 1 | #include "mouseapiexample.h" |
---|
| 2 | |
---|
| 3 | namespace orxonox |
---|
| 4 | { |
---|
| 5 | |
---|
| 6 | RegisterClass(MouseAPIExample); |
---|
| 7 | |
---|
| 8 | MouseAPIExample::MouseAPIExample(Context* context) : StaticEntity(context) |
---|
| 9 | { |
---|
| 10 | RegisterObject(MouseAPIExample); |
---|
| 11 | mouseapi.activate(); |
---|
| 12 | mouseapi.addClickableObject(getPosition(),10,std::list<MouseButtonCode::ByEnum>{MouseButtonCode::Left},[this](MouseButtonCode::ByEnum mouse){this->testfunction(mouse);}); |
---|
| 13 | |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | MouseAPIExample::~MouseAPIExample() |
---|
| 17 | { |
---|
| 18 | mouseapi.deactivate(); |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | void MouseAPIExample::testfunction(MouseButtonCode::ByEnum mouse) |
---|
| 22 | { |
---|
| 23 | orxout() << "MouseAPIExample: Object Clicked\n"; |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | void MouseAPIExample::XMLPort(Element& xmlelement, XMLPort::Mode mode) |
---|
| 27 | { |
---|
| 28 | SUPER(MouseAPIExample, XMLPort, xmlelement, mode); |
---|
| 29 | } |
---|
| 30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.