Index: /code/branches/Presentation_FS19/data/levels/MouseAPIExample.oxw
===================================================================
--- /code/branches/Presentation_FS19/data/levels/MouseAPIExample.oxw	(revision 12407)
+++ /code/branches/Presentation_FS19/data/levels/MouseAPIExample.oxw	(revision 12407)
@@ -0,0 +1,51 @@
+<LevelInfo
+ name = "MouseAPI Example"
+ description = "A level to test our MouseAPI"
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("MouseCursor.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<Level gametype=MouseGametype>
+ 
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <!--<?lua include("includes/notifications.oxi") ?>-->
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+  
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0"  />
+    
+
+<MouseAPIExample position="0,-0,-70" direction="0,0,0" id=1>
+    <attached> 
+	<Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,10" /> 
+    </attached> 
+</MouseAPIExample>
+
+<MouseAPIExample position="0,0,70" direction="0,0,0" id=2>
+    <attached> 
+	<Model position="0,0,0" mesh="sphere.mesh" scale=10 /> 
+    </attached> 
+</MouseAPIExample>
+
+<MouseAPIExample position="0,70,0" direction="0,0,0" id=3>
+    <attached> 
+	<Model position="0,0,0" mesh="cube.mesh" scale3D="10,10,100" /> 
+    </attached> 
+</MouseAPIExample>
+
+  </Scene>
+</Level>
+
Index: /code/branches/Presentation_FS19/data/overlays/MouseCursor.oxo
===================================================================
--- /code/branches/Presentation_FS19/data/overlays/MouseCursor.oxo	(revision 12407)
+++ /code/branches/Presentation_FS19/data/overlays/MouseCursor.oxo	(revision 12407)
@@ -0,0 +1,5 @@
+<Template name="MouseCursor">
+<OverlayGroup name = "MouseCursorGroup" scale = "1, 1">
+    <MouseAPICursor name="cursor" position = "0, 0" size="0.03, 0.03" cursorShape="cursor.png" cursorColor="1,0,1"></MouseAPICursor>
+</OverlayGroup>
+</Template>
Index: /code/branches/Presentation_FS19/src/modules/CMakeLists.txt
===================================================================
--- /code/branches/Presentation_FS19/src/modules/CMakeLists.txt	(revision 12406)
+++ /code/branches/Presentation_FS19/src/modules/CMakeLists.txt	(revision 12407)
@@ -53,2 +53,4 @@
 ADD_SUBDIRECTORY(orxokart)
 ADD_SUBDIRECTORY(wagnis)
+ADD_SUBDIRECTORY(MouseAPI)
+ADD_SUBDIRECTORY(MouseAPIExample)
Index: /code/branches/Presentation_FS19/src/modules/MouseAPI/CMakeLists.txt
===================================================================
--- /code/branches/Presentation_FS19/src/modules/MouseAPI/CMakeLists.txt	(revision 12407)
+++ /code/branches/Presentation_FS19/src/modules/MouseAPI/CMakeLists.txt	(revision 12407)
@@ -0,0 +1,15 @@
+SET_SOURCE_FILES(MOUSEAPI_SRC_FILES
+  mouseapi.cc
+  mousegametype.cc
+  mouseapicursor.cc
+)
+
+
+ORXONOX_ADD_LIBRARY(mouseapi
+  MODULE
+  FIND_HEADER_FILES
+  PCH_FILE
+  LINK_LIBRARIES
+    orxonox
+  SOURCE_FILES ${MOUSEAPI_SRC_FILES}
+)
Index: /code/branches/Presentation_FS19/src/modules/MouseAPI/mouseapi.cc
===================================================================
--- /code/branches/Presentation_FS19/src/modules/MouseAPI/mouseapi.cc	(revision 12407)
+++ /code/branches/Presentation_FS19/src/modules/MouseAPI/mouseapi.cc	(revision 12407)
@@ -0,0 +1,236 @@
+#include "mouseapi.h"
+
+namespace orxonox{
+
+ManageScopedSingleton(MouseAPI, ScopeID::GRAPHICS, false);
+
+MouseAPI::MouseAPI()
+{
+
+}
+
+void MouseAPI::activate()
+{
+    if(!active)
+    {
+        active = true;
+        if(InputManager::exists())
+        {
+            state = InputManager::getInstance().createInputState("MouseAPI",true,true,99);
+            state->setMouseExclusive(false);//does this work
+            state->setMouseHandler(this);
+            gameInputActivated = false;
+            state->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
+            InputManager::getInstance().enterState("guiMouseOnly");
+            InputManager::getInstance().enterState("MouseAPI");
+            InputManager::getInstance().setMouseExclusive("game",false);
+        }
+    }
+
+}
+
+void MouseAPI::deactivate()
+{
+    if(active)
+    {
+        active = false;
+        if(InputManager::exists())
+        {
+            InputManager::getInstance().leaveState("MouseAPI");
+            state->setMouseHandler(nullptr);
+            InputManager::getInstance().destroyState("MouseAPI");
+            InputManager::getInstance().enterState("game");
+        }
+        clickEvents.clear();
+        scrollEvents.clear();
+        gameInputActivated=false;
+    }
+}
+
+MouseAPI::~MouseAPI()
+{
+
+}
+
+void MouseAPI::buttonPressed(MouseButtonCode::ByEnum button)
+{
+    cam = CameraManager::getInstance().getActiveCamera()->getOgreCamera();
+    Ogre::Viewport *vp = GraphicsManager::getInstance().getViewport();
+    int mouseposX = InputManager::getInstance().getMousePosition().first;
+    int mouseposY = InputManager::getInstance().getMousePosition().second;
+    Ogre::Ray ray = cam->getCameraToViewportRay(mouseposX/((float)vp->getActualWidth()),mouseposY/((float)vp->getActualHeight()));
+    for(auto event: clickEvents)
+    {
+        for(auto wantedButton:event.buttons)
+        {
+            Ogre::Sphere sphere(event.position,event.radius);
+            if(wantedButton == button && ray.intersects(sphere).first && cam->isVisible(sphere))
+                event.onClickedFunction(button);
+        }
+    }
+}
+
+void MouseAPI::mouseMoved(IntVector2 abs, IntVector2 rel, IntVector2 clippingSize)
+{
+}
+
+void MouseAPI::tick(float dt)
+{
+    if(active && !gameInputActivated)
+    {
+        InputManager::getInstance().leaveState("game");
+    }
+
+}
+
+
+void MouseAPI::mouseScrolled(int abs, int rel)
+{
+    cam = CameraManager::getInstance().getActiveCamera()->getOgreCamera();
+    Ogre::Viewport *vp = GraphicsManager::getInstance().getViewport();
+    int mouseposX = InputManager::getInstance().getMousePosition().first;
+    int mouseposY = InputManager::getInstance().getMousePosition().second;
+    Ogre::Ray ray = cam->getCameraToViewportRay(mouseposX/((float)vp->getActualWidth()),mouseposY/((float)vp->getActualHeight()));
+    for(auto event:scrollEvents)
+    {
+        if(!event.considerPosition || (ray.intersects(Ogre::Sphere(event.position,event.radius)).first && cam->isVisible(Ogre::Sphere(event.position,event.radius))))
+            event.onScrolledFunction(abs,rel,IntVector2(mouseposX,mouseposY));
+    }
+}
+
+ClickableElementID MouseAPI::addClickableElement(const Vector3& position, float radius, const std::list<MouseButtonCode::ByEnum>& buttons, std::function<void(MouseButtonCode::ByEnum)> onClickedFunction)
+{
+    ClickableElementID id = !clickEvents.empty() ? clickEvents.back().id + 1:0;
+    clickEvents.insert(clickEvents.end(),{id,position,radius,buttons,onClickedFunction});
+    return id;
+}
+ScrollableElementID MouseAPI::addScrollElement(const Vector3& position, float radius, std::function<void(int abs,int rel,const IntVector2& mousePos)> onScrolledFunction)
+{
+    ScrollableElementID id = !scrollEvents.empty() ? scrollEvents.back().id + 1:0;
+    scrollEvents.insert(scrollEvents.end(),{id,position,radius,onScrolledFunction});
+    return id;
+}
+ScrollableElementID MouseAPI::addScrollElement(std::function<void(int abs,int rel,const IntVector2& mousePos)> onScrolledFunction)
+{
+    ScrollableElementID id = !scrollEvents.empty() ? scrollEvents.back().id + 1:0;
+    scrollEvents.insert(scrollEvents.end(),{id,onScrolledFunction});
+    return id;
+}
+
+
+bool MouseAPI::changePositionOfClickableElement(ClickableElementID id,const Vector3& position)
+{
+    for(auto event:clickEvents)
+    {
+        if(event.id == id)
+        {
+            event.position = position;
+            return true;
+        }
+    }
+    return false;
+}
+bool MouseAPI::changePositionOfScrollableElement(ScrollableElementID id,const Vector3& position)
+{
+    for(auto event:scrollEvents)
+    {
+        if(event.id == id)
+        {
+            event.position = position;
+            return true;
+        }
+    }
+    return false;
+}
+bool MouseAPI::changeRadiusOfClickableElement(ClickableElementID id,float radius)
+{
+    for(auto event = clickEvents.begin();event != clickEvents.end();event++ )
+    {
+        if(event->id == id)
+        {
+            event->radius = radius;
+            return true;
+        }
+    }
+    return false;
+}
+bool MouseAPI::changeRadiusOfScrollableElement(ScrollableElementID id,float radius)
+{
+    for(auto event = scrollEvents.begin();event != scrollEvents.end();event++ )
+    {
+        if(event->id == id)
+        {
+            event->radius = radius;
+            return true;
+        }
+    }
+    return false;
+}
+bool MouseAPI::deleteClickableElement(ClickableElementID id)
+{
+    for(auto eventIt = clickEvents.begin();eventIt != clickEvents.end();eventIt++ )
+    {
+        if(eventIt->id == id)
+        {
+            clickEvents.erase(eventIt);
+            return true;
+        }
+    }
+    return false;
+}
+bool MouseAPI::deleteScrollableElement(ScrollableElementID id)
+{
+    for(auto eventIt = scrollEvents.begin();eventIt != scrollEvents.end();eventIt++ )
+    {
+        if(eventIt->id == id)
+        {
+            scrollEvents.erase(eventIt);
+            return true;
+        }
+    }
+    return false;
+}
+
+float MouseAPI::getRadiusClick(ClickableElementID id)
+{
+     for(auto eventIt = clickEvents.begin();eventIt != clickEvents.end();eventIt++ )
+     {
+         if(eventIt->id == id)
+         {
+             return eventIt->radius;
+         }
+     }
+     return 0;
+}
+
+float MouseAPI::getRadiusScroll(ScrollableElementID id)
+{
+     for(auto eventIt = scrollEvents.begin();eventIt != scrollEvents.end();eventIt++ )
+     {
+         if(eventIt->id == id)
+         {
+             return eventIt->radius;
+         }
+     }
+     return 0;
+}
+
+Vector2 MouseAPI::getMousePosition()
+{
+    Ogre::Viewport *vp = GraphicsManager::getInstance().getViewport();
+    return Vector2(InputManager::getInstance().getMousePosition().first/((float)vp->getActualWidth()),InputManager::getInstance().getMousePosition().second/((float)vp->getActualHeight()));
+}
+
+void MouseAPI::activateGameInput()
+{
+    gameInputActivated = true;
+    state->setKeyHandler(nullptr);
+}
+
+void MouseAPI::deactivateGameInput()
+{
+    gameInputActivated = false;
+    state->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
+}
+
+}
Index: /code/branches/Presentation_FS19/src/modules/MouseAPI/mouseapi.h
===================================================================
--- /code/branches/Presentation_FS19/src/modules/MouseAPI/mouseapi.h	(revision 12407)
+++ /code/branches/Presentation_FS19/src/modules/MouseAPI/mouseapi.h	(revision 12407)
@@ -0,0 +1,262 @@
+#ifndef MOUSEAPI_H
+#define MOUSEAPI_H
+
+#include <OrxonoxPrereqs.h>
+#include <util/OgreForwardRefs.h>
+#include <graphics/Camera.h>
+#include <util/Math.h>
+#include <list>
+#include <core/input/InputHandler.h>
+#include <graphics/Camera.h>
+#include <core/GraphicsManager.h>
+#include <core/input/InputState.h>
+#include <OgreCamera.h>
+#include <OgreViewport.h>
+#include <CameraManager.h>
+#include <functional>
+#include <core/GUIManager.h>
+#include <core/input/KeyBinderManager.h>
+#include <tools/interfaces/Tickable.h>
+#include <core/singleton/ScopedSingletonIncludes.h>
+
+/* this class implements a basic mouse-api
+ * supported are mouse-clicks (left, right, mousewheel, ...) and scrolling
+ *
+ * mouse-clicks always are asscociated with an ingame element that has a position and a sphere with a certain radius around it
+ * if the cursor is inside this sphere and a button is pressed, a user-defined function will be called
+ *
+ * scrolling can either be global (independent of where the cursor is) or local (same as a mouse-click)
+ * in both cases a user-defined function will be called
+ *
+ * in short the class works by storing every element that can be clicked / scrolled on in a list
+ * everytime a button is clicked or the mousewheel is turned, the list gets traversed and every element checked if it is clicked / scrolled on
+ * checking happens by casting a ray from the camera through the mouse-cursor and testing if it intersects the sphere of the element
+ *
+ * to make it work, one has to add mouseapi in LINK_LIBRARIES in the file CMakeLists.txt of the level
+ * see CMakeLists.txt in MouseAPIExample
+ *
+ * MouseAPI: C++ API to access Mouse
+ * MouseGametype: Enable Mouse Cursor & Prevent that each click kills Player if no spaceship is used
+ * MouseAPICursor: Internal API which implements cursor. Usable from custom Gametype (not necessary if MouseGametype is used):
+ *                 add "this->setHUDTemplate("MouseCursor");" in constructor of Gametype. (Or by inheritance)
+ */
+
+namespace orxonox
+{
+typedef uint ClickableElementID;
+typedef uint ScrollableElementID;
+
+class MouseAPI : public InputHandler, public Singleton<MouseAPI>,public Tickable
+{
+friend class Singleton<MouseAPI>;
+
+private:
+
+    // Elements that can be clicked on are stored as clickableElement
+    struct clickableElement
+    {
+        ClickableElementID id;
+        Vector3 position;
+        float radius;
+        std::list<MouseButtonCode::ByEnum> buttons;
+        std::function<void(MouseButtonCode::ByEnum button)> onClickedFunction;
+        clickableElement(ClickableElementID id,const Vector3& position,float radius,const std::list<MouseButtonCode::ByEnum>& buttons,std::function<void(MouseButtonCode::ByEnum button)> onClickedFunction):id(id),position(position),
+            radius(radius), buttons(buttons), onClickedFunction(onClickedFunction){}
+    };
+
+    /* Elements that can be "scrolled on" are stored as scrollElement
+     * there are 2 diffrent types, hence the overloaded constructor:
+     *      1) the function is called whenever one scrolls, independet from position of element and cursor
+     *      2) the function is only called when the cursor is placed over the element (identical to the clickableElement)
+     */
+    struct scrollElement
+    {
+        ScrollableElementID id;
+        bool considerPosition;
+        Vector3 position;
+        float radius;
+        std::function<void(int abs,int rel,const IntVector2& mousePos)> onScrolledFunction;
+        // constructor for scrollElement type 1
+        scrollElement(ScrollableElementID id,std::function<void(int abs,int rel,const IntVector2& mousePos)> onScrolledFunction):id(id),considerPosition(false),
+            onScrolledFunction(onScrolledFunction){}
+        // constructor fro scrollElement type 2
+        scrollElement(ScrollableElementID id,const Vector3& position, float radius, std::function<void(int abs,int rel,const IntVector2& mousePos)> onScrolledFunction):id(id),considerPosition(true),
+            position(position), radius(radius), onScrolledFunction(onScrolledFunction){}
+    };
+
+    // pointer to our class (required by singleton)
+    static MouseAPI* singletonPtr_s;
+
+    // lists with all our Elements that can be clicked / scrolled on
+    std::list<clickableElement> clickEvents;
+    std::list<scrollElement> scrollEvents;
+
+    // pointer to the game-camera
+    Ogre::Camera *cam ;
+
+    // pointer to our input-state
+    InputState* state;
+
+    // true => MouseAPI has been activated, false => MouseAPI has not been activated
+    bool active = false;
+
+    //true => allow ship-controller to get mouse input; Default: false; Gets reset after each transition from deactivated to activated
+    bool gameInputActivated = false;
+
+
+public:
+
+    MouseAPI();
+    ~MouseAPI();
+
+    virtual void tick(float dt) override;
+
+    /* everytime a mousebutton is pressed, this function is called and checks if the cursor is over an element that can be clicked on
+     * if yes, the function associated with this element will be called with the corresponding button as argument
+     */
+    virtual void buttonPressed (MouseButtonCode::ByEnum button) override;
+
+    // not used
+    virtual void buttonReleased(MouseButtonCode::ByEnum button)  override{}
+
+    // not used
+    virtual void buttonHeld    (MouseButtonCode::ByEnum button) override{}
+
+    // not used
+    virtual void mouseMoved    (IntVector2 abs, IntVector2 rel, IntVector2 clippingSize) override;
+
+    /* everytime someone scrolls, this function is called and checks for all scrollElements, wheter a position is required and wheter the curser is over said position
+     * if yes, the function associated with this element will be called
+     * if there is an element without position-requirement and an element the cursor is over, both their functions will be called
+     */
+    virtual void mouseScrolled (int abs, int rel) override;
+
+    /* add a clickableElement to the list
+     * see mouseapiexample for an example-implementation
+     * Arguments:
+     *      position: the point that needs to be clicked
+     *      radius: radius of the sphere around the position; if the cursor is inside this radius, the function will be executed (because clicking on a single point is pretty hard)
+     *      buttons: the function will only be called, if one of these buttons is pressed
+     *      onClickedFunction: the function that will be called
+     */
+    ClickableElementID addClickableElement(const Vector3& position,float radius,const std::list<MouseButtonCode::ByEnum>& buttons,std::function<void(MouseButtonCode::ByEnum button)>  onClickedFunction);
+
+    /* add a scrollElement to the list
+     * see mouseapiexample for an example-implementation
+     * Arguments:
+     *      position: the point the cursor needs to be over
+     *      radius: radius of the sphere around the position; if the cursor is inside this radius, the function will be executed
+     *      onScrolledFunction: the function that will be called
+     */
+    ScrollableElementID addScrollElement(const Vector3& position,float radius,std::function<void(int abs,int rel,const IntVector2& mousePos)> onScrolledFunction);
+
+    /* add a scrollElement to the list
+     * Arguments:
+     *      onScrolledFunction: the function that will be called, no matter where the cursor is
+     */
+    ScrollableElementID addScrollElement(std::function<void(int abs,int rel,const IntVector2& mousePos)> onScrolledFunction);
+
+    /* change the position of a clickableElement
+     * Arguments:
+     *      id: the ClickableElementID of the element
+     *      position: the new position of the element
+     * Return:
+     *      true if successfull
+     *      false if not successfull
+     */
+    bool changePositionOfClickableElement(ClickableElementID id,const Vector3& position);
+
+    /* change the position of a scrollElement
+     * Arguments:
+     *      id: the ScrollableElementID of the element
+     *      position: the new position of the element
+     * Return:
+     *      true if successfull
+     *      false if not successfull
+     */
+    bool changePositionOfScrollableElement(ScrollableElementID id,const Vector3& position);
+
+    /* change the radius of a clickableElement
+     * Arguments:
+     *      id: the ClickableElementID of the element
+     *      radius: the new radius of the element
+     * Return:
+     *      true if successfull
+     *      false if not successfull
+     */
+    bool changeRadiusOfClickableElement(ClickableElementID id,float radius);
+
+    /* change the radius of a scrollElement
+     * Arguments:
+     *      id: the ScrollableElementID of the element
+     *      radius: the new radius of the element
+     * Return:
+     *      true if successfull
+     *      false if not successfull
+     */
+    bool changeRadiusOfScrollableElement(ScrollableElementID id,float radius);
+
+    /* remove a clickableElement
+     * Arguments:
+     *      id: the ClickableElementID of the element
+     * Return:
+     *      true if successfull
+     *      false if not successfull
+     */
+    bool deleteClickableElement(ClickableElementID id);
+
+    /* remove a scrollElement
+     * Arguments:
+     *      id: the ScrollableElementID of the element
+     * Return:
+     *      true if successfull
+     *      false if not successfull
+     */
+    bool deleteScrollableElement(ScrollableElementID id);
+
+    /* get the current radius of a clickableElement
+     * Arguments:
+     *      id: the ClickableElementID of the element
+     */
+    float getRadiusClick(ClickableElementID id);
+
+    /* get the current radius of a scrollElement
+     * Arguments:
+     *      id: the ScrollableElementID of the element
+     */
+    float getRadiusScroll(ScrollableElementID id);
+
+    /* get the current relative Position of the cursor
+     * returns a value between 0 and 1 for both x and y component
+     * (0,0) top left corner, (1,1) bottom right corner
+     */
+    Vector2 getMousePosition();
+
+    /* activate the MouseAPI
+     * has to be called after the level has been created (i.e. inside the xml-port
+     * can be called multiple times, since the function checks the status of MouseAPI and does nothing if it already is active
+     */
+    void activate();
+
+    // returns true if MouseAPI is active, false otherwise
+    static bool isActive(){return singletonPtr_s != nullptr && getInstance().active;}
+
+    /* deactivate the MouseAPI
+     * has to be called, when the level gets closed (i.e. inside the level-destructor)
+     * the function does nothing if MouseAPI is not active
+     */
+    void deactivate();
+
+    /*
+     * allow ship-controller to get mouse input
+     */
+    void activateGameInput();
+
+    /*
+     * do not allow ship-controller to get mouse input
+     * This is the default. This gets set after each transition from deactivated to activated
+     */
+    void deactivateGameInput();
+};
+}
+#endif // MOUSEAPI_H
Index: /code/branches/Presentation_FS19/src/modules/MouseAPI/mouseapicursor.cc
===================================================================
--- /code/branches/Presentation_FS19/src/modules/MouseAPI/mouseapicursor.cc	(revision 12407)
+++ /code/branches/Presentation_FS19/src/modules/MouseAPI/mouseapicursor.cc	(revision 12407)
@@ -0,0 +1,45 @@
+#include "mouseapicursor.h"
+
+namespace orxonox{
+
+RegisterClass(MouseAPICursor);
+
+MouseAPICursor::MouseAPICursor(Context* context):OrxonoxOverlay(context)
+{
+    RegisterObject(MouseAPICursor);
+    cursor = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton()
+                                                          .createOverlayElement("Panel", "MouseAPI_cursor_" + getUniqueNumberString()));
+    updateCursor();
+    overlay_->add2D(this->cursor);
+    scale(Vector2(0.03,0.03));
+    setVisible(true);
+}
+
+MouseAPICursor::~MouseAPICursor()
+{
+    if(running)
+        MouseAPI::getInstance().deactivate();
+    if(this->isInitialized())
+        Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->cursor);
+}
+
+void MouseAPICursor::XMLPort(ticpp::Element &xmlelement, XMLPort::Mode mode)
+{
+    MouseAPI::getInstance().activate();
+    running = true;
+    SUPER(MouseAPICursor, XMLPort, xmlelement, mode);
+    XMLPortParam(MouseAPICursor, "cursorShape", setCursorName, getCursorName,xmlelement, mode);
+    XMLPortParam(MouseAPICursor, "cursorColor", setCursorColor, getCursorColor,xmlelement, mode);
+}
+
+void MouseAPICursor::tick(float dt)
+{
+    if(running)
+    {
+        this->cursor->show();
+        this->show();
+        this->setPosition(MouseAPI::getInstance().getMousePosition());
+    }
+}
+
+}
Index: /code/branches/Presentation_FS19/src/modules/MouseAPI/mouseapicursor.h
===================================================================
--- /code/branches/Presentation_FS19/src/modules/MouseAPI/mouseapicursor.h	(revision 12407)
+++ /code/branches/Presentation_FS19/src/modules/MouseAPI/mouseapicursor.h	(revision 12407)
@@ -0,0 +1,68 @@
+#ifndef MOUSEAPICURSOR_H
+#define MOUSEAPICURSOR_H
+#include <overlays/OrxonoxOverlay.h>
+#include <core/CoreIncludes.h>
+#include <tools/interfaces/Tickable.h>
+#include "mouseapi.h"
+#include <core/XMLPort.h>
+
+#if OGRE_VERSION >= 0x010900
+#   include <Overlay/OgreOverlayManager.h>
+#   include <Overlay/OgrePanelOverlayElement.h>
+#else
+#   include <OgreOverlayManager.h>
+#   include <OgrePanelOverlayElement.h>
+#endif
+
+#include <tools/TextureGenerator.h>
+#include <util/StringUtils.h>
+
+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
Index: /code/branches/Presentation_FS19/src/modules/MouseAPI/mousegametype.cc
===================================================================
--- /code/branches/Presentation_FS19/src/modules/MouseAPI/mousegametype.cc	(revision 12407)
+++ /code/branches/Presentation_FS19/src/modules/MouseAPI/mousegametype.cc	(revision 12407)
@@ -0,0 +1,40 @@
+#include "mousegametype.h"
+namespace orxonox
+{
+RegisterUnloadableClass(MouseGametype);
+MouseGametype::MouseGametype(Context* context):Gametype(context)
+{
+    RegisterObject(MouseGametype);
+    player_ =nullptr;
+
+    //Activate the Mouse Cursor
+    this->setHUDTemplate("MouseCursor");
+
+}
+
+void MouseGametype::start()
+{
+    Gametype::start();
+}
+
+void MouseGametype::spawnPlayersIfRequested()
+{
+    // Spawn a human player.
+    for (const auto& mapEntry : this->players_)
+        if (mapEntry.first->isHumanPlayer() && (mapEntry.first->isReadyToSpawn() || this->bForceSpawn_))
+            this->spawnPlayer(mapEntry.first);
+}
+
+
+void MouseGametype::spawnPlayer(PlayerInfo* player)
+{
+    assert(player);
+    //Only Spawn once
+    if(this->player_ == nullptr)
+    {
+        this->player_ = player;
+        this->players_[player].state_ = PlayerState::Alive;
+    }
+}
+
+}
Index: /code/branches/Presentation_FS19/src/modules/MouseAPI/mousegametype.h
===================================================================
--- /code/branches/Presentation_FS19/src/modules/MouseAPI/mousegametype.h	(revision 12407)
+++ /code/branches/Presentation_FS19/src/modules/MouseAPI/mousegametype.h	(revision 12407)
@@ -0,0 +1,25 @@
+#ifndef MOUSEGAMETYPE_H
+#define MOUSEGAMETYPE_H
+#include <gametypes/Gametype.h>
+#include <core/CoreIncludes.h>
+#include <infos/PlayerInfo.h>
+#include <core/input/InputState.h>
+#include <core/GUIManager.h>
+
+namespace orxonox
+{
+
+class MouseGametype: public Gametype
+{
+public:
+    MouseGametype(Context *context);
+    virtual void start() override;
+    virtual void spawnPlayer(PlayerInfo* player) override;
+    virtual void spawnPlayersIfRequested()override;
+private:
+    PlayerInfo* player_ ;
+    CEGUI::MouseCursor *cursor;
+};
+
+}
+#endif // MOUSEGAMETYPE_H
Index: /code/branches/Presentation_FS19/src/modules/MouseAPIExample/CMakeLists.txt
===================================================================
--- /code/branches/Presentation_FS19/src/modules/MouseAPIExample/CMakeLists.txt	(revision 12407)
+++ /code/branches/Presentation_FS19/src/modules/MouseAPIExample/CMakeLists.txt	(revision 12407)
@@ -0,0 +1,14 @@
+SET_SOURCE_FILES(MOUSEAPIEXAMPLE_SRC_FILES
+  mouseapiexample.cc
+)
+
+
+ORXONOX_ADD_LIBRARY(mouseapitest
+  MODULE
+  FIND_HEADER_FILES
+  PCH_FILE
+  LINK_LIBRARIES
+    orxonox
+    mouseapi
+  SOURCE_FILES ${MOUSEAPIEXAMPLE_SRC_FILES}
+)
Index: /code/branches/Presentation_FS19/src/modules/MouseAPIExample/mouseapiexample.cc
===================================================================
--- /code/branches/Presentation_FS19/src/modules/MouseAPIExample/mouseapiexample.cc	(revision 12407)
+++ /code/branches/Presentation_FS19/src/modules/MouseAPIExample/mouseapiexample.cc	(revision 12407)
@@ -0,0 +1,106 @@
+#include "mouseapiexample.h"
+
+namespace orxonox
+{
+
+RegisterClass(MouseAPIExample);
+
+MouseAPIExample::MouseAPIExample(Context* context) : ControllableEntity(context)
+{
+    RegisterObject(MouseAPIExample);
+}
+
+MouseAPIExample::~MouseAPIExample()
+{
+    if(MouseAPI::isActive())
+        MouseAPI::getInstance().deactivate();
+}
+
+// change the size of the cube by a random number between 0.5 and 5 by clicking on it
+void MouseAPIExample::changesizeonclick(MouseButtonCode::ByEnum mouse)
+{
+    // generate random number between 0.5 and 5
+    float randomnumber = (rand()%10+1)/2.0;
+    // scale of the cube with this random number
+    this->setScale(randomnumber);
+    // change the radius of the clickableElement to the new size
+    MouseAPI::getInstance().changeRadiusOfClickableElement(cubeid,randomnumber*10);
+}
+
+// change the size of the sphere by scrolling on it
+void MouseAPIExample::changesizeonscroll(int abs,int rel,const IntVector2& mousePos)
+{
+    // get current radius of the sphere
+    float curRadius = MouseAPI::getInstance().getRadiusScroll(sphereid);
+    // set factor to 120% or 80% of the current size, depending on increase or decrease
+    float factor = curRadius/10*(1+rel/600.0);
+    // return if factor is outside of range [0.5,5] (limit size)
+    if(factor > 5 || factor < 0.5) return;
+    //scale the sphere with this factor and change the radius
+    this->setScale(factor);
+    MouseAPI::getInstance().changeRadiusOfScrollableElement(sphereid,factor*10);
+}
+
+// scale the z-component up / down with left-mouse / right-mouse (max. factor 2, min. factor 1)
+void MouseAPIExample::clickleft(MouseButtonCode::ByEnum mouse)
+{
+     // action after left-click
+     if (mouse == MouseButtonCode::Left)
+     {
+         Vector3 scale = this->getScale3D();
+         if (scale.z <= 2) this->setScale3D(scale.x,scale.y,scale.z+0.1);
+     }
+     // action after right-click
+     else if (mouse == MouseButtonCode::Right)
+     {
+         Vector3 scale = this->getScale3D();
+         if (scale.z > 1) this->setScale3D(scale.x,scale.y,scale.z-0.1);
+     }
+}
+
+// scale the y-component up / down with left-mouse / right-mouse (max. factor 2, min. factor 1)
+void MouseAPIExample::clickright(MouseButtonCode::ByEnum mouse)
+{
+    // action after left-click
+    if (mouse == MouseButtonCode::Left)
+    {
+        Vector3 scale = this->getScale3D();
+        if (scale.y <= 2) this->setScale3D(scale.x,scale.y+0.1,scale.z);
+    }
+    // action after right-click
+    else if (mouse == MouseButtonCode::Right)
+    {
+        Vector3 scale = this->getScale3D();
+        if (scale.y > 1) this->setScale3D(scale.x,scale.y-0.1,scale.z);
+    }
+}
+
+// standard XML-Port
+void MouseAPIExample::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+{
+    SUPER(MouseAPIExample, XMLPort, xmlelement, mode);
+
+    // differentiate between several elements by an identifier "id"
+    XMLPortParam(MouseAPIExample, "id", setId, getId, xmlelement, mode);
+    if(this->getId() == 1) // id == 1; cube
+    {
+        // add the cube to the list with clickable elements, set the radius to 10, define the function changesizeonclick to be called after a left-click
+        cubeid = MouseAPI::getInstance().addClickableElement(this->getWorldPosition(),10,std::list<MouseButtonCode::ByEnum>{MouseButtonCode::Left},[this](MouseButtonCode::ByEnum mouse){this->changesizeonclick(mouse);});
+    }
+    else if(this->getId() == 2) // id == 2; sphere
+    {
+        // add the sphere to the list with scrollable Elements, set the radius to 10, define the function changesizeonscroll to be called while scrolling
+        sphereid = MouseAPI::getInstance().addScrollElement(this->getWorldPosition(), 10, [this](int abs, int rel, const IntVector2& mousePos){this->changesizeonscroll(abs,rel,mousePos);});
+    }
+    else if(this->getId() == 3) // id == 3; long block
+    {
+        // add the left and right part of the long block to the list with clickable Elements and define clickleft/clickright to be called
+        // (Position (0,70,+/-70) is hardcoded)
+        leftid = MouseAPI::getInstance().addClickableElement(Vector3(0,70,-70),20,std::list<MouseButtonCode::ByEnum>{MouseButtonCode::Left,MouseButtonCode::Right},[this](MouseButtonCode::ByEnum mouse){this->clickleft(mouse);});
+        rightid = MouseAPI::getInstance().addClickableElement(Vector3(0,70,70),20,std::list<MouseButtonCode::ByEnum>{MouseButtonCode::Left,MouseButtonCode::Right},[this](MouseButtonCode::ByEnum mouse){this->clickright(mouse);});
+    }
+
+    // activate MouseAPI
+    MouseAPI::getInstance().activate();
+}
+}
Index: /code/branches/Presentation_FS19/src/modules/MouseAPIExample/mouseapiexample.h
===================================================================
--- /code/branches/Presentation_FS19/src/modules/MouseAPIExample/mouseapiexample.h	(revision 12407)
+++ /code/branches/Presentation_FS19/src/modules/MouseAPIExample/mouseapiexample.h	(revision 12407)
@@ -0,0 +1,33 @@
+#ifndef MOUSEAPIEXAMPLE_H
+#define MOUSEAPIEXAMPLE_H
+
+#include <core/XMLPort.h>
+#include <MouseAPI/mouseapi.h>
+#include <core/CoreIncludes.h>
+#include <worldentities/ControllableEntity.h>
+#include <list>
+
+namespace orxonox
+{
+class MouseAPIExample : public ControllableEntity
+{
+public:
+    MouseAPIExample(Context *context);
+    ~MouseAPIExample();
+    virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+    void changesizeonclick(MouseButtonCode::ByEnum mouse);
+    void changesizeonscroll(int abs,int rel,const IntVector2& mousePos);
+    void clickleft(MouseButtonCode::ByEnum mouse);
+    void clickright(MouseButtonCode::ByEnum mouse);
+    inline void setId(int id)
+        { this->id = id; }
+    inline int getId() const
+        { return this->id; }
+private:
+    int id;
+    ClickableElementID cubeid;
+    ScrollableElementID sphereid;
+    ClickableElementID leftid,rightid;
+};
+}
+#endif // MOUSEAPIEXAMPLE_H
