| 60 | } |
| 61 | |
| 62 | Drawable Animation::drawable(float pixelSize) const { |
| 63 | if (m_base.empty() || m_frame < 0) |
| 64 | return Drawable(); |
| 65 | |
| 66 | // Replace <index> with the frame index, if it is not found then add |
| 67 | // :<index> to the end |
| 68 | String baseFrame = AssetPath::relativeTo(m_directory, m_base).replaceTags(m_tagValues); |
| 69 | if (m_appendFrame) |
| 70 | baseFrame += ":" + toString(m_frame); |
| 71 | |
| 72 | Drawable drawable = Drawable::makeImage(std::move(baseFrame), pixelSize, m_centered, m_offset); |
| 73 | drawable.imagePart().addDirectivesGroup(m_processing, true); |
| 74 | drawable.rotate(m_angle); |
| 75 | drawable.color = m_color; |
| 76 | return drawable; |
| 77 | } |
| 78 | |
| 79 | void Animation::update(float dt) { |
| 80 | if (m_completed) |
no test coverage detected