
You could also replace this with cam = Camera.main but I prefer to use GetComponent in case you ever add another camera to your game or remove the MainCamera tag from your camera. This should be familiar to you if you’ve used Unity before, we’re simply grabbing the Camera component of the GameObject. Next up we have the Awake function where we’ll grab a reference to the camera: This property, unlike the lastPanPosition, is only applicable in touch-mode, and is not used for mouse controls. lastZoomPositions, like the lastPanPosition, tracks the location of the user’s fingers during the last frame where they were zooming the camera.wasZoomingLastFrame is used in touch-mode only to determine if the camera was being zoomed in the last frame.This is not used at all for mouse controls, as there is typically only one mouse being used. panFingerId tracks the ID of the finger being used to pan the camera, in touch-mode only.lastPanPosition is the location of the user’s finger or mouse during the last frame where they were panning the camera.cam will simply store a reference to our Camera.Let’s break down these properties one-by-one: Private Vector2 lastZoomPositions // Touch mode only Private bool wasZoomingLastFrame // Touch mode only Private int panFingerId // Touch mode only We’ll also want to keep a reference to the actual Camera so we can modify its properties as the user interacts: Next up we’re going to need some instance variables to keep track of the camera state between frames. For Byter there is no y-axis movement, so there’s no need to define bounds for that. Similarly, BoundsZ will control the z-axis, and ZoomBounds will be used for the zooming. For the case of BoundsX for example, I’m keeping the camera between -10 and 5 on the x-axis. The first value represents the lower bound, and the second represents the upper bound. The boundaries are defined as float arrays each with a length of two. Private static readonly float BoundsX = new float Private static readonly float ZoomSpeedMouse = 0.5f Private static readonly float ZoomSpeedTouch = 0.1f Private static readonly float PanSpeed = 20f These values will be different depending on your game and desires, but here’s how I defined them: These allow me to restrict the camera to a certain area of the scene, and to limit how much you can zoom the camera. The first thing I did was define some boundaries for panning and zooming, and the speed at which the camera moves and zooms.
Bluestacks 3 pinch zoom code#
The ScriptĪll of the code below is contained within the CameraHandler script, and there is no need for logic outside of this class unless you want further customization.
Bluestacks 3 pinch zoom software#
NOTE: The software application must support this feature.įollow these steps to enable or disable the setting: This feature is similar to functions on certain cell phones that utilize the Android™ operating system, or Apple® iPhone® mobile digital device. Pinch Zoom is a new feature of the notebook touchpad that allows the option to zoom in or out of a picture by moving two fingers towards or away from each other.
Bluestacks 3 pinch zoom upgrade#
This function will be disabled and removed from the VAIO Control Center during the Windows 10 upgrade process. NOTE: The Windows® 10 operating system does not support the Multi-touch gesture function. Check Applicable Products and Categories for details. IMPORTANT: This article applies only to specific products and/or operating systems.
