Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 4, 2019, 5:46:25 PM (6 years ago)
Author:
mkarpf
Message:

Example Level with scaling

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  
    99{
    1010    RegisterObject(MouseAPIExample);
    11     //mouseapi = MouseAPI::getInstance();
    1211
    1312}
     
    1918}
    2019
    21 void MouseAPIExample::tick(float dt)
    22 {
    23     ControllableEntity::tick(dt);
    24 
    25 }
    26 
    2720void MouseAPIExample::testfunction(MouseButtonCode::ByEnum mouse)
    2821{
    29     orxout() << "MouseAPIExample: Object Clicked\n";
     22    float randomnumber = (rand()%100 + 1)/100.0;
     23    this->setScale(randomnumber);
     24    orxout() << "Blah\n";
     25
    3026}
    3127
     
    3531    MouseAPI::getInstance().activate();
    3632    MouseAPI::getInstance().addClickableObject(this->getWorldPosition(),10,std::list<MouseButtonCode::ByEnum>{MouseButtonCode::Left},[this](MouseButtonCode::ByEnum mouse){this->testfunction(mouse);});
    37 
    3833}
    3934}
  • code/branches/MouseAPI_FS19/src/modules/MouseAPI/mouseapiexample.h

    r12271 r12285  
    99#include "worldentities/ControllableEntity.h"
    1010#include "core/CoreIncludes.h"
     11#include <list>
     12#include <stdlib.h>
    1113
    1214namespace orxonox
     
    1921    virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    2022    void testfunction(MouseButtonCode::ByEnum mouse);
    21     virtual void tick(float dt) override;
     23    static std::list<MouseAPIExample> blocks;
    2224};
    2325}
Note: See TracChangeset for help on using the changeset viewer.