SetTextSize issue
« on: 24 May 2013, 16:51:05 »
Does setTextSize work for buttons? I'm trying to use this function, but it looks like it isn't working.

Right now size of the text in the button is set to maximum value that the text fits in the button.

Is there any site where I can report bugs?

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: SetTextSize issue
« Reply #1 on: 24 May 2013, 17:02:00 »
What version of tgui are u using?

Can u show me the code that u use to create the button (so I can try to reproduce the problem)?

For now, you can just make the bug reports on this forum.

Re: SetTextSize issue
« Reply #2 on: 25 May 2013, 12:09:37 »
I don't know the exact version (it should be about 3 weeks old).

Ok, I'm putting entire solution inhere (small version of it; you just have to change library directories to work with it). Sorry for the mess in the code, etc., but I'm trying to learn a bit, and experiment, with tgui library.

Here is the link (VS2012): http://speedy.sh/VUd6w/tgui.zip
« Last Edit: 25 May 2013, 12:17:35 by china92 »

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: SetTextSize issue
« Reply #3 on: 25 May 2013, 13:45:15 »
Based on your code you were using v0.6, which was all I needed to know in order to compile the code.

But what is the problem exactly?
You aren't calling setTextSize, so the text is scaled to fit inside the button.
When I add the setTextSize calls then the text gets the size that I passed to the function. I don't see any problems.

And you don't have to upload the whole VS2012 solution, the source code (or even a small example code) would have been enough. Unless it is for tracking a specific windows-only bug, I don't boot in my windows anyway.

Re: SetTextSize issue
« Reply #4 on: 25 May 2013, 14:12:06 »
Oh my god... Do I always have to have a problem, which is not actually a problem?
Damn it... I wrote a method that set the size of the text, and I haven't called it... What a oversight... I'm sorry for bothering you.

Ok, I didn't know you were asking about numeric version and I know I do not have to (upload whole solution), but I thought it would be better to do it.


Since I already started the topic... Could you tell me if this kind of inheritance (from public tgui::Panel::Ptr, in RightPanel) is somehow dangerous?
I'm talking about memory leaks (or maybe there are other problems), and I'm wondering that if I have only to call (*this)->removeAllObjects();, thus it carry out deleting all the objects inside RighPanel.
« Last Edit: 25 May 2013, 14:13:41 by china92 »

*

texus

  • *****
  • 1143
    • View Profile
    • Texus's Blog
Re: SetTextSize issue
« Reply #5 on: 25 May 2013, 14:27:56 »
Well that explains why I couldn't reproduce it :).

I don't see any problems with this inheritance, it should be fine.
You don't even have to call removeAllObjects, it gets called automatically when your object is destroyed.

Re: SetTextSize issue
« Reply #6 on: 25 May 2013, 14:28:49 »
Awesome, thank you. :)