Results 1 to 4 of 4

Thread: Confused about GUIComponent creation: what does GUITopLevelDescription do when given?

  1. #1

    Default Confused about GUIComponent creation: what does GUITopLevelDescription do when given?

    If I construct my custom GUIComponent without passing a GUITopLevelDescription to the GUIComponent constructor, the rendered text and filled rectangles are opaque (as I want and as it was before making this a GUIComponent):

    Code:
    PerfViewComponent::PerfViewComponent( clan::GUIComponent *parent, const clan::FontDescription *baseFontDesc )
        : clan::GUIComponent( parent )
        , view_( parent->get_canvas(), baseFontDesc )
    {
        set_constant_repaint(true);
        set_geometry( parent->get_display_window().get_viewport() );
        func_render().set(this, &PerfViewComponent::onRender);
    }
    If I construct my custom GUIComponent passing a GUITopLevelDescription to the GUIComponent constructor then the rendered text and filled rectangles have some sort of blending effects (which I don't want).

    Code:
    PerfViewComponent::PerfViewComponent( clan::GUIComponent *parent, const clan::FontDescription *baseFontDesc )
        : clan::GUIComponent( parent, clan::GUITopLevelDescription(parent->get_display_window().get_viewport(), false) )
        , view_( parent->get_canvas(), baseFontDesc )
    {
        set_constant_repaint(true);
        func_render().set(this, &PerfViewComponent::onRender);
    }
    Where does this blending effect come from?
    Why would you want to pass a GUITopLevelDescription to the GUIComponent constructor as the clanlib GUICustomComponent example does?

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Out of interest, what happens if you change:

    Code:
    clan::GUIComponent( parent, clan::GUITopLevelDescription(parent->get_display_window().get_viewport(), false) )
    To...

    Code:
    clan::GUIComponent( parent, clan::GUITopLevelDescription(parent->get_display_window().get_viewport(), false), "something_that_is_not_window" )

  3. #3

    Default

    Quote Originally Posted by rombust View Post
    Out of interest, what happens if you change:
    To...

    Code:
    clan::GUIComponent( parent, clan::GUITopLevelDescription(parent->get_display_window().get_viewport(), false), "something_that_is_not_window" )
    I've got the same result as when no string was given: some blending effect during rendering.

    I've also tried "toolbar" and "radialmenu" string, it displays the background image of the corresponding css and also causes the blending effect during rendering.

  4. #4

    Default

    What sort of blending effects are you getting?

Similar Threads

  1. Ephemera- The Creation
    By IAmABrodie in forum Fan Creations
    Replies: 4
    Last Post: 06-07-2013, 09:18 AM
  2. Patch: Override CSS properties (GUIComponent)
    By spin in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 04-23-2012, 09:31 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •