apply transform to view without animation
Hi
I would like to display a view ( an image ) 30 degrees rotated. Is this possible without animation?
Thanks
7 Answers
-
var img = Titanium.UI.createImageView({ image: 'foo.jpg' }); img.transform = Titanium.UI.create2DMatrix().rotate(30); // or -30 depending on which direction you want to go
Alternatively you could combine the transform into the createImageView() call like so
var img = Titanium.UI.createImageView({ image: 'foo.jpg', transform: Titanium.UI.create2DMatrix().rotate(30) });
Hope that helps (almost a year late :)
-
Hi,
could you not use a new image rotated to how you want it, remove old and place new?
-
I'm afraid I don't understand.
The idea is to make some sorts of "polaroids", so to display few photos like being on a table, not aligned but each of them slightly rotated with an arbitrary angle.
I dont have a new and an old image, is only one image.Thanks
-
Hi,
could you not use a new image rotated to how you want it, remove old and place new?
-
how about loading the image and rotating it off screen, then move it on screen, or rotate it first then make it visible, i don't know why you don't want an animation maybe you could simulate them being thrown onto the table and use an animation as a feature of the app?
-
The example with the table as just an example :)
I need the rotation to be applied without animation.
I think the first option, with processing offscreen might be the better solution.
Thanks -
No worries,
this thread might help you do it on screen just not visiblehttp://developer.appcelerator.com/question/12611/image-fadeinfadeout