User Tools

Site Tools


en:orx:config:settings_main:touch_events

Touch events

Touch inputs are done as events. To hook them up during initialisation:

	orxEvent_AddHandler(orxEVENT_TYPE_SYSTEM, SomeControlUpdateFunction);

Then to test for them in your callback:

	if (_pstEvent->eType == orxEVENT_TYPE_SYSTEM){
		if(_pstEvent->eID == orxSYSTEM_EVENT_TOUCH_BEGIN ){

			orxSYSTEM_EVENT_PAYLOAD *payload;
			payload = (orxSYSTEM_EVENT_PAYLOAD *) _pstEvent->pstPayload;
			orxVECTOR localTouchVector = { 0,0,0 };
			localTouchVector.fX = payload->stTouch.fX;
			localTouchVector.fY = payload->stTouch.fY;	


		} else if(_pstEvent->eID == orxSYSTEM_EVENT_TOUCH_END  ){

			orxLOG("EVENT_TOUCH_MOVE");

		} else if(_pstEvent->eID == orxSYSTEM_EVENT_TOUCH_MOVE  ){

			orxLOG("EVENT_TOUCH_MOVE");

		}
	}
en/orx/config/settings_main/touch_events.txt · Last modified: 2017/05/30 00:50 (8 years ago) by 127.0.0.1