Problem rendering solid background color and solid border

Discussion of features and help with problems encountered while using libRocket

Problem rendering solid background color and solid border

Postby RobertP on Wed Apr 22, 2015 3:06 pm

Hello,

I'm having a problem with my background and borders not rendering correctly.

I set the element background to black, and the border to red. I made the red border-width unrealistically large to try to see what was happening with the rendering:

Image


Here is the document rml:
Code: Select all
<rml>
<head>
    <link type="text/template" href="template.rml"/>
    <title>Test</title>
    <style>
        body {
                width: 900px;
                height: 900px;
                margin: auto;
        }
    </style>
</head>
<body template="window">
    <div class="gui-text-help">
        Line 1<br />Line 2<br />Line 3<br />
    </div>
</body>
</rml>


Here is the template rml:

Code: Select all
<template name="window" content="content">
<head>
    <link type="text/rcss" href="rkt.rcss"/>
    <link type="text/rcss" href="template.rcss"/>
</head>
<body class="window">
    <div id="title-bar">
        <handle move_target="#document">
            <span id="title">Untitled</span>
        </handle>
    </div>
    <div id="content">
    </div>
</body>
</template>


and here is a snippet of the rcss:

Code: Select all
.gui-text-help
{
    width: 30%;
    margin-top: 10px;
    margin-left: 20px;
    font-size: 18;
    font-style: italic;
    text-shadow: 2px 2px black;
    background-color: black;
    border-color: red;
    border-width: 30px;
}



It looks like both the background-color and the border are reading from some texture file or some skin file somewhere, instead of rendering as solid colors as I would like.

How can I get the background and border to render as solid colors?
Attachments
css_error_screenshot_1920x1080_rgb565_cropped.jpg
css_error_screenshot_1920x1080_rgb565_cropped.jpg (20.82 KiB) Viewed 7624 times
RobertP
 
Posts: 8
Joined: Tue Apr 07, 2015 2:22 pm

Re: Problem rendering solid background color and solid borde

Postby FredrikTheEvil on Mon Apr 27, 2015 7:40 pm

How are you rendering? When the texture handle provided to the renderer function is 0, you should use a solid color shader, or bind a white texture to your ui shader. If you are using the fixed function pipeline, you should disable texturing
FredrikTheEvil
 
Posts: 1
Joined: Mon Apr 27, 2015 7:36 pm

Re: Problem rendering solid background color and solid borde

Postby RobertP on Tue Oct 27, 2015 5:11 pm

FredrikTheEvil wrote:How are you rendering? When the texture handle provided to the renderer function is 0, you should use a solid color shader, or bind a white texture to your ui shader. If you are using the fixed function pipeline, you should disable texturing


I finally got around to dealing with this issue, using your suggestion.

When the texture handle is 0, I use a uniform to tell the fragment shader not to use a texture, per this post:

https://forums.librocket.com/viewtopic. ... =870#p7098

And now element borders and solid element backgrounds show up correctly.

Thank you!
RobertP
 
Posts: 8
Joined: Tue Apr 07, 2015 2:22 pm


Return to Using libRocket