class helpAction: public ModAction, CoordAction { public: helpAction(const std::string& name) : InputAction(name), ModAction(name), CoordAction(name) {} void doPress() { std::cout << "help action pressed " << std::endl; std::cout << std::endl; } void doRelease() { std::cout << "help action released " << std::endl; std::cout << std::endl; } void runCoord(unsigned long int x, unsigned long int y, int xrel, int yrel) { std::cout << "help x: " << x << " y: " << y << " xrel: " << xrel <<" yrel: " << yrel << std::endl; }; };
system_ptr = new cmil::SDL::SDLSystem();
m_actor = new cmil::ContextActor(system_ptr); using cmil::Ev; m_actor->addNormal( Ev("F1") << helpAction)); m_actor->addCombo( Ev("A") << Ev("B") << Ev("Up") << Ev("Down") << specialKick); system_ptr -> attach(m_actor);
For a detailed example, see demo/demo.cpp