The fastest / most efficient way to draw moving speech bubbles on the screen - CoreAnimation, Quartz2D?

I am adding some features to the iPhone app and I can use some help in choosing the fastest / most effective / optimal approach to solve this problem:

At the top of the screen, I have speech bubbles (think comics) that UIImageViews translate around the screen (dynamic position x and y). This is a UIImageView, because there is an image as the background of the speech bubble.

Each speech bubble has a corresponding image moving around the bottom of the screen (elsewhere in the layer tree)

I would like to draw a tail (this triangular bit from the speech bubble) so that the point of the triangle tracks the bottom image, with the base of the triangle attached to the bottom of the top UIImageView. (technically, the base should not be a butt, it can overlap while I can match the color of my background image with a triangle).

I already did all the tracking and drew a line with the CGContextStrokePath methods, and now I am fixated on how to replace the line with a triangle.

I looked at the drawing of a triangle in Quartz and its filling. My concern is that speech bubbles move every 1/10 of a second, and it seems that drawing only the line used to prove the concept has had a pretty strong impact on performance / visual smoothness.

- , , . - , / , , . , , . .

+3
1

, UIImage. layer.position . , .

, , resizableImageWithCapInsets. , , .

- , , , , , CA, (, )

0

Source: https://habr.com/ru/post/1730151/


All Articles