MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / drawable

Method drawable

source/game/StarAnimation.cpp:62–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62Drawable 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
79void Animation::update(float dt) {
80 if (m_completed)

Callers 2

renderImplMethod · 0.45
renderParticlesMethod · 0.45

Calls 5

DrawableClass · 0.85
toStringFunction · 0.85
emptyMethod · 0.45
replaceTagsMethod · 0.45
rotateMethod · 0.45

Tested by

no test coverage detected