protected override void Update() { base.Update(); //updateServerProperties(); } private void OnCursorAdded(object sender, TUIOCursorEventArgs tuioCursorEventArgs)
private void OnCursorAdded(object sender, TUIOCursorEventArgs tuioCursorEventArgs) { var cursor = tuioCursorEventArgs.Cursor; lock (sync) { var x = cursor.X * ScreenWidth; var y = (1 - cursor.Y) * ScreenHeight; cursorToInternalId.Add(cursor, beginTouch(new Vector2(x, y))); } }
var cursor = tuioCursorEventArgs.Cursor; lock (sync) { var x = cursor.X*ScreenWidth; var y = (1 - cursor.Y)*ScreenHeight; cursorToInternalId.Add(cursor, beginTouch(new Vector2(x, y))); } } private void OnCursorRemoved(object sender, TUIOCursorEventArgs tuioCursorEventArgs) { var cursor = tuioCursorEventArgs.Cursor;
private void OnCursorRemoved(object sender, TUIOCursorEventArgs tuioCursorEventArgs) { var cursor = tuioCursorEventArgs.Cursor; lock (sync) { int existingCursor; if (!cursorToInternalId.TryGetValue(cursor, out existingCursor)) { return; } cursorToInternalId.Remove(cursor); endTouch(existingCursor); } }
private void OnCursorUpdated(object sender, TUIOCursorEventArgs tuioCursorEventArgs) { var cursor = tuioCursorEventArgs.Cursor; lock (sync) { int existingCursor; if (!cursorToInternalId.TryGetValue(cursor, out existingCursor)) { return; } var x = cursor.X * ScreenWidth; var y = (1 - cursor.Y) * ScreenHeight; moveTouch(existingCursor, new Vector2(x, y)); } }
int existingCursor; if (!cursorToInternalId.TryGetValue(cursor, out existingCursor)) return; cursorToInternalId.Remove(cursor); endTouch(existingCursor); } } private void OnCursorUpdated(object sender, TUIOCursorEventArgs tuioCursorEventArgs) { var cursor = tuioCursorEventArgs.Cursor; lock (sync) { int existingCursor;