I'm having a difficult time understanding how to place CCLabelBMFont nodes. When I try to logically think it through in my mind, they never quite end up where I expect and I have to tweek the position by magic number offsets until it looks right. There's something I'm not getting and Google isn't helping me to understand.
For example, if you go into the CCLabelBMFont test in the CocosSharp test suite (Atlas4.cs in tests/LabelTest), that centered "Bitmap Font Atlas" label makes perfect sense to me, as is. However, when I try to make it a little different, like wrap, center-justified, I don't get why it ends up where it does.
For example, if you change the label's constructor to:
label = new CCLabelBMFont("Bitmap Font Atlas", "fonts/bitmapFontTest.fnt", 300.0f, CCTextAlignment.Center);
To make it wrap, center-justified, max width 300, it wraps and it's center-justified, but the placement isn't where I would expect. It's placed too far right-of-center, but not in any logical way I can see. See first attached screenshot.
If you change it to wrap, right-justified:
label = new CCLabelBMFont("Bitmap Font Atlas", "fonts/bitmapFontTest.fnt", 300.0f, CCTextAlignment.Right);
It wraps the way I would expect (right-justified), but now it's placed even further right of center, although it looks more logical - like it's just using the middle-left for an anchor, but I'm not sure why that would be. See second attached screenshot.
In each case, to me, it seems like the center of the rectangle that bounds the label should be on that crosshair. Basically, the justifying makes sense - it does what I expect. Where the label ends up is a mystery to me.