Buttons With Odd Label Size

I’ve got a “levelselect” scene in my game with a bunch of buttons, each button’s label is the corresponding level number. The labels go like this

“1.1”

“1.2”

“1.3”

For some reason, when I return to my “levelselect” scene, it keeps saying “WARNING: Invalid fontSize(0) supplied. Using system standard size(13).” I’ve got “fontSize” set to 30, and it only happens when I return to the scene.

Here’s how I’m building my buttons (it’s in a for i…do loop):

buttons[i]=widget.newButton{ default="images/button.png", defaultColor=buttonColor, overColor=overColor, onRelease=onButtonRelease, width=64, height=64, fontSize=30, label=w.."."..i, --\> "W" is world number, "i" is level number xOffset=15, yOffset=15, labelColor={default=buttonColor, over=overColor}, font="Menlo" }

Any ideas? I’m completely stumped.

C

Can you make a small sample that demonstrates this and file a bug report?

Thanks

Rob

I’ve just tried again and I can’t duplicate it in any other project… Of course. Just when a bug report would be helpful.

But I’m still getting it in my main project. I copied and pasted my project with a new name and it still happened - only after I change scenes.

I stripped the button code down to

buttons[i]=widget.newButton{ onRelease=onButtonRelease } 

and it still does it.

Any ideas?

C

I don’t have any.  I’ve only played with the new widgets in their very basic usage so far.  I’ll have the engineers take a look and see if anything rings a bell.

This isn’t the new widget library - I’m still using the old one. I’m a trial user.

If no one has any ideas, no worries - I can just go back to the UI library and some display texts :slight_smile:

C

Wow… I don’t feel exactly “smart” right now :slight_smile:

I had a custom font in my game and I was overwriting the default display.newText function with my own - to check if it was a new enough device for custom fonts. So I was clamping the text function to

script, left, top, font, size

And I’m guessing widget was trying to do

group, script, left, top, font, size

So naturally, that was saying “the font size is a string” (because it was actually the font) and returning 0.

So there’s the whole story :smiley:

C

Can you make a small sample that demonstrates this and file a bug report?

Thanks

Rob

I’ve just tried again and I can’t duplicate it in any other project… Of course. Just when a bug report would be helpful.

But I’m still getting it in my main project. I copied and pasted my project with a new name and it still happened - only after I change scenes.

I stripped the button code down to

buttons[i]=widget.newButton{ onRelease=onButtonRelease } 

and it still does it.

Any ideas?

C

I don’t have any.  I’ve only played with the new widgets in their very basic usage so far.  I’ll have the engineers take a look and see if anything rings a bell.

This isn’t the new widget library - I’m still using the old one. I’m a trial user.

If no one has any ideas, no worries - I can just go back to the UI library and some display texts :slight_smile:

C

Wow… I don’t feel exactly “smart” right now :slight_smile:

I had a custom font in my game and I was overwriting the default display.newText function with my own - to check if it was a new enough device for custom fonts. So I was clamping the text function to

script, left, top, font, size

And I’m guessing widget was trying to do

group, script, left, top, font, size

So naturally, that was saying “the font size is a string” (because it was actually the font) and returning 0.

So there’s the whole story :smiley:

C