Xhatcontrol transparency

how make my background the chat transparency

This is faaarrrr from a valid question. First what GUI are you using?

1 Like

nify gui

Use a color with alpha as a background. As far as I remember nifty’s hexcode goes like this:
#aarrggbb
Where aa is alpha, rr is red, gg is green (not good game! :P) and bb is blue.

mhhh isn’t alpha at the end? It’s been a long time since I used Nifty but I’m 95% sure of this.

It’s either on the beginning or at the end. But I think it’s in the beginning because I remember being puzzled when I figured out how to do it…

Whichever way everyone else does it, I think it’s the opposite way.

That’s my recollection, anyway.

It is RGBA (#rgba or #rrggbbaa).

Back to OP’s question:
You’re question is about as vague as it could be.
Can you please explain the problems, post the layout, and tell us the steps you have taken to get to this point?

Here’s the nifty manual:

https://sourceforge.net/projects/nifty-gui/files/nifty-gui/1.3.2/nifty-gui-the-manual-1.3.2.pdf/download

this is my code in xml
i want put the text area with transparency code

<?xml version="1.0" encoding="UTF-8"?>
<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
  <useStyles filename="nifty-default-styles.xml" />
  <useControls filename="nifty-default-controls.xml" />

  <screen id="World" controller="mygame.Main">
    <layer childLayout="absolute" controller="mygame.gamecontrol">
      <panel id="panel" width="50%" height="50%" align="left" valign="center" childLayout="vertical" y="50%"  padding="10">
        <control backgroundColor="#4c000000" id="chatId" name="nifty-chat" width="100%" height="100%" lines="13"  sendLabel="Send Message"  />
      </panel>
    </layer>
  </screen>
</nifty>

For that you will need to overwrite nifty’s default style for the chat.

try :

backgroundColor="#0000"

dont´ work
i want tranparency background in textarea and textfield
maybe if i create a style for chatcontrol
but i don´t know how

Backgroundcolor doesnt work on chat. Just read the manual to see how to make custom styles.

Nifty isn’t the best gui system. It cannot give errors because it uses XML. Everytime Nifty finds something out of place, like your backgroundColor, it just ignores it, or shows it wrongly.

i create the my style but don´t change the background color
<?xml version="1.0" encoding="UTF-8"?>



  <style id="custom-chat-control#chatPanel">
    <attributes  backgroundColor="#ffff6"
        childLayout="horizontal" 
                width="100%" 
                align="center" 
              />
  </style>

  <style id="custom-chat-control#chatArea">
    <attributes  backgroundColor="#ffff"
        childLayout="horizontal" 
                align="left" 
                width="75%" 
               />
  </style>

  <style id="custom-chat-control#playerArea">
    <attributes childLayout="vertical" width="25%" backgroundColor="#0000"/>
  </style>

  <style id="custom-chat-control#spacer">
    <attributes height="9px" width="100%" backgroundColor="#0000" />
  </style>

  <style id="custom-chat-control#chatTextArea">
    <attributes childLayout="horizontal" align="left" width="75%" color="#ffff" />
  </style>
  
  <style id="current-player">
    <attributes  backgroundImage="panel/nifty-panel-red-no-shadow.png" imageMode="resize:8,210,8,8,8,210,8,209,8,210,8,8" backgroundColor="#0000" />

  </style>
  
  <style id="default">
    <attributes  backgroundImage="panel/nifty-panel-no-shadow.png" imageMode="resize:8,210,8,8,8,210,8,209,8,210,8,8"  backgroundColor="#0000"/>
  </style>
  
</nifty-styles>

screen with chat

<?xml version="1.0" encoding="UTF-8"?>
<nifty xmlns="http://nifty-gui.sourceforge.net/nifty-1.3.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://nifty-gui.sourceforge.net/nifty-1.3.xsd http://nifty-gui.sourceforge.net/nifty-1.3.xsd">
  <useStyles filename="nifty-default-styles.xml"/>
  <useStyles filename="Interface/Style/ola.xml"/>
  <useControls filename="nifty-default-controls.xml" />
 
  <screen id="World" controller="mygame.Main">
    <layer childLayout="absolute" controller="mygame.gamecontrol">
      <panel id="panel" width="50%" height="50%" align="left" valign="center" childLayout="vertical" y="50%"  padding="10">
        <control  id="chatId" name="nifty-chat" width="100%" height="100%" lines="13"  sendLabel="Send Message" style="custom-chat-control"  />
      </panel>
    </layer>
  </screen>
</nifty>

Strange.
Everything seems in place.
Btw, you made a typo in line 2:

backgroundColor=“#ffff6”

Should be:

backgroundColor=“#fff6”

Did you try comparing your style with the original nifty style? Looking at the originals often helps.

yes but the background color of chat dont change

I think I know the problem:

The background isn’t a colour, but an image: “panel/nifty-panel-no-shadow.png”.
Try putting a different image in there, maybe it works.

i change the background image to other file with other color and don´t work

Sorry for the late response.

After doing some research and testing, I have come to this result:

I think I almost have the solution, I will post something later.