0

How to rotate triangle image of speech bubble on the surface of bubble ? triangle image can scale and rotate with the touches and dragging.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
  • Do you want to rotate the triangle only or should the bubble resize along with the scaling and rotation of the triangle ?? Can you provide an image plz ... – IronManGill Sep 05 '12 at 10:06
  • Only triangle around surface of the bubble . –  Sep 05 '12 at 10:25

1 Answers1

0

What you can do is clip the triangle part of the bubble form the original image, make it into a UIImageView and place it just as if it is a part of the bubble. Then use this UIImageView and make it scale , rotate etc likewise according to UIGestures or UITouch whichever is easier for you along with the bubble. If you want any code help for that please ask. Thanks :)

IronManGill
  • 7,222
  • 2
  • 31
  • 52
  • but how could it will be stick one end to the surface ? –  Sep 05 '12 at 10:56
  • How are you making your view ?? If ur using the xib then simply use the 2 separate images - the bubble and the triangle and attach them together with them having different outlets and if ur going through coding same rule just ull have to set the coordinates of them .... – IronManGill Sep 05 '12 at 11:03
  • ok. i have done that, now i want rotate triangle on dragging while two points of triangle should stick to the bubble surface.How can i do that? –  Sep 05 '12 at 11:10
  • you want to scale the triangle along the surface of the bubble rite ? Not rotate the triangle I presume ?? – IronManGill Sep 05 '12 at 11:12
  • If you really want to let the triangle stick to the surface then simply rotate the bubble image with the triangle attached with touch ... But if u want to really move the triangle only then use the touches or gestures ... Any code help needed ? – IronManGill Sep 05 '12 at 11:17
  • I can rotate the bubble but i want like if i pull third point of triangle it will be stretched as much as you pull.It will be very helpfull to me if you can help me with code. Because i am new to coregraphics and animation. –  Sep 05 '12 at 11:23
  • if you only want the resizing of the triangle then it will be using the CGRect method of coregraphics see these links for that http://stackoverflow.com/questions/603907/uiimage-resize-then-crop , http://stackoverflow.com/questions/612131/whats-the-easiest-way-to-resize-optimize-an-image-size-with-the-iphone-sdk, Simple scaling of the image can be done by gestures can provide you code for dat.... – IronManGill Sep 05 '12 at 11:30