MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / setAnchor

Method setAnchor

Source/Node/Node.cpp:230–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void Node::setAnchor(Vec2 var) {
231 auto& transform = getTransform();
232 transform.anchorX = var.x;
233 transform.anchorY = var.y;
234 transform.anchorPointX = var.x * transform.width;
235 transform.anchorPointY = var.y * transform.height;
236 markDirty();
237}
238
239Vec2 Node::getAnchor() const noexcept {
240 if (_transform) return {_transform->anchorX, _transform->anchorY};

Callers 5

getEntryMethod · 0.80
SetAnchorXFunction · 0.80
SetAnchorYFunction · 0.80
toSpriteMethod · 0.80
node_set_anchorFunction · 0.80

Calls 2

getTransformFunction · 0.85
markDirtyFunction · 0.85

Tested by

no test coverage detected