Suppose I have sprite and i set its position randomly, how can determine sprite is visible on screen or not and if visible get relative location on screen.
I am asking this to make mario style follow.
Follower shouldn’t follow sprite when its on screen center-200 between screen center+200
I tried Follow::createWithOffset looks like doesnt work intended or I missing something.
for example Follow::createWithOffset(sprite3, 200, 0, Rect(0,-3200, 4000, 800));
this works intended follows sprite at xOffset 200, if I only move player right to left its still follow player at same xOffset 200 point.
any suggestion about usage of createWithOffset?
thank you
I used getPosition and i can check sprite on screen position as above code but dont know this is best approach because createWithOffset made for this issue as I read in this post : Follow action cocos2d-x v3.2. Why always centered followed?