Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - china92

#1
Quote from: china92 on 01 June 2013, 10:58:48
My tower defense is almost ready for playing, so I'll show you what I'm doing soon.
If you want to see the effect of my work: https://en.sfml-dev.org/forums/index.php?topic=11783.msg81779#msg81779 ;)
#2
Okay, thanks. :)
#3
IMHO it would be better if it returns sf::Vector2u, because then we'll be able to simply do this:
Code (cpp) Select
object.setPosition(object2.getPosition() + callback.mouse);

I mean - operators would work, and this way is much more convenient.

Here is an example from my tower defense: I'm putting a callback at some object, and after this I want to put turret in a place where mouse cursor occur. Since callback.mouse returns only local bounds from the object where callback was sent, I have to add some coordinates to make sure that turret will be in a correct place.

What do you think, texus?
#4
Yes, the problem was in this reallocation. I was trying to figure it out by myself but I gave up, I would never thought about it for my own, so thank you so much for your help, I do really appreciate it! :D

And of course you are right about those two last advices, thanks for them as well. :)

My tower defense is almost ready for playing, so I'll show you what I'm doing soon.
#5
I don't know if it is an bug in tgui/sfml, or I wrote something in a wrong way, but I have a problem.

Right now I'm trying to make my own tgui::ChildWindow with turrets (TurretWindow). I already made my own tgui::Panel (InformationPanel), which displays Informations (and 'latches' it).

Informations contains pointer to a texture, and list of strings, InformationPanel puts string into labels and copy the texture from Informations. Texture in InformationPanel is displayed by using setBackgtoundTexture on tgui::Panel named 'image'.

Right now I added some turrets into a TurretWindow, but only the last InformationPanel displays texture correctly and I don't know why...

I'm attaching code, and asking for help.
#6
Okay, but the Panel holds only the pointer to the texture, right? So then I have to make sure the texture exists?

Nice, so I'm looking forward to it. :)
#7
Feature requests / Loading tgui::Picture
25 May 2013, 15:41:45
Is there any plans for other methods of loading tgui::Picture? It would be nice if tgui::Picture could be loaded from sf::Image or sf::Texture.
Right now I have to do a small workaround like this:

Code (cpp) Select
sf::Image test;
tgui::Picture::Ptr test2(some group);

test.saveToFile("temp.png");
test2->load("temp.png");


@Edit
To ensure the getLoadedFilename() method compatibility it could return empty string if tgui::Picture is loaded from sf::Image/sf::Texture.
#8
General Discussion / Re: SetTextSize issue
25 May 2013, 14:28:49
Awesome, thank you. :)
#9
General Discussion / Re: SetTextSize issue
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.
#10
General Discussion / Re: SetTextSize issue
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): https://speedy.sh/VUd6w/tgui.zip
#11
General Discussion / SetTextSize issue
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?