Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Score Flash: Easy to use GUI for Scores, PowerUps, Achievements, Tutorials

Discussion in 'Assets and Asset Store' started by jashan, Sep 26, 2012.

  1. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I've tried to reproduce what you're seeing but so far, everything works fine on my side. I've tried it with Unity 3.5.7 and Unity 4.0.1 with this little test-script that should simulate what you're doing:

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class TestScoreFlash : MonoBehaviour {
    5.  
    6.     public void Start() {
    7.         StartCoroutine(Messages());
    8.     }
    9.  
    10.     private static int global = 0;
    11.     private int local = 0;
    12.  
    13.     private IEnumerator Messages() {
    14.         while (true) {
    15.             ScoreFlash.Instance.PushLocal(string.Format("Test Message: {0}/{1}", local++, global++));
    16.             yield return new WaitForSeconds(0.5F);
    17.         }
    18.     }
    19.    
    20.     public void OnGUI() {
    21.         if (GUI.Button(new Rect(10, 10, 200, 200), "Reload level")) {
    22.             Application.LoadLevel(Application.loadedLevel);
    23.         }
    24.     }
    25. }
    There's one thing that's strange about what you're seeing: The message you get should only be shown in the editor - and even there, reloading the scene actually should not trigger it (that's something I'm removing for the next version). So most likely, there's still something else going on in your project that is a little weird and different from my test setup.

    Can you contact me via Skype (jashanchittesh) or email so we can look deeper into this issue?

    Does your crash still happen when you comment out the line where you're calling ScoreFlash from you code (that would be: SMessages:GameOver() (at Assets/Resources/Scripts/SMessages.js:77))?
     
  2. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    Hi Jashan,

    Still enjoying score flash very much! I have one suggestion I had trouble placing the score flash in the center of the screen or at the bottom with some up offset. That has to be done in code currently. What I did now is using the ngui anchor to place it perfectly on the bottom center with an up offset. This is now working beautifully of all the iOS devices and android. Only limitation is that it isn't animating up anymore because of the anchor.

    What is you use that ngui anchor script so that ngui people can place there score script perfectly simple where they want and modify it to you own version specialy for score flash so that it has the same easy anchor function from ngui but keep the score flash animations going.

    /Roy
     
  3. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Roy, I'm glad you're enjoying score flash! :) And thank you for the feedback regarding positioning.

    What exactly are you having difficulties with when positioning ScoreFlash at the center or bottom with some offset?

    When ScoreFlash is set up correctly for NGUI, this should work without a problem. Currently, positioning ScoreFlash in the center has no possibility to set an offset - if you need that, I can add it.

    Just to make sure it's not an issue with your set up, here's the important things:

    The following screenshot shows the anchor that ScoreFlash needs so that PushLocal, PushScreen and PushWorld all behave as intended:

    $ScoreFlashNGUISetup_03.png

    This anchor must be assigned to the ScoreFlash instance you're using, in the slot Main Layout / Custom Parent for Renderer Instances - so center positioning works:

    $ScoreFlashNGuiSetup_01.png

    If that's set up correctly, bottom (or top) positioning with offset also works as designed:

    $ScoreFlashNGUISetup_02.png

    Ah, one final thing: Here's the Prefab you're using for rendering (the one which is assigned to Main Layout / ScoreFlash Renderer) - the most important thing here is for Pivot to be set to center:

    $ScoreFlashNGUISetup_04.png

    In the first release of NGUI support, I had a different prefab that had the UILabel directly on ScoreFlashRendererNGUI. That caused quite a bit of ugly flickering, though, so I've changed the layout. Just in case you're still using that old version - you should probably update (keep in mind that after updating ScoreFlash, you also have to re-import the NGUI-specific package which you find in the project under Plugins / NarayanaGames / ScoreFlash / CustomRendering / ScoreFlashRendererNGUI-Package by double-clicking in the project pane):

    $ScoreFlashNGUISetup_05.png
     
  4. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    A quick update regarding the crash issue previously posted: It turned out the crash was not related to ScoreFlash (lucky me ;-) ) ... we weren't able to fully figure out what the problem with ScoreFlash no longer showing messages after reloading was but it might be related to how tk2d handles events - we weren't able to reproduce the issue when using a simply UnityGUI button to reload the scene.

    The good news: We could solve the problem by unchecking "Ensure Singleton" under advanced. This can be safely done when each scene/level has its own ScoreFlash instance (or ScoreFlashManager) ... or if there is only one scene ;-)
     
  5. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    A little preview of what's coming for ScoreFlash 3 (which is currently in development) - support to push game objects that have an implementation of ScoreFlashRendererBase as component (instead of just simple strings).

    Once ScoreFlash 3 is released, you will not only be able to push any kinds of graphics through ScoreFlash - but even full-blown achievements with graphics and multiple texts (this will require coding - but an extensive example to get you started will be included; of course, the simple "push text messages" approach will still be fully supported):

    $ScoreFlash3Preview.png


    Less than one week left: ScoreFlash on Sale - 33% off!!!

    Get it NOW for $20 (plus tax) instead of $30!!!

     
  6. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey jashan, I haven't had time to delve into score flash yet, but I just want to know if score flash has a persistent mode for something like updating score (meaning the score is always visible). Probably a dumb question but let me know thanks...
     
  7. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Good question, thank you! It seems like ScoreFlash is starting to get a life of its own. At first, I wanted to answer with "no, that's not possible and doesn't really fit into the design" ... until I realized that I've just added something for the upcoming ScoreFlash V3 which will give you exactly that possibility (only I added it for another purpose - that's why it took me a while to get it ;-) ).

    So, up to ScoreFlash 2, I had an internal flag (just an on/off switch aka bool) called fadeQuickly (in ScoreMessage) that I used for "moving messages through the pipeline more quickly". This was used by the readability/performance optimization that will make older messages disappear quicker (you control that in your ScoreFlash instance in the section Readability and Performance Tweaks, property Max Simultaneous Messages, see also API documentation of ScoreFlash.maxSimultanuousMessages). In other words: You can define how many messages one instance of ScoreFlash should show at any given time, and when you push more messages than the threshold, ScoreFlash moves the "too many" messages out at 8 times the original speed.

    $MaxSimultaneousMessages.png

    In ScoreFlash 3, I've changed fadeQuickly from being a flag to being a factor like timeScale (and I actually call the property LocalTimeScale now), and I'm making this public, so anyone can use it. For now, I'm using this in the new achievements example so you can have an achievement that the player can click on, and when he does that, it is pushed through the pipeline more quickly (I'm staying with factor 8 for now, but one could use any value that "feels right" for a given use case, like if you want to make it disappear almost immediately, you could use 100).


    With your question, I realized, you could also set this factor to 0 which results in a message becoming "persistent". You can also change the message text after you've "pushed" it (the various PushLocal/PushScreen/PushWorld methods offered by the IScoreFlash-interface return a ScoreMessage you can use for that), so changing the text/score wouldn't be a problem.

    Making this an official feature will require some extra testing and probably fixing a few problems. For instance, currently, it's really a message queue and I always only remove the tail (because currently, oldest entry == last entry). With persistent messages, this will have to be handled differently. Also I have that tweak that spreads messages that are too close to each other for better readability - this will have to handle "persistent" messages in a special way (btw, that's what Min Distance Between Messages and Spread Speed are used for).

    But I like that idea a lot, so I'll do it ;-) ... like most features coming with version 3, this is "advanced stuff". So, ScoreFlash 3 will still be simple when you want it to be simple - but to do the really fancy stuff, you'll have to dive a little deeper into it and might have to code up some of your own stuff.

    But I think that's consistent with how Unity is built ;-)
     
  8. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Cool, when can I expect?
     
  9. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash 3 should become available during the next 7-10 days.
     
  10. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    Hi Jashan,

    Thanks for your answer! When I do the TopLeft thing my whole ngui layout is messed up. Do I have to make a second ngui camera just for score flash?

    /Roy
     
  11. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    No, not a second NGUI camera - just an additional anchor that you use only for ScoreFlash. Or: You could also use this anchor for stuff that's positioned "top left" ... but personally, I like things more tidy and separated, so I'd use an extra anchor, like in the examples (admittedly, the examples don't contain other NGUI stuff, so maybe I should add some to make this more obvious).

    Btw, I noticed another thing that can go wrong - and in that case, if you GUI needs something else, you actually do have to have a second camera. UIRoot must have "Automatic" checked - otherwise, positioning goes all crazy:

    $AutomaticActive.png
     
  12. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey, so I am trying to set up my scoreflash prefab. One problem I am having though is that I have specific cameras setup to render different things, so I use layers. When I run my program though, scoreflash child renderers have a different layer so they dont show on my camera layers and view that I setup. How would I do this?
     
  13. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    You're using EZ GUI, right? Are you using the prefab ScoreFlashRendererEZGUI? If so, my first guess would be that you'd have to set the layer for that prefab to the layer you're using to render EZ GUI stuff (or just ScoreFlash, if you prefer to have a separate camera for that).

    Does that work for you?
     
  14. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    YES YES YES!!!! It works gloriously!!! The multicolor text works soo good! Exactly what I wanted!!!

    All I need now is a persistent mode to have my score shown! Please hurry with this! I will have to continue using the old way of displaying score :O
     
  15. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey I sent a pm asking about placing score flash instances in the scene...
     
  16. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Is there an X offset? I only see a Y?
     
  17. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Good morning ;-) ... keep in mind: I'm in the European timezone, so I was sleeping when you wrote those messages ;-)

    Currently, in the ScoreFlash setup there is only a Y offset when you have the message positioned on top or bottom (not when centered) because I'm assuming that in most cases, you'll want the messages horizontally centered on screen. So that's to keep it simple for beginners.

    However, there's also an API that you can use to place the messages in any screen location. For a list of all the methods, see the API documentation of IScoreFlash (this only has the methods for pushing messages, which makes the documentation much easier to read than having to go through everything that the ScoreFlash-class offers ... it also makes Intellisense much more useful when using ScoreFlash.Instance because instead of getting a huge list of all MonoBehaviour and ScoreFlash methods and properties, you only get what you'll usually want).

    For an example of how to use screen coordinates, see the example scene Xamples-ScoreFlash / Advanced / Xample_XMouseClickMessages. This uses the script MouseClickMessagesCSharp.cs (which you find in the same folder). The example also includes how to display the message with random colors. Here's a simplified version that only shows the message at the current mouse position:

    Code (csharp):
    1.     void Update() {
    2.         if (Input.GetMouseButtonDown(0)) {
    3.             Vector2 screenPosition = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
    4.             string text = string.Format("({0:000}, {1:000})", screenPosition.x, screenPosition.y);
    5.             ScoreFlash.Instance.PushScreen(screenPosition, text);
    6.         }
    7.     }
    8.  
    There's also an API for using world coordinates or post messages above heads of characters (see link above). And there's also an example scene for that (including - of course - example scripts ;-) ): Xamples-ScoreFlash / Advanced / Xample_XWorldSpaceMessages.

    Does that help?
     
  18. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    What I would like is for messages to move in left or right. I'm pretty sure achievements/messages in games don't just go up and down...

    Thanks.
     
    Last edited: Jan 26, 2013
  19. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Ah, I see ... that's a feature no one has asked for before. But I can see that there's use cases for that. I just have to find a way to integrate that in an elegant way, so it will probably take a few days ...

    What I'll probably do is release ScoreFlash 3 as planned and put this new feature into a 3.1 release that should become available a few days after the 3.0 release. Most likely, the way I'll implement this is be converting "Fade In Phase / Initial Offset Y" to a Vector2, and add a second animation curve for the X-coordinate ... and also change the velocities in Reading Phase and Fade Out Phase to Vector2 ... and add x-animation curves there as well.

    Do you feel that will enable you to do what you're thinking of?

    (Btw, I'll be offline until Sunday, late afternoon European time but will read and reply to messages after that)
     
  20. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Back ... but on my way to bed ;-)
     
  21. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    I hope you will be able to make persisten messages easier to understand/do. I was hoping for something like using an instance and just toggling "make persistent" in the inspector or something...

    Also, yes the x offset like the y offset settings should work. Hopefully it comes sooner than later :)
     
  22. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    What exactly are you planning to use this for? If I know precisely what your use case is, it will be much easier for me to come up with a solution that really helps you.

    It wouldn't be difficult for me to add that setting to the inspector - but my feeling is that this would make ScoreFlash more difficult to use for most people. When you're dealing with persistent messages, you really have to know what you're doing because it's a very different thing from what you'd usually be doing with ScoreFlash and it's very easy to use it in unintended ways resulting in all kinds of messages messing up your screen and no easy way to remove them.

    For instance, if you had a ScoreFlash instance that creates persistent messages, you couldn't use the simple interface for pushing messages anymore. You would have to use screen coordinates or world coordinates with every message; or use a different instance of ScoreFlash for each message (and then, you'd only ever have three messages ... and in that case, simply using a Label in your GUI system of choice would probably be the better approach ;-) ). If you'd naively use ScoreFlash.Instance.PushLocal("Message"), you could only do this one single time. If you'd do it another time, you'd get the first and second message in the same position ... which I don't think is something you'll ever want. In fact, at the moment I can't really think of any use cases for persistent messages except for those that use world coordinates and that are using the approach with ScoreFlashFollow3D (where the messages follow the 3D objects). But I'm certainly willing to learn about other scenarios!

    Another issue why I'm hesitant to add that to the instance configuration: In most scenarios, you'll probably want to remove or at least change the persistent message at some point in time. And the only way to do that is when you have a variable with the ScoreMessage that the various push methods return. If you have a setting in the instance that automatically makes every message persistent, a lot of users will miss that part about it which might give them trouble later on. And I'm doing my best to avoid creating something that will easily frustrate it's users.

    So, while technically, it would be very easy to add such a switch to the instance configuration, at the moment my feeling is that it would give most users more troubles. And for those users that actually do need it, it would only save a single line of code. Let me know what your scenario is, and maybe I'll find a better solution for you.

    I'm doing my best to get this into your hands as early as possible ;-)
     
  23. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
  24. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I'd still be interested to know what exactly you're planning to do with the persistent messages so I can offer a solution that's easy to use for your specific use case. If you're planning to use it for name tags (that's one of the more obvious use cases), it would be best to have it as a checkbox for ScoreFlashFollow3D. So, you'd have one ScoreFlashFollow3D on the object that should have the name tag, specifically for the name tag, and simply use that. If you'd also have non-persistent messages on the same object, you could have another ScoreFlashFollow3D for those dynamic messages (most likely positioned above the one for the name tag).

    Is that what you're trying to do?

    Coming soon :)
     
  25. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Only 2 Days left: ScoreFlash on Sale - 33% off!!!

    Get it NOW for $20 instead of $30 (plus tax)!!!
     
  26. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I hope the new versions or updates will be fully compatible with existing code and setup.
     
  27. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Thank you for sharing your concern - they certainly should be!

    That's how I'm designing ScoreFlash and testing before publishing updates. I'm using ScoreFlash in a few complex projects myself that I always upgrade before publishing new versions to the Asset Store.

    But keep in mind that I cannot test ScoreFlash with every other package that's available on the Asset Store. And proper namespace support for MonoBehaviours (which significantly reduces the potential for naming collisions) comes only with Unity 4. So until I drop Unity 3.5 support and move all ScoreFlash related MonoBehaviours into namespaces (which is a non-trivial step in itself), it's always possible that there's some incompatibility with some specific other package someone might be using in their project together with ScoreFlash.

    And as we've seen in the past: Even with namespaces, naming collisions can occur! Because currently, most developers put everything into the default namespace (even if they could and should put everything except MonoBehaviours and editor classes in separate namespaces already). I hope that eventually, UT will no longer allow packages on the Asset Store that are not using their own, unique namespaces (e.g. including the company name). But if UT ever does that, it will be a few years from now: When no one publishes packages that support versions of Unity prior to 4 anymore (i.e. when everyone has dropped 3.x support). Because right now, even if developers supporting Unity 3.x want to, they can't (unless they deliver only a DLL without source code which comes with its own share of potential problems and limitations).

    In general, unless you're using version control already, it's always a good idea to do a project backup before doing upgrades. Especially on major releases. That way, no matter what happens, you can always roll back and continue working.

    And if there's something really going wrong for you: Just let me know! Usually the problem can be fixed in a comparatively short amount of time (even when the problem doesn't originally come from ScoreFlash itself). I'm online on Skype most of the time (during the day, European time, as jashanchittesh), and I'm glad to help anyone in case they're having trouble with ScoreFlash!
     
  28. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    That's a good use case, but I meant something like as I said, showing the players score. Which means this will need to be viewable at a certain position on screen at all times (Part of the HUD) and updates the score for example whenever a new point is added.
     
  29. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Ah, ok, thank you for clarifying that. So, if I understand you correctly, you would like to use ScoreFlash basically for labels on screen, right? I hadn't thought of that possibility.

    Would you want some in-place animation when you change the value, or just keep the score there with a new value that simply immediately replaces the old value?

    If you'd just replace the old value (that's how I understood "persistent" until now - but I you might have thought of something else): What would be the advantage of using ScoreFlash for that, instead of using e.g. UnityGUI or NGUI or EZ GUI?

    One thing I could think of that might be really nice is to extend ScoreFlash in a way so that you can basically have a "label" somewhere on screen - but still use the animations for it, whenever it changes. In other words: You'd have one ScoreFlash instance for a specific "thing" (e.g. "ScoreFlashPlayerScore") and you'd be able to precisely set the position (e.g. 10 pixels from top, 10 pixels from left; or vertical center, 50 pixels from right border). When you call PushLocal on that instance, it would start the animation (e.g. fade in the score), and then just keep it there. Until you call PushLocal again (with a new score); then, the old value would be "animated out" (going through the phases to ReadEnd and then through FadeOut), while the new value is animated in.

    That's something I believe could be a very nice feature ... would that be what you want to achieve?
     
  30. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Yea! You got it! Plus in place animation is a genius idea!
     
  31. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Great! So that will come soon, as well :)
     
  32. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    The sale ends today! I've already updated the asset store but it can take a few hours until that change goes online. So, you might still be able to get ScoreFlash for $20 ... if you're fast enough ;-)

    Here's the link ScoreFlash on the Unity Asset Store

    If all goes well, ScoreFlash V3 that adds support to push "pretty much anything" as message through ScoreFlash will be released on Monday ... and 3.1, with improved "persistent" messages and a few other goodies will follow shortly after (probably by the end of next week).
     
  33. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    A little heads up for people using NGUI and building their own prefabs: When you create your own prefab using a ScoreFlashRendererNGUI component (that comes with ScoreFlash) and a UILabel (that comes with NGUI), you may run into the situation where either scale or positioning are off.

    In most cases, you do not want that ... because it may result either in the messages looking weird, out of place or scale; or even not appearing at all. Thanks to John and others for making me aware that this can be a problem.


    So here's detailed step by step instructions on how to build a prefab to be used with ScoreFlash and NGUI.

    Keep in mind: Most people can simply use the prefab that comes with ScoreFlash. I've done all that work for you ;-) ... in that case, all you need to know is this:

    But if you want to create your own awesome custom graphical achievements (you can do that with ScoreFlash 3) to be pushed through ScoreFlash, the following procedure is something you'll really want to know how to do, and do it right. Creating your totally custom achievements that might have several different texts with different fonts on them, maybe even progress bars or something awesome you come up with, will require coding on your side as well: To wire everything up. But there'll be simple examples to get you started with the basic principles (I'll focus on C# with these for now - let me know if you need Boo and/or JavaScript as well).

    I'll also add this to the main ScoreFlash documentation (probably as a little PDF in the NGUI-ScoreFlash folder) ... but for now, it's here as a heads up:

    1. Set up your UIRoot, Camera and Anchor for ScoreFlash, we'll call the Anchor "Anchor-ScoreFlash" for reference
    2. Make sure that UIRoot has Automatic checked, make sure that the anchor you want to use for ScoreFlash has "Side = TopLeft"
    3. Create empty game object, set position, rotation to (0, 0, 0), scale to (1, 1, 1) - we'll call it "ScoreFlashRenderer" for reference
    4. Pull ScoreFlashRenderer below Anchor-ScoreFlash
    5. Attach the ScoreFlashRendererNGUI component that comes with the ScoreFlash-NGUI integration to ScoreFlashRenderer
    6. Create another empty game object, pull it below your ScoreFlashRender game object- we'll call it "Label" for reference
    7. Make sure position and rotation of Label are set to (0, 0, 0), scale to (1, 1, 1)
    8. Make sure that ScoreFlashRenderer has the layer correctly set (needs to be the same layer as UIRoot and in particular the camera / Culling Mask under that UIRoot), of course, assign that layer to all children of ScoreFlashRenderer as well
    9. Attach the UILabel component that comes with NGUI to gameobject "Label"
    10. Assign a font to "Label / UILabel" ... notice that NGUI automatically adds a UIPanel to ScoreFlashRenderer ... make sure scaling is correct (ScoreFlashRenderer should have (1, 1, 1), Label should use pixel perfect, so that depends on your font's size, the SciFi Font - Header that comes with NGUI results in scale = (28, 28, 1))
    11. Make sure that Pivot of UILabel is set to Center
    12. You might want to type some text into the UILabels text field and position ScoreFlashRenderer to see what you did (do not change the position of Label relative to ScoreFlashRenderer, keep that at (0, 0, 0) unless you know what you're doing!)
    13. Make ScoreFlashRenderer a Prefab
    14. Pull that prefab into your ScoreFlash instance into Main Layout / ScoreFlash Renderer (for that you need "Rendering" set to "CustomRenderer")
    15. Make sure that Custom Parent for Renderer Instances (right below ScoreFlash Renderer) has Anchor-ScoreFlash assigned
    16. Make sure you delete ScoreFlashRenderer from the scene - you don't need it there, anymore (you did create a prefab from it, right? ;-) )
     
  34. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash 3 has been submitted to the Asset Store today, and is now pending approval. It should become available within a few hours, maybe a day. If you meanwhile want to wet your appetite - have a look at the new demo Web player on the product page:

     
  35. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash 3 is now available!

    $00_Resurrect_02.jpg

    This version adds support to push game objects that have an implementation of ScoreFlashRendererBase as component (instead of just text messages). So now you are not only able to push any kinds of graphics through ScoreFlash - but even full-blown achievements with graphics and multiple texts or even progress bars, if you wish (this will usually require coding - but extensive examples to get you started are included):

    $Achievements.jpg

    The updated ScoreFlash Demo Web Player (click to start):

    $ScoreFlashV3_Teaser_01.jpg

    Release notes for Version 3:

    • ScoreFlash now supports pushing any kind of object - instead of just strings; in particular, you can pass in custom renderers! This is awesome because it lets you create any kind of complex object and have it animated by score flash, as the new example scene Advanced / Achievements illustrates (includes all C# source code). This is an advanced feature so it will require custom coding if you want to use it fully - but it's tremendously powerful (and for beginners, you can simply re-use my examples to get started).
    • New example scene Advanced / ScoreFlashAsContextUI - illustrates how you can use some of the new features to create a context menu for game objects using ScoreFlash and custom renderers
    • New property spreadImmediately (Readability and Performance Tweaks / Spread Immediately) that will make messages spread immediately when too many are coming too quickly, instead of waiting for the read phase. The default is “false”, to not break existing code - but most likely, if you push many messages, you’ll want to set this to true!
    • ScoreMessage.Text can now also be set - so you can change the text while the message is already animated. There’s also an even more powerful method ScoreMessage.UpdateMessage(...) that handles any object.
    • ScoreMessage.UpdateColor - can be used to change the color of a message while it’s in the animation queue; use this, for example, to turn a green message (“received score”) to a red message (“lost score”)
    • NGUtil now has new methods Scale(Vector2) and ScaleInverse(Vector2) to easily convert “standard density” positions (Vector2) to “high density / retina” positions
    • The previously internal variable bool ScoreMessage.fadeQuickly is now a public property float LocalTimeScale - this allows you to make specific messages "hurry up" whenever you need it … and it also allows you to make specific messages "persistent" by setting it to 0
    • New property ScoreMessage.FreezeOnRead - if set to true, this will freeze the message after it has completed its FadeIn phase; that way, you can keep messages on screen ... to make the message move on at a later point in time, simply set ScoreMessage.LocalTimeScale to 1 later on
    • Added ScoreMessage.CurrentPhase to check an individual message's current phase (FadeIn, Read, FadeOut)
    • ScoreFlashFollow3D: When Leave Behind is 0, and Lose Momentum is 1, message is now “locked” on the object that is being followed (you get a message in the inspector when this occurs - usually, you'll want that with those settings, if not: just make it not exactly 0 and 1 but e.g. 0.001 or 0.999)
    • Includes bonus Substance (for Tron-style rasters as you can see them in Traces of Illumination)
    • Many small improvements to the API documentation
    • Much improved documentation for usage with Intellisense: Before, I had put everything into summary-tags ... which is fine for the online documentation but terrible for Intellisense (which will have huge tooltips pop up). I’ve reviewed all documentation and now have just a very brief summary and all the details in remark-tags. So they still show up in the online documentation - but no longer in Intellisense.
    • Bug: Reloading scenes in editor could cause message "Restored ScoreFlash.Instance - most likely you did a recompile while playing, all is good, no worries" which was misleading - FIXED
    • Bugfix in NGUI-Integration: Fixed ScoreFlashRendererNGUI.GetSize(...) - the previously returned wrong results (too small) which resulted in “minDistanceBetweenMsg” needing much higher values than it should have needed
     
  36. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    For some reason I bought ScoreFlash assuming to use it for what u guys just discussed, good to hear it is coming :)
     
  37. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hey, thanks for buying ScoreFlash! :)

    The next version which includes these new features is around the corner. But those new features do come with some tricky changes and I didn't want to risk delaying 3.0 for those (even though they certainly would have been nice for a major release) because I might have to try several approaches to really get it right.

    Send me a private message with your invoice number if you're interested in testing a beta version (btw, that applies to anyone - feel invited ;-) ). For 3.1, having a little extended beta-phase is probably a good idea.
     
  38. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hey everyone!

    I'd like to share the current status of development with you - ScoreFlash 3.1 is coming along quite well even though I did a lot more than I originally planned. The reason is: Controlling the various screen alignments, inner anchors, padding, width, offset position and all of that became pretty technical and annoying. With all the possibilities you now have, it got really complex and non-intuitive to control all of this using the inspector.

    So ... It just wasn't fun anymore!

    So ... I decided to create a little visual designer to make setting up the main layout awesome again.

    Let me introduce to you - in the middle of development - the ScoreFlash visual designer:

    $ScreenshotDesigner_01.png

    So ... in the above image, there's a lot of information. Using the two locks you can simplify things - the left lock controls whether you want to lock the inner anchor to the screen alignment (which is usually what you'll want). If that's locked, the GUI for setting the inner anchors disappears. The right lock controls whether you want to set up the screen alignment. Usually, you just do that in the beginning, and then all those buttons are just distracting - so you can "lock" screen align, which removes the buttons from view, making the screen really tidy.

    Below, you see what I see while I'm dragging the position around. One that I believe is a little tricky to understand is that depending on the screen alignment, the position is either "pixels right, pixels down" (TopLeft, TopCenter, MiddleLeft, MiddleCenter), or "pixels left, pixels down" (TopRight, MiddleRight), or "pixels right, pixels up" (BottomLeft, BottomCenter) ... or ... finally "pixels left, pixels up" (BottomRight). While that may sound unnecessarily complicated - the awesome thing about it is that switching the alignment usually gives you useful results immediately without you having to go from positive to negative or the other way round.

    To make it really intuitive, I've added these little blue, green and red lines and the coordinate tooltip while dragging. Basically, when you play with it for a minute, you should be familiar with how this works:

    $ScreenshotDesigner_02.png

    There's still quite a bit of work ahead but I'm confident that I'll submit a version to release during this upcoming week.
     
  39. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    WOW!!! :) Great stuff Jashan! ^^
     
  40. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash V3.1 is now feature complete. So I'm just finishing up documentation, doing some additional testing (especially regarding upgrading from previous versions) and then it's ready for the Asset Store. Even though it's just a .1-release, this is actually pretty big and adds quite a bit to what's possible with ScoreFlash.

    TL;DR: 3.1 adds free positioning of messages on screen and a layout component to set up ScoreFlash based HUDs, a nice visual designer, moving the messages on both Y and X ... and much improved documentation (right in the inspector)

    Here's a preview video this upcoming new version:

     
  41. iwishash1

    iwishash1

    Joined:
    Jul 8, 2012
    Posts:
    11
    Hi
    After added ScoreFlash effect in my game, I got a problem.
    I'm not sure this caused by ScoreFlash or Unity..

    My ScoreFlash effect is simple.
    Showing text message during 0.5sec, then disappear. (It's "combo" messages)
    When I play first time, it works well.
    But when retried game, combo events occur, ScoreFlash effect dosen't works good.
    Labels are generated but did not disappeared and the animation dosen't works.
    So the labels just stack on screen.

    here is captured image.
    $img_bug.png

    It seems to happen only on mobile devices. (Android / iPhone)

    I'm using Unity4, NGUI, ScoreFlash3.0.
    There are 3 cameras with different layers. (Main Camera, NGUI Camera, ScoreFlash Camera)
    The ScoreFlash setting is default for NGUI.

    Any advice would be appreciated.
    Thank you.
     

    Attached Files:

    Last edited: Mar 6, 2013
  42. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi iwishash, thank you for contacting me about this. From the screenshots, it looks a little like you might be pushing the same message many times. So that's the first thing I'd try to check. For example, if you're using ScoreFlash.Instance.PushLocal(...) in Update() or LateUpdate() and don't have code that prevents this statement from being executed each frame, this would probably generate the effect you're seeing (there's a couple of other possibilities but those are the most obvious ones).

    However, if that was the case, it would most likely also happen in the editor (unless there's some code in your game that's executed differently depending on platform). I'm also sending you a private message.
     
  43. iwishash1

    iwishash1

    Joined:
    Jul 8, 2012
    Posts:
    11
    Hi Jashan
    Thank you for reply.

    I think the problem has been solved!
    The reason was "Ensure Singleton?" check.
    My detail symptom was like below.
    At first play, works good.
    Game end, go to the UI menu (another scene) then hit play which load game scene again, ScoreFlash effect dosen't works well but only stack on screen.
    I tried to uncheck "Ensure Singleton?" option on ScoreFlashManager then..it solved!
    (Should read the documentation more detail..)
    (I still don't understand why these things not happened on PC/MAC)

    I've been tried to solve this problem a whole week.
    So I'm very glad :D

    Thank you again.
     
  44. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    It's great to hear that it's working for you now ... and I'm sorry to hear it took you so long to figure it out. If you run into an issue - feel free to contact me either via the forum or directly via email (it seems like sometimes, the forum notifications don't work). Here's the contact link:

    http://narayana-games.net/Contact/ReportAProblem.aspx
     
  45. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I'm sorry this update (3.1) is taking much longer than I had anticipated. There's three reasons for that:

    a) While implementing the new features, I realized that the usability became much worse due to more complex possibilities. To solve that, I added further new features which make ScoreFlash much easier to use. This is why ScoreFlash now has a visual designer. Obviously, adding this made the codebase I have to deal with much more complex. But in my opinion, it's worth it because I want ScoreFlash to be as easy and as much fun to use as possible.

    b) In the testing phase, I ran into quite a few unexpected issues that I wanted to fix before doing a release (even though a few of them would have only had effect on a small part of the user base). A little heads up: I might consider dropping Flash support in the future. It's still in there for 3.1 but has some limitations. If you need Flash support, please let me know. I only have the beta-Flash target that comes with Unity 3.5.7 and don't plan on getting an actual license for 4.0 ... unless you convince me that I should. Also, NGUI and EZ GUI aren't playing quite as nicely with the new designer as I'd hope. Possibly, I'll disable the actual "rendering" when using the designer in a future version but for 3.1 I'll keep it and am hoping to get your feedback on this.

    c) Finally, there also was some pressure coming in from external contract projects. At the moment, even though ScoreFlash at times ranks pretty high in the Asset Store Top Ten (under Scripting / GUI; both in Top Paid and Top Grossing), up until now each hour I spend working on ScoreFlash has a return of about 1/10 of the money I receive when doing contract work. Working on ScoreFlash is certainly more fun and more rewarding on every other level - but the financial level still is a pretty strong motivator resulting in "high priority" when you have monthly bills to pay. Of course, I'm doing my best to make sure as many people as possible find out about ScoreFlash, and find it useful enough to make a purchase ... and ... hint hint ... this is something that you can also help me with (Twitter, Facebook, Google Plus, Linked In make this very easy).

    We're almost there! I'm pretty sure that I'll push ScoreFlash 3.1 to the Asset Store tomorrow, so it should become available this week. Also, I've already updated the online API documentation and created an update guide. If you haven't created custom renderers (e.g. for achievements), this is not really relevant for you. But if you have - please make sure to read this before you update:


    I'll keep you updated how things go with the release.​
     
  46. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    At last: Submitted ScoreFlash V3.1 to the Asset Store
    Here's the detailed change list:

    • Documentation is now available right inside the inspectors: Each property has a tooltip based on the API documentation. Plus: You can activate documentation which shows all this information embedded right where it’s relevant - Plus: Any links in the documentation or to external sources get a button with what it links to. Click the button, and the relevant link is opened right in your browser. Isn’t this awesome!?
    • Added support for horizontal animations: Fade In Phase / Initial Offset X and Offset X to 0 (curve), Reading Phase / Velocity X from 0 to Read and Read End Float Right Velocity, and Fade Out Phase / Velocity X from Read End and Final Float Right Right Velocity
    • Full Screen Alignment / Anchor support: Main Layout / Screen Align now has TopLeft, MiddleLeft, BottomLeft, and TopRight, MiddleRight, BottomRight in addition to Top, Middle and Bottom (which are still all centered ;-) ); instead of showing the ScreenAlign enum, now showing a graphical 9 Button view (which is much easier to use); New property Main Layout / Inner Anchor that controls how text is aligned; for example, you could have Screen Align TopLeft but Inner Anchor TopRight for nicely right-aligning numbers
    • New MonoBehaviour ScoreFlashLayout: New component that you can use to have different layout settings when using just a single instance of ScoreFlash
    • Added a new design mode: Now you can visually design the layout of ScoreFlash in game view, in the editor, even when not playing; switch on and off via Main Layout / Design Mode
    • Improved Handling of Padding: Much improved the possibilities with Main Layout / Min Padding Left/Right - this now automatically uses left / right padding for right / left alignment, and left right padding for center alignment, and has a new property Max Width which defines the maximum width of the message (this can be smaller than the value that would result from using the padding); so you now can control the maximum width of the message either via screen position (“leave at least X pixel from the screen border”) or the maximum width of the message ... you can control Min Padding Left/Right and Max Width conveniently using the new visual designer (the green and cyan drag-buttons)
    • Messages pushed via ScoreFlashFollow3D no longer use minPaddingX - this never really made sense (and would usually result in unexpected behavior) ... now, using maxWidth, this is much easier to control
    • Fixed a half-height up offset when using ScoreFlashFollow3D; this was kind of useful before innerAnchor was added - but with innerAnchor, it become an actual bug; IMPORTANT: If you’re using ScoreFlashFollow3D, you might have to fix ScreenPositionOffset.Y; but getting the position just right is much much easier now, and should be a lot more fun! :)
    • Push directly to ScoreFlashFollow3D: ScoreFlashFollow3D now has defaultScoreFlash so you can assign a ScoreFlash instance to used for pushing message, and two Push()-methods (one without, and one with Color). This way, you can now directly “push messages to a ScoreFlashFollow3D” (which may result in more intuitive code).
    • FreezeOnRead for ScoreFlashFollow3D and ScoreFlashLayout: Added “FreezeOnRead” as a checkbox to ScoreFlashFollow3D and ScoreFlashLayout, that automatically assigns freezeOnRead to messages pushed directly to this instance (using the new Push()-methods on ScoreFlashFollow3D/ScoreFlashLayout). When a new message is pushed, the old one resumes its animation, so you can easily change messages by using the framework (and have automatic animations for the text or object changing); or use direct access to CurrentMessage to alter the text (without animation)
    • Multi-Object Editing: ScoreFlashFollow3D and the new ScoreFlashLayout support multi-object editing; ScoreFlash currently doesn’t because I think it would cause more harm than benefit (but I’d implement it if anyone provides interesting use cases)
    • Much improved debug information: Shows a little statistics area in game view with the number of queues of the currently selected ScoreFlash instance, and how many items each queue currently carries; and various Debug Modes that you can set up: NormalMessages, LocalPosition, ScreenPosition, FullRect, Velocity, Age, Alignment
    • Update mechanism: An update mechanism was added in this version for when there are refactorings between two versions; 3.1.0 initializes this update mechanism and it is very important that everyone upgrades to 3.1.0 before upgrading to any later version - so I highly recommend doing so now (but 3.2 will probably take a little while to come out, so don’t feel pressured ;-) )
    • The main ScoreFlash prefab no longer as “Ensure Singleton” checked. This has been causing way too much trouble. If you need “Ensure Singleton”, just re-activate it
    • Known issue: Designer doesn’t work too well with NGUI / EZ GUI (there’s some offsets that are very difficult to handle)
    • Known issue: Layout doesn’t properly work in Flash (alignments are sometimes off); Flash support will be phased out with the next version
     
  47. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    412
    Great Update and Asset...Definitely one of the most Polished asset I've purchased.
     
  48. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Thank you! That's some very nice feedback and very much appreciated!

    I'm still waiting for 3.1 to be approved but meanwhile have uploaded a new version of the demo Web player which now includes scenes illustrating some of the new features (ScoreFlashLayout, animations on the horizontal axis). This demo Web player is built with Unity 4.1 and I've also fixed an issue with the Substances in the "ScoreFlashAsContextUI" scene (I had the substances in a pretty high resolution and when built with 3.5.7 that caused scene load to be terribly slow in the Web player ... I hope this didn't scare anyone away ).

    $ScoreFlashV3.1_DemoWebPlayer.png


    Here's an overview of the included scenes and what they illustrate:

    1. Scene 1: Achievements (Xamples-ScoreFlash/Advanced/AchievementsExample/Achievements).
      Shows two bouncing spheres with attached labels (this is implemented using ScoreFlashFollow3D), "scores" in different colors rendered using the default approach, aligned to bottom center of the screen. This also includes logic that updates messages while they are in the animation pipeline. Finally, a few UnityGUI based "achievements" are pushed, with sound
    2. Scene 2: ScoreFlashLayout (Xamples-ScoreFlash/Xample_TestLayout).
      This whole scene is only using a single ScoreFlash instance. However, we have a "static", left-aligned label (this uses "FreezeOnRead") on the top left, and scores being "pushed" right of that label, right-aligned (this also uses "FreezeOnRead", however, since new messages are being pushed, the old scores are gracefully "animated out of view" ... while writing this I'm realizing that I probably shouldn't have made this so quick because that kind of dilutes the effect). On the middle right, there's another list of scores ... finally, there's two rotating boxes using ScoreFlashFollow3D. The interesting thing to see here: The left one uses the hierarchy so that the location of the messages "rotates" (and it's left-aligned), the right one is right-aligned and the messages are located right above the box, the rotation has no effect on the message positions.
    3. Scene 3: Achievements pushed via PlayMaker (PlayMaker-ScoreFlash/Examples/Achievements/AchievementsPlayMaker).
      Very similar to Scene 1, only this time it's done using PlayMaker. One thing to be aware of: The custom renderers used to render the custom achievements need to be coded. There's examples included but you cannot achieve this with PlayMaker alone.
    4. Scene 4: ScoreFlash as Context UI (Xamples-ScoreFlash/Advanced/ScoreFlashAsContextUI).
      This is one of my favorites because it really shows what kinds of things you can do with ScoreFlash if you do a little extra coding: There's a sphere which has a context UI popup on mouse-over. This is implemented using a UnityGUI based ScoreFlash custom renderer. In other words: The animation of showing / hiding this is done using ScoreFlash, using FreezeOnRead to make the GUI stay after it has been "animated in". You can make the sphere go to different locations (that's done Unity's built-in NavMesh).
    5. Scene 5: ScoreFlashFollow3D demo (Xamples-ScoreFlash/Advanced/WorldSpaceMessages/WorldSpaceMessages).
      A couple of bouncing objects with different configurations of ScoreFlashFollow3D. You can make the messages be "fixed" to the objects, or have the dragged after the object. Another feature this shows: There's a sphere "flying" in an arc from left to right, which is destroyed somewhere in the middle of the screen. The cool thing about this: The score flash messages keep the momentum instead of suddenly stopping.
    6. Scene 6: PushScreen Demo (Xamples-ScoreFlash/Advanced/ScreenSpaceMessages/Xample_XMouseClickMessages).
      Shows how ScoreFlash.Instance.PushScreen can be used to make messages appear where the user clicks with the mouse (or taps when on mobile).
    7. Scene 7: A few settings exposed (Xamples-ScoreFlash/Advanced/Xample-XDemoScoreFlash/XDemoScoreFlash).
      Lets you set a few of the settings ScoreFlash offers right in the editor. This is only a small subset but gives you a bit of an impression of what's possible.
    8. Scene 8: Outline Demo (Xamples-ScoreFlash/Advanced/Xample-XDemoScoreFlash/XDemoScoreFlashColorFul).
      Pretty much the same as Scene 7 but with a gradient in the background to show the usefulness of outlines
    9. Scene 9: ScoreFlashManager (Xamples-ScoreFlash/Advanced/MultipleInstancesOfScoreFlash/MultipleInstances).
      Illustrates how ScoreFlashManager can be used to have different instances of ScoreFlash with completely different settings in a single scene.
    10. Scene 10: NGUI Demo Scene (NGUI-ScoreFlash/Example1_ScoreFlashNGUI).
      Shows how ScoreFlash can be used with NGUI, using a custom renderer that's specifically designed for NGUI.
    11. Scene 11: NGUI ScoreFlashFollow3D Demo (NGUI-ScoreFlash/Example2_NGUIWorldSpaceMessages).
      The same as Scene 5 - but using NGUI for rendering the messages.
    12. Scene 12: PlayMaker Demo (PlayMaker-ScoreFlash/Examples/Example1-PlayMaker-SingleInstance).
      A simple PlayMaker example.
    13. Scene 13: PlayMaker NGUI Worldspace (PlayMaker-ScoreFlash/Examples-WithNGUI/Example2-NGUIPlayMaker-SingleInstance).
      This combines Scene 5 and Scene 11 with PlayMaker.
    14. Scene 14: Horizontal Animations (Xamples-ScoreFlash/Xample_AnimatingXandY_1).
      Shows the new "horizontal animations" feature.
     
  49. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Just a little heads up in case you're running into an issue that you need urgent support with: It seems that after the forum upgrade, the immediate forum notifications either don't get through at all, or get through with some rather significant delay. Since I'm not monitoring this thread all the time (polling isn't that much fun ), if it's urgent please write a message to the email address on this page:


    Also, feel free to contact me via Skype. I'm online most of the time, so that's really the best way to reach me. Just make sure to mention "ScoreFlash" in the contact request so I know you're not a spammer ... my Skype handle is jashanchittesh

    At the moment, I'm still waiting for the approval of ScoreFlash 3.1 - I this will happen on Monday (tomorrow) ...
     
  50. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307