We have now created a code to select an animated funny face and we have the ability to move our image around using the drag-and-drop method. We need to be able to scale our "me" photograph using a Slider control and a new transformation.
In the following recipe, we will hook up the event listener of our Slider control and use another 2D matrix transformation, and this time change the scale of our imageViewMe
control based on the user input.
Near the bottom of your current source code, you should have instantiated a Slider control named "zoomSlider
". We are going to replace that code with a slightly updated version, and then capture the slider's change event in order to scale our imageViewMe
component based on the value selected. Replace your declaration of the zoomSlider
component with the following code:
var zoomSlider = Titanium.UI.createSlider(...