I have a guider line in my game which for some reason doesn’t has the same width when positioned on different X coordinate.
Square.png is a simple white 10px x 10px image that i use to scale to the size of the Sprite’s contentSize.
bool GuiderNode::init() {
if ( !GameSprite::initWithFile("Misc/Square.png") ) { return false; }
this->setColor(Color3B::BLUE);
return true;
}
void GuiderNode::update(float posX, float height) {
this->setContentSize(Size(1, height));
this->setPositionY(10.0);
this->setPositionX(posX);
}
After calling the GuiderNode::update method I’ve printed the X position to console and it has following values: 193.0, 159.0. The width of the GuiderNode is set to 1 point in this case, but it looks different for each X position:
In realtime pixel size (iPhon 5s):
X = 193.0, the width is 3px
X = 159.0, the width is 2px
iPhone x everything looks fine, but other devices, it varies the width.

Does anyone know why width of the node is not same?