Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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

— asked April 24th 2010 by Dan Tamas
  • animation
  • iphone
  • transform
0 Comments

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 :)

    — answered February 22nd 2011 by Charles Daniel
    permalink
    1 Comment
    • hehe, should help :) even my app is already in appstore for a while :) thnx anyway.

      — commented February 22nd 2011 by Dan Tamas
  • Hi,

    could you not use a new image rotated to how you want it, remove old and place new?

    — answered April 24th 2010 by Robert Greenock
    permalink
    0 Comments
  • 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

    — answered April 24th 2010 by Dan Tamas
    permalink
    0 Comments
  • Hi,

    could you not use a new image rotated to how you want it, remove old and place new?

    — answered April 25th 2010 by Robert Greenock
    permalink
    0 Comments
  • 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?

    — answered April 25th 2010 by Robert Greenock
    permalink
    0 Comments
  • 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

    — answered April 25th 2010 by Dan Tamas
    permalink
    0 Comments
  • No worries,
    this thread might help you do it on screen just not visible

    http://developer.appcelerator.com/question/12611/image-fadeinfadeout

    — answered April 25th 2010 by Robert Greenock
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.