MCPcopy Create free account
hub / github.com/axmolengine/axmol / setPosition

Method setPosition

tests/cpp-tests/Source/ShaderTest/ShaderTest.cpp:143–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void ShaderNode::setPosition(const Vec2& newPosition)
144{
145 Node::setPosition(newPosition);
146 auto position = getPosition();
147 auto frameSize = Director::getInstance()->getRenderView()->getFrameSize();
148 auto visibleSize = Director::getInstance()->getVisibleSize();
149 auto retinaFactor = Director::getInstance()->getRenderView()->getRetinaFactor();
150 _center = Vec2(position.x * frameSize.width / visibleSize.width * retinaFactor,
151 position.y * frameSize.height / visibleSize.height * retinaFactor);
152}
153
154void ShaderNode::draw(Renderer* renderer, const Mat4& transform, uint32_t flags)
155{

Callers 15

initMethod · 0.45
NodeTests.cppFile · 0.45
onTouchBeginMethod · 0.45
onTouchMoveMethod · 0.45
onTouchEndMethod · 0.45
playDepthMethod · 0.45
__play4Method · 0.45
__play5Method · 0.45
initMethod · 0.45
MakeRenderingTargetMethod · 0.45
initMethod · 0.45
updateMethod · 0.45

Calls 6

getInstanceFunction · 0.85
getFrameSizeMethod · 0.80
setPositionFunction · 0.50
getPositionFunction · 0.50
Vec2Function · 0.50
getVisibleSizeMethod · 0.45

Tested by

no test coverage detected