Hi, I did not mean that widget itself has width/height of zero. It's the UISprite.mSprite.width (height) that are zero for some reason.
I.e. while the UISprite.mSprite pointer is not null, the values of all it's int fields are zero. So following the UISprite.drawingDimensions code
public override Vector4 drawingDimensions
{
get
{
Vector2 offset = pivotOffset;
float x0 = -offset.x * mWidth;
float y0 = -offset.y * mHeight;
float x1 = x0 + mWidth;
float y1 = y0 + mHeight;
if (mSprite != null)
{
int padLeft = mSprite.paddingLeft;
int padBottom = mSprite.paddingBottom;
int padRight = mSprite.paddingRight;
int padTop = mSprite.paddingTop;
int w = mSprite.width + padLeft + padRight;
int h = mSprite.height + padBottom + padTop;
if (mType == Type.Simple || mType == Type.Filled)
{
if ((w & 1) != 0) ++padRight;
if ((h & 1) != 0) ++padTop;
float px = (1f / w) * mWidth;
float py = (1f / h) * mHeight;
I am getting w and h to be zeros, and therefore px and py are NaNs.
I have troubles getting why the mSprite object contains these uninitialized state. Looks like it's fields are having the default values from initializers and that's all. I tried debugging the code, but I was not able to find any case where mSprite is assigned with invalid object, or mSprite.width is set to 0. So I'm pretty much puzzled right now.