public SKCanvasViewRendererBase() { #if __ANDROID__ touchHandler = new SKTouchHandler( args => ((ISKCanvasViewController)Element).OnTouch(args), coord => Element.IgnorePixelScaling ? (float)Context.FromPixels(coord) : coord); #elif __IOS__ touchHandler = new SKTouchHandler( args => ((ISKCanvasViewController)Element).OnTouch(args), coord => Element.IgnorePixelScaling ? coord : coord * Control.ContentScaleFactor); #elif __MACOS__ touchHandler = new SKTouchHandler( args => ((ISKCanvasViewController)Element).OnTouch(args), coord => Element.IgnorePixelScaling ? coord : coord * Control.Window.BackingScaleFactor); #elif WINDOWS_UWP touchHandler = new SKTouchHandler( args => ((ISKCanvasViewController)Element).OnTouch(args), coord => Element.IgnorePixelScaling ? coord : (float)(coord * Control.Dpi)); #else touchHandler = new SKTouchHandler( args => ((ISKCanvasViewController)Element).OnTouch(args), //coord => Element.IgnorePixelScaling ? coord : (float)(coord * Control.Dpi)); coord => coord); #endif }
public SKGLViewRendererBase() { #if __ANDROID__ touchHandler = new SKTouchHandler( args => ((ISKGLViewController)Element).OnTouch(args), coord => coord); #elif __IOS__ touchHandler = new SKTouchHandler( args => ((ISKGLViewController)Element).OnTouch(args), coord => coord * Control.ContentScaleFactor); #elif __MACOS__ touchHandler = new SKTouchHandler( args => ((ISKGLViewController)Element).OnTouch(args), coord => coord * Control.Window.BackingScaleFactor); #elif WINDOWS_UWP touchHandler = new SKTouchHandler( args => ((ISKGLViewController)Element).OnTouch(args), coord => (float)(coord * Control.ContentsScale)); #endif }
private void Initialize() { #if __ANDROID__ touchHandler = new SKTouchHandler( args => ((ISKCanvasViewController)Element).OnTouch(args), coord => Element.IgnorePixelScaling ? (float)Context.FromPixels(coord) : coord); #elif __IOS__ touchHandler = new SKTouchHandler( args => ((ISKCanvasViewController)Element).OnTouch(args), coord => Element.IgnorePixelScaling ? coord : coord * Control.ContentScaleFactor); #elif __MACOS__ touchHandler = new SKTouchHandler( args => ((ISKCanvasViewController)Element).OnTouch(args), coord => Element.IgnorePixelScaling ? coord : coord * Control.Window.BackingScaleFactor); #elif WINDOWS_UWP touchHandler = new SKTouchHandler( args => ((ISKCanvasViewController)Element).OnTouch(args), coord => Element.IgnorePixelScaling ? coord : (float)(coord * Control.Dpi)); #elif TIZEN4_0 touchHandler = new SKTouchHandler( args => ((ISKCanvasViewController)Element).OnTouch(args), coord => Element.IgnorePixelScaling ? Tizen.ScalingInfo.FromPixel(coord) : coord); #endif }
private void Initialize() { #if __ANDROID__ touchHandler = new SKTouchHandler( args => ((ISKGLViewController)Element).OnTouch(args), coord => coord); #elif __IOS__ touchHandler = new SKTouchHandler( args => ((ISKGLViewController)Element).OnTouch(args), coord => coord * Control.ContentScaleFactor); #elif __MACOS__ touchHandler = new SKTouchHandler( args => ((ISKGLViewController)Element).OnTouch(args), coord => coord * Control.Window.BackingScaleFactor); #elif WINDOWS_UWP touchHandler = new SKTouchHandler( args => ((ISKGLViewController)Element).OnTouch(args), coord => (float)(coord * Control.ContentsScale)); #elif TIZEN4_0 touchHandler = new SKTouchHandler( args => ((ISKGLViewController)Element).OnTouch(args), coord => coord); #endif }
private void Initialize() { touchHandler = new SKTouchHandler( args => ((ISKCanvasViewController)Element).OnTouch(args), (x, y) => GetScaledCoord(x, y)); }
public MomentumHandler(SKTouchHandler h) { handler = h; }