Hello,
I’ve just migrated our game to the last version of cocos-x but I encounter interesting problem with Node::setPosition() methods.
In my code I overrides only setPosition(Point) version so far. Now we have another version setPosition(x, y).
The first version with Point(or Vec2) just call the second version (x, y). But for example some Actions calls (x, y) version so when I override Vec2, my version is not called from actions (instead x, y).
So what is purpose to have Vec2 version virtual and overridable? It would be much safer when this helper method (Vec2) is not overridable (or non virtual) and just call virtual real implementation (x, y) .
A good idea, I think, and what’s interesting is that there are many ways to update the position and I wonder how many need to be surfaced as virtual and which can be surfaced to the developer as “final” (where you can’t override, but can use).
Also I wonder about any similar other properties where multiple overloads are all overridable and whether that’s desired.
It’d be a breaking change, so my guess is this would just coincide with v4 and all the proposed changes possibly making it a component based system which may invalidate any changes proposed here.