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 - Dnake

#26
Okay, I linked an exemple and the font I use.
I see that this is caused by the line with the comment HERE, and when I remove the "*0.5f", the label get a good behavior...
(And I heard that my computer emit a noize when my exemple run, and the noize become more high-pitched when I decrease the size of the window... ^^')
#27
I've a little issue when I resize my viewport. I explain: I allow the player of my game to resize the window, and my view should keep a 16:9 ratio. So I write a little fonction who resize the viewport when a window resizing event is thrown, and allow the view to be always in 16:9. The fonction return the float rect to assign to the viewport, and here is its code:

FloatRect handleResize(Event::SizeEvent size)
{
    unsigned int iw = size.width;
    unsigned int ih = size.height;
    float fh(ih), fw(iw);//If size is in a 16:9 ratio, it won't change.
    if(iw/16 < ih/9)//Taller than a 16:9 ratio
        fh = iw * (9.0/16.0);
    else if(iw/16 > ih/9)//Larger than a 16:9 ratio
        fw = ih * (16.0/9.0);
    float scalex = fw/iw;
    float scaley = fh/ih;
    return FloatRect((1-scalex)/2.0f, (1-scaley)/2.0f, scalex, scaley);
}

But that make a litlle problem, the widget are strangely resized, like you can see inn the attached file, and that clip the content, here a label. The background of the label is grey in the picture. The proportions in the picture between the two windows are preserved. How can I fix that? Should I handle the resize in another way, or disable the resizing?
(Texus: I speak french at first, and I can see you're belgian, so can I speak with you in french?)
#28
I suspected that there was a problem, but I couldn't see where  ;D . And that worked because I just used some labels.
I'll look at the views, if I can do what I want with it my project will be much simpler!
Thank you for your fast reply :)
#29
In my project I need to draw the gui with some render states, and I seen that that's no possible in TGUI v0.6.
So I changed a bit Gui.cpp, and now I can do stuff like this in my project:

Transform transform;
transform.scale(Vector2f(scalingFactor, scalingFactor));
m_gui.draw(true, transform);

But I don't know if you purposely don't implemented this feature. Is that a good idea?
I attached the modified files.