Search Unity

MessageManager for EZGui

Discussion in 'Assets and Asset Store' started by Adam-Buckner, Mar 14, 2011.

  1. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    I'm currently getting this message :

    Code (csharp):
    1. Assets/Plugins/MessageManager/MessageManager.cs(118,65): error CS1061: Type `SpriteText' does not contain a definition for `Color' and no extension method `Color' of type `SpriteText' could be found (are you missing a using directive or an assembly reference?
    I have the current sprite Manager 2 and EZ GUI in the project. I've tried re-importing the scripts manually. Anyone have an idea How I can fix this?
     
  2. djinni69

    djinni69

    Joined:
    May 10, 2010
    Posts:
    174
    I think the attribute is now a lower case "c". SpriteText.color
     
  3. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Let me check to make sure there are no silly issues. This sounds like an error that cropped up for a day when I buggered a line by accident when I did a point upgrade. I'm not at my desk, so it will have to be later today.
     
  4. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    It was that the .Color parameter should have been .color

    Thanks Everyone :)
     
  5. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    ODD! I thought I fixed that. When did you download your package? I'll check the package that's up when I get into the office (on the iPhone right now), but it would be good to know if this was a recent download.
     
  6. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    The other issue is that the Demo Project reloads the MessageManger.cs script that has the same errors.
     
  7. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    I just checked it today with the Asset Store and it said mine was current. Did you change the actual Version Number? I think that is how the store knows to say you need an update.
     
  8. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Ah, humph. I'll have to check with Unity Tech, then. I am very sure that the one up on my eStore is correct, but there *could* be an issue with the one on the asset store. That's a torpedo I put in the water and hope it ok when it hits.
     
  9. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey LittleAngel,

    Why exactly when I use this line :

    Code (csharp):
    1. MessageManager.Instance().Message("Multiplier Expressions", "3 OF A KIND LINK!", [B]Color.blue[/B]);
    The color of the message is black?

    But if I change it to say:

    Code (csharp):
    1. MessageManager.Instance().Message("Multiplier Expressions", "3 OF A KIND LINK!", [B]Color.cyan[/B]);
    or any other color it works correctly??

    EDIT: Hmm...after changing the code back to Color.blue, it works...???

    EDIT2: Whats not working is the hex code:

    Code (csharp):
    1. MessageManager.Instance().Message("Multiplier Expressions", "[#FFFF00]TRI");
     
    Last edited: Aug 15, 2011
  10. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    As MessageManager doesn't actually *DO* anything with color tags, other than pass them on to EZGui, I've passed the buck to Brady, and I'll report back.
     
  11. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    jrricky:

    What color is the type in your font atlas? Is it white? White is the best for accepting color tinting, as the colors overlay each other (multiply?) Or is the atlas some other color? I noticed that FFFF00 is Yellow. (http://www.color-hex.com/color/ffff00) Could it be that you have a colored atlas and it's conflicting with your color call out?
     
  12. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    It's kinda weird LittleAngel, the same line where I had Color.blue for a long time without changes, stopped working and I didn't understand...the font atlas is white...on some of the MessageManager inspector pools I preset the colors...would that cause problems?
     
  13. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Very odd. Do you want to send me an example of what you are doing? PM me with a link? I'll take a look. The color should only be passed thru to EZGui. None of this sounds like a general problem, so there may be something specific to your project.
     
  14. runonthespot

    runonthespot

    Joined:
    Sep 29, 2010
    Posts:
    305
    Hey there- got a minor bug to report- haven't quite got a workaround for it yet though. Basically if you call ClearDisplay on MessageManager but are sending a steady stream of messages to the display, the fade coroutines build up and start hogging CPU- ClearDisplay needs to include some mechanism to end the previous coroutines, I think. I've tried fiddling with fade time to 0, and display time short, but then I do actually want it to fade if it gets a stream of messages, then nothing for a while, if that makes sense.
     
  15. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    runonthespot: You may be correct. Yes. I didn't think of the need for constant streaming to a display with ClearDisplay in-between. I assumed that you'd either fill a list (like a chat box) with streaming messages. Can you tell me (either here or in PM) what it is you are trying to do, exactly, and I'll take a look at the code with your case in mind?
     
  16. runonthespot

    runonthespot

    Joined:
    Sep 29, 2010
    Posts:
    305
    No problem. In the one instance, I simply used it to replace the fps meter, to see the framerate.

    More pertinent to the game, I use it to show the distance between you and your target in game. As you move, the number moves.
     
  17. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Riiiiight.

    I'm working on a different solution to this type of single constant display. Using a standard MM display is inefficient for this type of thing. I have a working under-polished version on the desk. I'll bump this up the priority list.

    Can I ask how urgent this is?
     
  18. runonthespot

    runonthespot

    Joined:
    Sep 29, 2010
    Posts:
    305
    Not super urgent- I can live without it for now. I've disabled it in my current build.

    You can see my efforts so far here
    http://www.youtube.com/watch?v=sM52JXZprnc

    and here
    http://www.youtube.com/watch?v=0ewo2SNKwP0
     
  19. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Kewl. I'll bump this up the priority list none-the-less. Please hit me with a brick if it becomes urgent.
     
  20. runonthespot

    runonthespot

    Joined:
    Sep 29, 2010
    Posts:
    305
    Another good usecase is a typewriter effect. Similar problem.
     
  21. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Yes. The typewriter effect will be easier to do with the aforementioned solution for constantly updated displays, but now that you mention it, I'll see if I can build something in.
     
  22. Cico

    Cico

    Joined:
    Aug 21, 2011
    Posts:
    11
    It is really cool.Nice work
     
  23. runonthespot

    runonthespot

    Joined:
    Sep 29, 2010
    Posts:
    305
    Hey, great to meet you at London Unity User Group last night :) I was browsing through Richard's altdevblogaday's posts and saw this
    http://altdevblogaday.com/2011/07/07/unity3d-coroutines-in-detail/

    I reckon I'm going to just hack your fade coroutine to have an interrupt to solve the typewriter / fps issue unless you have a better way up your sleeve?
     
  24. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Ooh. Nice link. I haven't had a chance to chase down altdevblogaday yet. I'll read thru that.

    Can you give me until, say, Monday? I'm sure I'll have something for the fps issue by then. Typewriter? Maybe.

    Thanks for the pint, btw! It was fun. Have to do the next one!
     
  25. runonthespot

    runonthespot

    Joined:
    Sep 29, 2010
    Posts:
    305
    Sure. I should be working on my enemy AI anyway :)
     
  26. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    PM me your eMail address and I'll send you a beta to test. I think the "constant" display is done dusted. I've not looked at the typewriter effect, but I'll see if I can look at it tonight.
     
  27. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    A couple of notes:

    Color Issues: There has been a recent upgrade to EZGui (1.06f) and this has changed the way that SpriteText handles color. If you have preset the colors on any of your Message Display SpriteText objects, you should reset them back to white and let MessageManager deal with the default color. Default color is set in the MessageManager.MessageDisplays array. This will ensure proper behaviour of both default color and changing color tags. For more information, review the relevant threads on http://forum.anbsoft.com/

    Advanced ScrollList support: I have a solution to slowdowns seen when large volumes of text from messages are pushed to a scroll list. This was due to the way EZGui handles clipping text. I have a work-around in the pipes and is in testing right now.
     
  28. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I have a point upgrade about to release.

    Changes and updates include:

    - New "Constant" display type: for updating single displays like score, speed, distance, etc..

    - Improved Speed overall.
    - Improved ScrollList support: This solves issues created by large volumes of text in a scroll list.
    - Improved Coroutine handling and cleaner handing of "Clear Messages".
    - Improved Pool mamagement for messages at a point.
    - Improved DropShadow support, including DropShadow support for Messages at a point.
    - Improved Messages at a Point allowing the display to show in the game world or on the screen plane.
    - Updated UI, including popup lists for display type and a custom inspector.

    Two important things:

    1: Now is the time to put in any requests for additions, updates or changes.
    2: This will be accompanied by a price increase when released.
    For current licensees, this point upgrade, will be free,
    The price will increase for new purchases on both the Asset Store and our eStore.​
     
    Last edited: Sep 5, 2011
  29. dilbertian

    dilbertian

    Joined:
    Aug 13, 2010
    Posts:
    74
    Hi, I am trying to use a message display with a clipping rect on a slide-out background. As the panel (actually a UIButton) slides out, I can see that the clipping rect is remaining in a static position and not following the message display which is a child of the sliding object. I am thinking that I will need to modify the X/Y offsets of the clipping rect as the panel slides out but that would be a bit if a pain.

    This will also probably be an issue when I go to implement my movable message box. I can envision ways to get around both of these issues by adjusting the X/Y offsets on the corresponding message display within the message manager, but wondering if there is a cleaner way to do this? I haven't tried it yet, but can imagine I will be running into issues with varying resolutions if it is even possible.

    Thanks,

    -Tim
     
  30. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    dilbertian: Let me take a look at this Monday. If you want, you can PM me a cut down or sample of what you are working with and I'll find the best way to get this to work.
     
  31. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Dilbertian: Sorry! Inbox full! Send it again!
     
  32. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey I decided to go back to this, now I want to know how I would write a color code using MessageManager?

    http://forum.anbsoft.com/viewtopic.php?p=11925#p11925

    I posted about this here, it is at the bottom.
     
    Last edited: Oct 12, 2011
  33. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    I posted this on the EZGUI forum but here it is as well...

    EDIT: So not just any var, like a string, it needs an int to work...
     
    Last edited: Oct 12, 2011
  34. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I replied on the anbsoft forum:
    http://forum.anbsoft.com/viewtopic.php?f=9&t=98&p=11927#p11927

    Here's a copy:
    MessageManager is a router that takes string messages and routes them to sprite text displays, so if you are having underlying issues, I'm unclear how much MessageManager will effect it. When it comes to the optional color parameter, MessageManager just tacks that on to the string while routing it.

    The only difference I see between the two posts is:

    Non working: ["#FF0000 Hello world"]

    Working: "[#FF9933]Hello World!"

    The syntax is different, and the latter working post looks more correct.
     
  35. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    The first one was a mistake on my part. The working one is the way I code it, but it does not work without an int var. Could you test and let me know? Thanks.
     
  36. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Say, how are you setting the color?

    When you call MessageManager, are you using the optional color parameter?
    Code (csharp):
    1. message : string = "Hello World";
    2. color : Color = new Color (0,1,1)
    3. //  color : Color = Color.blue;
    4. MessageManager. Instance().Message(displayID, message, color);
    Or are you setting is as part of the message string?

    Code (csharp):
    1. message : string = Color.red + "Hello World";
    2. //  message : string = "[#FF9933]Hello World!";
    3. //  message : string = Color(1,0,1) + "Hello World";
    4. MessageManager.Instance().Message(displayID, message);
     
  37. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    If you look at the random message sender, which is part of the package and used for testing, you can look at the code there and see how that works.

    And don't forget, you don't have to use hex code to define colors. If you are having issues with hex code syntax, then you can use Unity's default color definitions or build one from values (eg: Color.yellow or new Color (0.2f, 1.0f, 0.0f);).
     
  38. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    I was using:
    Code (csharp):
    1. MessageManager.Instance().Message(displayID, "[#FF9933]Hello World!")
    But Ill try theat method thanks...

    EDIT: Btw, what do you call this? Color (0.2f, 1.0f, 0.0f);
     
    Last edited: Oct 12, 2011
  39. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    OK, color problems solved!!

    Here comes another problem; Drop Shadows.

    So I enabled drop shadows, and my sprite text has an animation on it and when the animation plays on the sprite text, the drop shadow doesnt follow suit, it just stands there, how would I fix?

    EDIT: Shouldn't the drop shadow be parented under the main sprite text?

    EDIT2: Yup, I found the cause of the problem in line 132:

    Code (csharp):
    1. dropShadowObject.transform.parent = thisDisplay.messageDisplay.transform.parent;
    So I just removed the parent:

    Code (csharp):
    1. dropShadowObject.transform.parent = thisDisplay.messageDisplay.transform;
    Fixed!!
     
    Last edited: Oct 12, 2011
  40. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    jrricky: Yes, there will be some performance enhancements, especially with dropshadows with the new release.

    Don't forget that the system is designed to add color on the fly with:

    Message(displayID, message, color);

    I would call this RGB Color, or Color with RGB values.
     
  41. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    So when's the new release? :p
     
  42. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    OK, the color problem NOT solved!! I am still having problems with this!!

    Code (csharp):
    1.  
    2. var triText = Color.red + "TRI " + Color.green + "SOUL " + Color.blue + "LINK!";
    3. MessageManager.Instance().Message("Multiplier Expressions", triText);
    Not working, as in, giving 3 different colors to the parts of the text...
     
    Last edited: Oct 24, 2011
  43. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    I'm not at my desk. What is the output of that? Do you get the default color for the display? Or the first color in the sequence?

    I would suspect that you are getting the default color for the display?

    The way the system is intended is to set the color for the line using the "color" value in the method:

    Message (displayID, message, color);

    This is because for sprite text to fade properly you need to change the alpha value in the color.

    If you are trying to have several colours within a single message, this may not work, as the system needs to know the color for the entire message so it can fade the color's alpha channel.
     
    Last edited: Oct 24, 2011
  44. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    It defaults to white.

    That is VERY disappointing to hear, since it worked in the first version of message manager (every original code worked, until some whacky update which made my scripts obsolete, hex codes wouldnt work and now 3 colors dont) :(
     
  45. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    I need 3 different colors, how can I work around this? :/
     
  46. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    jrricky:

    You must be confused between a simple sprite text component and MessageManager.

    If you have a non-fading sprite text display in EZGui - the label - it will take multiple in-line color tags. This should still be true. Thought I believe it still works fine, if any EZGui update has broken this, I cannot control that. That's up to Brady and A&BSoft.

    MessageManager has always dealt with fading by fading the alpha channel of the entire message. You can go to the original (and still free) version on the A&BSoft site: http://forum.anbsoft.com/viewtopic.php?f=16&t=301

    And you will find that it handles color the same way as the current one. This is the core code:

    thisMessage.color.a = Mathf.Lerp(0, 1, (fadeSpeed - fadeTimer) / fadeSpeed);

    It requires the entire message to have the same color.

    So I'm unclear what whacky update you are talking about.
     
  47. tvalleau

    tvalleau

    Joined:
    Jul 1, 2010
    Posts:
    108
    Just curious, since I bought this a few days ago: is the project abandoned?

    BTW, CamelHumps; CaMeLhUmPs; CamelhumpS... none of those work. There are 2^10 possible combinations. Are we supposed to try them all?
     
  48. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    No. The project is stable. I have an unpolished beta point upgrade that adds functionality for specific use cases, but makes the entire package a little over complicated. I'm distributing this package on request, as I have not had the time to really make sure it's bullet proof. Since I've been picked up by UT, my time has diminished significantly.

    The password should work in a number of combinations: Try cAmElHuMpS or CaMeLhUmPs both of these should work. If they don't, PM me here on the Unity Forum, and I'll get you in.

    Speaking of which, did you have a specific question?