private void Initialize() { // entities m_arm = new Arm(); m_finger = new Finger(); // processing & tracking m_processor = new TouchProcessor(m_arm, m_finger); m_optiTrack = new OptiTrack(); // models m_models = new Dictionary <ModelType, LinearModel>(); LinearModel horizontalModel = new LinearModel(Constants.Models.HorizontalRows, Constants.Models.HorizontalColumns, ModelDirection.Landscape); horizontalModel.Load(Constants.Models.HorizontalModelFileName); m_models.Add(ModelType.Horizontal, horizontalModel); LinearModel verticalModel = new LinearModel(Constants.Models.VerticalRows, Constants.Models.VerticalColumns, ModelDirection.Portrait); verticalModel.Load(Constants.Models.VerticalModelFileName); m_models.Add(ModelType.Vertical, verticalModel); LinearModel tracingModel = new LinearModel(Constants.Models.TracingRows, Constants.Models.TracingColumns, ModelDirection.Landscape); tracingModel.Load(Constants.Models.TracingModelFileName); m_models.Add(ModelType.Tracing, tracingModel); m_arm.AddModel(horizontalModel, ModelType.Horizontal, Constants.Colors.HorizontalGridModelColor); m_arm.AddModel(verticalModel, ModelType.Vertical, Constants.Colors.VerticalGridModelColor); m_arm.AddModel(tracingModel, ModelType.Tracing, Constants.Colors.TracingGridModelColor); }
void Awake() { base.Awake(); Instance = this; touchProcessor = TouchProcessor.Instance; nextTimeToSuggest = delay * 2; }
public GameBase(Orientation orientation) : base() { _instance = this; GraphicsDeviceManager graphics = new GraphicsDeviceManager(this); if (orientation == Orientation.Portrait) { graphics.SupportedOrientations = DisplayOrientation.Portrait; } else { graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight; } graphics.IsFullScreen = true; Content.RootDirectory = "Content"; GlobalTimerController.ClearInstance(); TouchProcessor.ClearInstance(); _scenes = new Dictionary <Type, Scene>(); _currentScene = null; _tombstoneFileName = DefaultTombstoneFileName; _sceneTransitionCrossFadeTextureName = ""; }
private TouchProcessor InitializeTouchProcessor(ITouchDevice touchDevice) { var processor = new TouchProcessor(touchDevice); processor.PointerDown += TouchedDown; processor.PointerUp += TouchedUp; return(processor); }
private async Task InitializeTouch(CoreDispatcher dispatcher) { var touchScreen = await TouchDevice.Get(); var touchProcessor = new TouchProcessor(touchScreen, dispatcher); touchProcessor.PointerDown += OnPointerDown; touchProcessor.PointerMoved += OnPointerMoved; touchProcessor.PointerUp += OnPointerUp; touchProcessor.Start(); }
public async Task InitializeAsync() { if (!_isInitialized) { _isInitialized = true; if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.IoT") { _tsc2046 = await InitializeTouchControllerAsync(); _processor = InitializeTouchProcessor(_tsc2046); } } }
public AndroidViewController(Android.Content.Context context, Type rootClass) : base(context) { Debug.WriteLine("Sparrow: Starting"); _rootClass = rootClass; touchProcessor = new TouchProcessor(); _Holder = Holder; _Holder.AddCallback(this); AndroidContext = context; TextureLoader._context = context; RequestFocus(); FocusableInTouchMode = true; }
public DesktopViewController(Type rootClass, uint windowWidth, uint windowHeight) { _width = windowWidth; _height = windowHeight; _rootClass = rootClass; _touchProcessor = new TouchProcessor(); using NativeWindow nativeWindow = NativeWindow.Create(); _nativeWindow = nativeWindow; nativeWindow.ContextCreated += NativeWindow_ContextCreated; nativeWindow.ContextProfile = NativeWindow.ProfileType.Core; nativeWindow.DebugContext = NativeWindow.AttributePermission.Enabled; nativeWindow.Create(0, 0, windowWidth, windowHeight, NativeWindowStyle.Resizeable); nativeWindow.Show(); nativeWindow.Run(); }
private async void Init() { tsc2046 = await TouchPanels.Devices.Tsc2046.GetDefaultAsync(); try { await tsc2046.LoadCalibrationAsync(CalibrationFilename); } catch (System.IO.FileNotFoundException) { await CalibrateTouch(); //Initiate calibration if we don't have a calibration on file } catch (System.UnauthorizedAccessException) { //No access to documents folder await new Windows.UI.Popups.MessageDialog("Make sure the application manifest specifies access to the documents folder and declares the file type association for the calibration file.", "Configuration Error").ShowAsync(); throw; } //Load up the touch processor and listen for touch events processor = new TouchProcessor(tsc2046); processor.PointerDown += Processor_PointerDown; processor.PointerMoved += Processor_PointerMoved; processor.PointerUp += Processor_PointerUp; }
void Awake() { Instance = this; }