(C++)chatQue class [v0.2.3] Alpha Fade works w/ 1.2
The alpha fade works perfectly with the new irrlicht 1.2!
@ssexton- I have left your pure alpha fade code in: commented out for users who wish to have a pure alpha fade, but kept my original fade algorithm as default. They look virtually the same, but for users with irrlicht 1.1 or older, they will still get a fade to black rather then no fade at all.
@rogerborg- Thanks, currently the class is written to be easily dropped into your project with out having to compile irrlicht for it. But if someone with power to get this included in vanilla irrlicht showed interest I would gladly convert it.
@ssexton- I have left your pure alpha fade code in: commented out for users who wish to have a pure alpha fade, but kept my original fade algorithm as default. They look virtually the same, but for users with irrlicht 1.1 or older, they will still get a fade to black rather then no fade at all.
@rogerborg- Thanks, currently the class is written to be easily dropped into your project with out having to compile irrlicht for it. But if someone with power to get this included in vanilla irrlicht showed interest I would gladly convert it.
Yay Ive added non word breaking word wrapping!
Just replace this on line 96:
With:
I made it as a modification to an Irrlicht Chat client Im making.
@Rambus, as a favour, could you please add a way to change the colour of individual words? Or atleast be able to add a non line breaking message after another so that words can be individually coloured?
Just replace this on line 96:
Code: Select all
if(l_cutPosition != -1)
{
wcscpy(lmsg.message,text.subString(0,l_cutPosition).c_str());
}
Code: Select all
if(l_cutPosition != -1)
{
l_cutPosition = text.subString(0,l_cutPosition).findLast(32);
wcscpy(lmsg.message,text.subString(0,l_cutPosition).c_str());
}
@Rambus, as a favour, could you please add a way to change the colour of individual words? Or atleast be able to add a non line breaking message after another so that words can be individually coloured?
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Sounds like you want a mashup of Rambus and Klasker's UI mods. Maybe we could send them on a date together?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Hey, happy to see you did the word wrapping
About colors,
Do you wan't a few basic colors to choose from (10 or so) or to be able to define any RGB value? Is this something you would wan't to work with other filters or a filter on its own?
I would imagine it would be easy to implement as a filter, with special reserved ascii values changing the color. For RGB values I could have an override color function that would allow you to replace a basic color with on of your choosing. Getting it to work with say pulse or shadow wouldent be hard (if we decided to make it a global thing rather then just a filter)
Hit me back with some ideas and when I have a few free hours I will implement it.
Edit: I took a look at Klasker's UI mod, If ascii values are going to be a pain to put in I could use #color# tags instead.
About colors,
Do you wan't a few basic colors to choose from (10 or so) or to be able to define any RGB value? Is this something you would wan't to work with other filters or a filter on its own?
I would imagine it would be easy to implement as a filter, with special reserved ascii values changing the color. For RGB values I could have an override color function that would allow you to replace a basic color with on of your choosing. Getting it to work with say pulse or shadow wouldent be hard (if we decided to make it a global thing rather then just a filter)
Hit me back with some ideas and when I have a few free hours I will implement it.
Edit: I took a look at Klasker's UI mod, If ascii values are going to be a pain to put in I could use #color# tags instead.
Yes a mash up would be great
The word wrapping was very simple to change as you can see it just searches the cut string for the last space (32 char value) and changes the cut off location to that.
Come to think of it, as a safety precaution incase you have a full line without a space change that to
Now if there are spaces they will be preserved, and if the whole line is just characters with no spaces the individual characters will be wrapped. I havent tested the code yet but it looks ok...
The word wrapping was very simple to change as you can see it just searches the cut string for the last space (32 char value) and changes the cut off location to that.
Come to think of it, as a safety precaution incase you have a full line without a space change that to
Code: Select all
if(l_cutPosition != -1)
{
s32 spacepos = text.subString(0,l_cutPosition).findLast(32);
if(spacepos != -1)
l_cutPosition = spacepos;
wcscpy(lmsg.message,text.subString(0,l_cutPosition).c_str());
}
Last edited by BlindSide on Sat Feb 10, 2007 1:26 am, edited 1 time in total.
Sorry for the delay,
The project I created this class for is going to go back into active development in a week or so here, so I will be adding the following features:
-Option to have a addMessage not append a linebreak. (Multicolor text)
-Render to a quad, so the chatQue can be scaled to apear the same on any resolution.
-Probably some more styles.
The project I created this class for is going to go back into active development in a week or so here, so I will be adding the following features:
-Option to have a addMessage not append a linebreak. (Multicolor text)
-Render to a quad, so the chatQue can be scaled to apear the same on any resolution.
-Probably some more styles.