Search Unity

[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
    Important heads up for all PlayMaker users: Unity 4.5 introduced UnityEngine.TooltipAttribute - which also exists in PlayMaker and is used by its ScoreFlash integration. So when you're trying to use the ScoreFlash-PlayMaker integration in Unity 4.5, you'll get ambiguous reference and type or namespace name "Tooltip" could not be found compilation errors and the ScoreFlash actions won't show up.

    Here's the first two error messages (in case anyone searches this globally via a search engine instead of checking this thread first):

    Assets/PlayMaker-ScoreFlash/ScoreFlashPushFollow3D.cs(13,6): error CS0246: The type or namespace name `Tooltip' could not be found. Are you missing a using directive or an assembly reference?

    Assets/PlayMaker-ScoreFlash/ScoreFlashPushFollow3D.cs(13,6): error CS0104: `TooltipAttribute' is an ambiguous reference between `UnityEngine.TooltipAttribute' and `HutongGames.PlayMaker.TooltipAttribute'


    So as a quick fix you can download the updated ScoreFlash-PlayMaker integration right here :)

    The next version of ScoreFlash will also have this updated, so this only happens with ScoreFlash versions until ScoreFlash 3.2.2 (which was released before Unity 4.5 was released ;-) ).
     
  2. SLThompson

    SLThompson

    Joined:
    Feb 7, 2014
    Posts:
    49
    I'm having an issue getting the text to show up just on the player's camera that it's supposed to, I'm networking/Photon. Is there a fix or solution?
     
  3. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Sure ;-) did you receive the reply I sent to your email-request yesterday? I had sent that mail 8 minutes after I received your request (that was luck - usually I don't even read email that quickly, but I was just in the process of finishing up some work on ScoreFlash 4 when your email came in, so that was kind of cool ;-) ).

    Let me know if you need more information - but to help you further I'll probably need to have more details on your exact setup, which part is already working and which is not, and it's probably more an issue related to your networking setup than ScoreFlash (but that's certainly not a problem - I originally developer ScoreFlash in the context of Traces of Illumination which is also a multiplayer game, so that's something I'm quite familiar with).
     
    Last edited: Jul 26, 2014
  4. SLThompson

    SLThompson

    Joined:
    Feb 7, 2014
    Posts:
    49
    Sorry, never got an email. (jefftechstuff@gmail.com). I finally got it running but the text displays on all player's screens. (Just using ScoreFlash in scene) I really want the text to be displayed around the players when they are hit. So I would need a scoreflash gameobject in scene and attach the follow3d script to the player and call scoreflash.worldpush(?, ?, ?) if there is anything else, please email.
     
  5. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    That's weird. This is the mail-address I sent it to. Can you check your spam-folder? Gmail sometimes does weird stuff. I'll resend it right now, so you should receive it twice ;-)

    Here's the comment from my mail-message, you suggested using: IScoreFlash.PushWorld(ScoreFlashFollow3D, object, GUIStyle, GUIStyle), so I replied:

    Well, either this one, or ScoreFlashFollow3D.Push(object message) ... which I guess is probably the preferable approach, because it's simpler and better coding style.

    Skipping your code example.

    Assuming that this piece of code belongs to a script that is attached to the same game object as ScoreFlashFollow3D, you could do:

    ScoreFlashFollow3D myScoreFlashFollow3D = GetComponent<ScoreFlashFollow3D>();
    myScoreFlashFollow3D.Push(string.Format("This player was hit, current hitpoints: {0}", currentHitPoints);


    It might be safer, though, to have a public variable on that script, outside any method, like:

    public ScoreFlashFollow3D myScoreFlashFollow3D = null;

    ... and then, again, you could do:

    myScoreFlashFollow3D.Push(string.Format("This player was hit, current hitpoints: {0}", currentHitPoints);

    ... but you'd have to set it up properly in the editor (drag the object that has ScoreFlashFollow3D attached from the scene hierarchy into that slot "My Score Flash Follow 3D".
     
  6. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    For that part, more context would really be necessary. But basically what you need to do is check whether the message is about the current player. There's plenty of ways how you could do that, and most likely you'll already have something implemented for this purpose - then all you need to do is check against this condition ("this message is relevant for the current player") and you should be fine.
     
  7. SLThompson

    SLThompson

    Joined:
    Feb 7, 2014
    Posts:
    49
    I'm getting errors for the following; (line 42 & line 45) Using Unity 4.5.2

    Assets/Plugins/NarayanaGames/ScoreFlash/Component/ScoreFlashFollow3DLocation.cs(42,53): warning CS0618: `UnityEngine.GameObject.active' is obsolete: `GameObject.active is obsolete. Use GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy.'

    #if !UNITY_4_0 && !UNITY_4_1 && !UNITY_4_2 && !UNITY_4_3 && !UNITY_4_4
    if (target != null && target.gameObject.active && !wasEnabled) {
    Init();
    }
    wasEnabled = target == null ? false : target.gameObject.active;
    #else // UNITY_4_0 deprecated gameObject.active => do it Unity 4 style ;-)
    if (target != null && target.gameObject.activeInHierarchy && !wasEnabled) {
    Init();
    }
    wasEnabled = target == null ? false : target.gameObject.activeInHierarchy;
    #endif // !UNITY_4_0
     
  8. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    That's actually just a warning, not an error. It's because I missed adding a few "&& !UNITY_4_5" before releasing the last version. It will be fixed in ScoreFlash 4 which will be released very soon (probably this week). While warnings aren't nice, it's not something to be too concerned about.

    Did you receive my email message?
     
  9. SLThompson

    SLThompson

    Joined:
    Feb 7, 2014
    Posts:
    49
    "... but you'd have to set it up properly in the editor (drag the object that has ScoreFlashFollow3D attached from the scene hierarchy into that slot "My Score Flash Follow 3D".

    ScoreFlashFollow3D is attached to the player that is instantiated at the beginning of the game and not initially in the scene, it doesn't want to allow the player gameObject to be inserted.

    Also, i assume the ref camera is the player.main camera and the default scoreflash would be the one I have in the hierarchy for the scene, correct?
     
  10. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    What do you mean by "it doesn't want to allow the player gameObject to be inserted"?

    Yes, that's correct. It's probably best if you assign the camera to ScoreFlashFollow3D from script after the player was instantiated. If you only have a single instance of ScoreFlash in your scene, "default scoreflash" will be automatically picked up, so that's something you don't need to worry about.

    Also, make sure to assign "Renderer of Target" if it's possible that your player is out of view. You can use any mesh from your player character.
     
  11. SLThompson

    SLThompson

    Joined:
    Feb 7, 2014
    Posts:
    49
    I got it, thank you.
     
  12. SLThompson

    SLThompson

    Joined:
    Feb 7, 2014
    Posts:
    49
    I solved it... and it was a stupid mistake. Because I had been attaching the script to the camera it was rendering the text infront of the player and was causing both players to see the image. It seems to be the most simple sometimes :)
     
  13. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    yep, im doing this in my game actually, just use an [rpc] to push message from the masterserver, then everyone will see the push message
     
  14. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    That's weird - it seems the original question disappeared. I hope it's okay to quote the original question "anonymously" for reference (I received it via email, using the forum notifications):

    ... and Damien already answered, thank you! But I'd like to add some more information: Assuming you're thinking of chat messages that appear above player's heads, this is actually one of the nice use cases for ScoreFlash. For this purpose, you'd use ScoreFlashFollow3D that you either attach directly to the player over who's head the message should appear, or to a reference object (just an empty game object that has precisely the correct position - this is sometimes easier to set up even though ScoreFlashFollow3D does have 3D and 2D offsets that you can also use for that purpose). Obviously, ScoreFlash only handles the message animation part. You still need to implement everything related to networking yourself, and the input fields and all of that. Also, when you use this approach, you won't have the ability to keep the messages and scroll up/down or things like that.

    One thing that's kind of nice is that ScoreFlash does already have a mechanism to "push messages up" when there's multiple messages coming through quickly. So that also helps for this specific use case.

    You could also define an area where chat messages of all players are displayed (or also events, like damage/healing points). However, in some cases it might be more elegant to use an actual scroll-list for this purpose (which, for example, would also give you the possibility to keep those messages over a longer period of time and then have the player scroll "back in time" - that's something you won't be able to do with ScoreFlash).
     
  15. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    A little heads up for everyone: While testing ScoreFlash 4, I noticed that there was a problem with making changes in play mode persistence (this is one of the really cool features that ScoreFlash offers - but maybe it was a little too hidden for most people to find ;-) ).

    I'm not exactly sure which version of Unity introduced this issue - I did fix it for Unity 4.0 (with an approach that was not compatible with Unity 3.5.7, so I had to maintain both approaches) but one of the more recent versions of Unity apparently changed something that broke this feature and it slipped through my QA. Sorry about that. Since nobody complained (aka "bug reported" ;-) ), yet, it seemingly isn't as severe as I'd think it is ;-)

    Anyways, this issue is fixed in ScoreFlash 4 which is just about to be released to the Asset Store. I've also moved the checkboxes that control this feature up in the inspector to make it more visible. So this video will be a little outdated soon - but I guess you'll find it even more easily, anyways:

     
  16. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash V4.0.0 is now available on the Unity Asset Store

    Release notes:

    • Now requires Unity 4.3.4; previous versions are still support with included package ScoreFlash 3.2.3
    • Clean-Up: Cleaned up mess of code that were necessary to support different versions of Unity. ScoreFlash now requires at least Unity 4.3.4! An updated Unity 3.5.7 version (ScoreFlash 3.2.3) is still included in case you need it for legacy projects that you cannot upgrade
    • Added integration for Text Mesh Pro!
    • Added integration for Daikon Forge GUI (this already had been available for 3.2.2 - but now it's officially supported)!
    • Much improved how I’m handling the different integrations: Previously, I had separate projects for each integration which was really cumbersome and annoying ... now all except EZ GUI is in a single project (unfortunately, both NGUI and EZ GUI use the same names for classes and neither of them uses namespaces, which is a shame ... I like EZ GUI better but unfortunately, NGUI is more popular); in this context I’ve also changed the naming convention: instead of “OtherPackage - ScoreFlash”, I now use “ScoreFlash - OtherPackage” which makes things much easier for me, and not more difficult for anyone else
    • Fixed an issue that occurred with recent versions NGUI because widgets were added multiple times to UIPanel, also fixed issues due to changes in NGUI regarding positioning grabbed from uGUI (width/height) and cleaned up NGUI examples (this fix was also backported into 3.2.3)
    • Fixed an issue with Unity 4.5 and the PlayMaker integration because Unity 4.5 introduced Tooltip in its default namespace (shame on them for not using namespaces properly), which conflicted with the PlayMaker implementation of “Tooltip” (which was in its correct namespace - but as we usually need UnityEngine, this was causing a naming conflict / ambiguous reference compilation error) (this fix was also backported into 3.2.3)
    • No longer instantiating objects with integrations (NGUI etc.) in design mode; using plain UnityGUI in that case instead (it’s just a “preview” anyways!)
    • Fixed a small bug in documentation that is embedded in inspector (“Show documentation”): replaced <strong> with <b> to properly have the type displayed in bold
    • Fixed issue with persistent play mode changes - there apparently was a change in Unity that broke this when done automatically (manually keeping the changes still did work)
    • Made persistent play mode changes more visible by pulling them to the top of the inspector GUIs
    • Removed verbose logging from play mode changes - now the only stuff that gets logged is the history (which should be quite useful)
    • Editor classes are now in proper namespaces (proper namespace support was introduced with Unity 4, so now I can use it :) )
     
  17. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    There's a new complete project of ScoreFlash integrated into UT's tech demo "Angry Bots" that I've just uploaded to the Asset Store. This runs by the name "ScoreFlash Angry Bots Tutorial". I've also written a 22-page PDF with all the steps I took to get this working (it was quite easy, of course ;-) ). While the Asset Store team reviews this package, feel free to already have a look at the Tutorial and let me know if this is useful for you and easy to follow.

    You can downloaded it here:

    Tutorial: Adding ScoreFlash to AngryBots

    If things go well, I'll create something similar for "Unity Projects: 2D Platformer", to also have 2D games covered.

    Another thing that's in the works is a VR demo. I've introduced Text Mesh support for that purpose (to avoid any dependencies) but this also already works with Text Mesh Pro. So, if you're working on Oculus Rift games (or Sony Project Morpheus games ... or whatever other VR headsets are becoming available), ScoreFlash might also be for you ;-)

    Oh, and not to forget: uGUI support is also coming. I should have this ready by the time Unity 4.6 gets released and it will be an integration very similar to the ones I already have for EZ GUI, Daikon Forge GUI, Text Mesh Pro, NoesisGUI and NGUI ;-) ... there's still a few of those packages stuck in the review process. But these three are already available on the asset store (I moved those out of the main package to have a better overview on how many people use which addons):
    • ScoreFlash TextMesh Pro Addon
    • ScoreFlash Daikon Forge GUI Addon
    • ScoreFlash NGUI Addon
    • ScoreFlash EZ GUI Addon (pending review, updated: 2014-07-30)
    • ScoreFlash NoesisGUI Addon (pending review, updated: 2014-07-30)
    • ScoreFlash PlayMaker Addon (pending review, updated: 2014-07-30)
    • ScoreFlash SpriteManager 2 Addon (pending review, updated: 2014-07-30)
    • ScoreFlash Angry Bots Tutorial (pending review, updated: 2014-08-03)
     
    hopeful likes this.
  18. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
  19. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    what is the difference between ngui plugin included in scoreflash V4 and the appart NGUI package? it look same but im not sure
     
  20. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Damien,

    At the moment, it's the same - but I'm no longer including the packages directly in ScoreFlash. The main reason is because whenever there was an issue in any of the integrations, I'd have to ship a complete new version of ScoreFlash just to get that fixed. Usually, there's no changes necessary in the core of ScoreFlash to get issues with the integrations fixed.

    Another thing that's quite nice about the new approach is that I can track much more easily how popular the integrations are. Since not all of the integrations were published on the same day, it's still too early to say anything specific about this - but I can already see some trends. After September, I'll be able to say rather precisely how often which package got downloaded and compare those figures. Also, I'll be able to see the impact that uGUI has (and I'm pretty sure it will have a rather severe impact on packages like NGUI or Daikon Forge GUI but not so much on something like NoesisGUI or Text Mesh Pro because unlike the former the latter don't really compete with uGUI).

    Finally, I spend a significant amount of time on supporting and developing the integrations. However, ScoreFlash currently only has one price and everything is included. So even if you don't care at all about NGUI and Daikon Forge and Text Mesh Pro and PlayMaker and NoesisGUI and EZ GUI and SpriteManager 2 and Text Box - you still have to pay the price that has all of this included. Which really isn't quite fair.

    So in the long term (probably first quarter of 2015), I'll start charging for the integrations and reduce the price of ScoreFlash a little bit (at the moment I'm at $40 for a little test - but the actual price is still $50). So if you already own ScoreFlash, I recommend getting the free addons because I believe that once you've downloaded them, you should be able to still download them once I've added a price. If for some reason that doesn't work (I'll probably increase the price of the NGUI package to $2 for just a few days just to make sure this works properly), I could have a $2 transition period during which hopefully most people that already have ScoreFlash will update.

    Unfortunately, I have no way of directly contacting all my customers. So I hope most people have subscribed to this thread, or follow me on Twitter, Google+ and/or Facebook. I will also contact everyone that contacted me via email for an update and heads up ... and then have a long transition period so that hopefully most people will get the free integrations as long as they're still free ;-)

    Sunny regards,
    Jashan
     
  21. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    The full "Save the Bots" demo project is now also available on the Unity Asset Store - this includes a free demo version of ScoreFlash (no source code, no builds - just a DLL):

    SaveTheBotsScreen.png

     
  22. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I have just released a small patch release for the ScoreFlash NGUI Addon. That's 4.0.2. This fixes an issue in the renderer prefab that made the texts appear way to big in builds.

    Oh, and btw, here's the complete lists of addons and tutorials for ScoreFlash (they have all been accepted in the Asset Store by now):
     
    hopeful likes this.
  23. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    A little request to everyone using the addons / integrations (TextMesh Pro, NoesisGUI, Daikon Forage GUI, NGUI, EZ GUI, PlayMaker, SpriteManager 2): If you like these addons, it would be lovely if you could rate them on the asset store. You find all the links in the posting above ;-)

    If there's anything you feel is missing / not so nice - please let me know so I can fix it ;-)

    Also: Make sure to get these addons while they are free.

    An addon for the new Unity UI (fka uGUI) is already in the works and will be available very soon (Unity 4.6 is finally becoming pretty stable ;-) ). It should be fairly easy to switch from any of the existing addons/integrations to pure Unity 4.6.
     
    hopeful likes this.
  24. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash 4.6 which also supports the new Unity UI (fka uGUI) is now in review - so I hope it'll still be available before christmas. I'll post some tutorial / demo videos during the next few days, so stay tuned.

    It's also time to make the other addons "pay-for" now, so if you haven't done so, yet, make sure to get any ScoreFlash addons you need while you still can for free (I'm assuming that when you have downloaded the addon for free, you'll still be able to keep downloading new versions once I make it "for-pay").
     
  25. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash 4.6.1 is now available on the Asset Store. This version fully supports Unity UI (fka uGUI), the new GUI system in Unity. It also has a few bugfixes and more example scenes.

    And even better:

    It's on sale - $25 instead $50, so that's 50% off!

    If you haven't done so:


    And there's also an updated product video available now:


    Let me know what you think - and if you have any questions: This is the place to ask :)
     
  26. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    Hello, great news that is again on sale at 50%, I missed it the first time, and now finally I have been able to buy it, as until now I did not really need it, but now I want to make some achievements and communications to the player, and show health points, so I think this is the best for making this.

    Also I had not though that this can be used also for making tutorial and show how to play, cool and good idea

    Thanks very much for the sale and for keeping this great asset alive and kicking with updates and giving good support
     
    jashan likes this.
  27. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Yeah, interestingly, that's how I got this Asset started: As a way to show tutorial messages in Traces of Illumination. But it has come a really really long way since then ;-)
     
  28. technicept

    technicept

    Joined:
    Jan 1, 2015
    Posts:
    1
    Having an issue with the scoreflash/DFGUI addon. Your plugin seems great so far, and works great, at least in the first level in my game. It seems like when I change scenes/levels in my game, the scoreflash instance either loses the reference to the DFrenderer, or something else happens to break the functionality from working. I have tried unchecking ensure singleton, and integrating a new instance of scoreflash into each scene with its own renderer attached to the UI root and referenced, but nothing seems to work properly. I've played with it for quite some time trying to get it to work and can't figure out what's happening to break it.

    TLDR
    What is the best/right way to integrate scoreflash w/DFGUI addon so that when you change scenes, it will still work in the new scene?

    Thanks in advance.
     
  29. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Technicept, thank you for contacting me about this. It seems like you're hitting a bug that I have never seen before. This should just work. In particular, you've already tried what I would have suggested otherwise (unchecking ensure singleton and adding instances of ScoreFlash to each scene). It's very weird that this doesn't fix it.

    Is it possible that instead of putting a prefab (from the project) into ScoreFlash, you accidentally used a scene object? That could explain it even though it's kind of unlikely that this would be it now that you have an instance of ScoreFlash in each scene.

    So just to be sure: When you've switched scenes, the prefab slot is suddenly empty, even if you previously had the Prefab assigned for that scene, right? Did you double check it's assigned in the new scenes where you've added ScoreFlash?

    I'm kind of under very high pressure because I need to finish work on a book by tomorrow - but if there's no better solution I can try to create a repro-scene and see if I can reproduce/fix this on Tuesday. Starting Tuesday, I'll also be back on Skype - you find me by the name jashanchittesh there.
     
  30. IOZO

    IOZO

    Joined:
    Jun 26, 2010
    Posts:
    55
    Hi,

    I'm new to score flash. I just purchased version 4.6/ UGUI + Playmaker and TextMeshPro add-on.
    So far so good my basic tests worked fine but I'm now facing a couple of issues when I try more advanced renderer.

    I'm using Unity 5B21 with Playmaker and TextMeshPro Beta 0.1.46B3.3 (Latest version compatible with UGUI)

    1. the TextMeshPro add-on generates many errors and I can't roll back to 0.1.44 which has no UGUI support.
    2. When I use ScoreFlash with ScoreFlashRendererUnityUI it works fine until my game switches scenes. If the game switches to another scene, the ScoreFlash component is not destroyed and remains active in the new scene (unexpected). The ScoreFlashRendererUnityUGUI is not visible in the new scene (expected). However when the game navigate back to the original scene, both component are visible again as expected, but the reference to the UGUI renderer is cleaned up in the ScoreFlash component layout settings and the game crashes at the first push message.
     
  31. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi there, thanks for buying ScoreFlash and contacting me about the issues through the forums! ;-)

    Regarding the TextMesh Pro issue, I'll have to take a closer look - I haven't tested that beta-version, yet, and to be honest haven't even set things up to have access to the beta versions. But I believe I had registered with the forum so if I'm lucky, this might go quickly ;-) ... I'll get back to you as soon as I've seen this issue.

    Regarding the other issue: The quickest solution is probably to disable the "Ensure Singleton"-checkbox which you should find in the section "Advanced" of the ScoreFlash component. As long as you have exactly one ScoreFlash instance per scene, this should be safe - and if you have multiple instances, you should use the ScoreFlashManager anyways ;-)

    EnsureSingleton-Disabled.png
     
  32. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Lucky me ;-) ... the first download failed right at the end, but the second time, it worked just fine. Apparently, there has been quite a bit of refactoring going on in TextMesh Pro which breaks compilation. Not nice :-( ... but here's a quick and dirty patch that may not work perfectly (alignment and control of width of ScoreFlash messages might be a little off), but at least your project will compile again after pushing this over the ScoreFlash TextMesh Pro Addon:

    Here's the patch available for anyone who runs into the issue that the project no longer compiles after upgrading to TMPro 0.1.46 (tested with B3.3):

    ScoreFlash TextMesh Pro Integration Patch

    For now, this really only solves the compilation issues. And you need to have both ScoreFlash and ScoreFlash for TextMesh Pro to be able to use that patch.
     
  33. IOZO

    IOZO

    Joined:
    Jun 26, 2010
    Posts:
    55
    thanks for the fast reaction. That's great.
     
    jashan likes this.
  34. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    So, I've created a little manual for using ScoreFlash with Unity UI - feedback very welcome: Does this cover all you feel you need to know? Anything not clear enough?Anything missing? Anything you feel you'd rather not want to know? Well, just kidding ...

    This will also be included in the main package in the next release. Here's a direct preview link to the Score Flash Unity UI Manual.
     
  35. JRRReynolds

    JRRReynolds

    Joined:
    Oct 29, 2014
    Posts:
    192
    Jashan I hope you don't mind if I make 2 suggestions for ScoreFlash. Let me preface it by saying I did not go through all the tutorial videos, only the first one. 1) Please include a Quick Start guide, for people that don't want to watch a lot of video for a HUD text plugin. 2) Please make the user interface more usable: I can't even find where to change font style and font size.

    I'm going to be honest I own both this and NGUI HUD. I imported this asset first because it seems more graphically advanced. But after trying to use it the text was huge and off my screen. There was a lot of custom parameters but no where did I see font size or font style. I know you can obviously change it somewhere but don't you think for the most common user customizations like font size, font style, font color you should have something more easily accessible?

    Again maybe I'm missing an easy way to set these parameters, but I can't find a quick start guide to figure out where everything is.

    Anyway I think it is a wonderful asset and I look forward to using it in the future when I have more time to watch all the tutorials and really figure out how it works. For my current project, hud text is a superficial addition and so a fast implementation is more important to me than a quality one. In this case NGUI HUD was easier to implement, I drag the prefab on the screen and push the messages with color, float time, and font size and style all easily accessible through the editor and script.

    Just my suggestions, I am not a video person, I know a lot of people are however. I hope you have continued success and look forward to learning more about this asset in the future.
     
  36. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Zrexa, thank you for the suggestions - that feedback is very much appreciated!

    If you're using any of the addons (including Unity UI and NGUI), the place to change the font and font size is in the prefab that does the actual rendering (in the case of Unity UI, there's a Text-component in there which has those settings). Historically, ScoreFlash was using UnityGUI (Unity's old GUI system) because I wanted it to work without any external dependencies. As setting up GUISkins is a rather complex thing, I've added a rendering mode "Unity GUI_Font" which allows you to simply assign the font directly under Main Layout / Generic Font. In that case, the font has to define its size. That's not ideal but at least much much simpler than setting up a whole GUISkin.

    Anyways, now that Unity UI is available, what I could do to implement your suggestion is creating an interface for renderers that support changing font and font-size and extend the "Main Layout" section of the ScoreFlash instance with the properties font and font-size. That should make it much more obvious. I could probably even add this to ScoreFlashLayout and ScoreFlashFollow3D as well which would make it very easy to have different messages with different fonts / font-sizes.

    For the other addons (NGUI, TextMesh Pro and so on), I'll have to check how well changing fonts easily and in a standard way works for those. But I'll look into that.

    Did you see ScoreFlashBasics and ScoreFlashBasicsUnityUI? The former is a written introduction to the main features of ScoreFlash, the latter is written introduction to using ScoreFlash with Unity UI. I'll look into extending that documentation with information about setting up the font ... it's kind of obvious that this is necessary, so I'm sorry I missed it!
     
    hopeful likes this.
  37. JRRReynolds

    JRRReynolds

    Joined:
    Oct 29, 2014
    Posts:
    192
    Thank you for responding so positively to my feedback. I didn't see a documentation folder but now that I searched those files I found it, thanks for pointing it out, it was my fault for not conducting a more thorough search! After I review it I am sure I will find working with it a lot easier. All I was using was the score flash main object via Create Other and there was a lot of customization options but no settings for font styles.

    I will go through some more videos today and the quick start documentation. I really like the look of ScoreFlash over NGUI HUD, I was just finding it difficult to grasp how to implement in a quick, superficial manner.

    I also wanted to ask you, do you own TextMeshPro. I purchased both of your addons for ngui and tmp, however when I imported tmp addon it threw me a bunch of errors, however I am working with the beta release of tmp so this could be one of the issues. Your default text looks great so I didn't explore it further by opening a new project - but here are the errors, if you figure them out please let me know, I would love to integrate both now that I know I can get scoreflash running.
    versions:
    Unity 5 rc2
    TMP v0.1.46 beta 4.1

    Assets/ScoreFlash - Text Mesh Pro/3DTextExample/ScoreFlashRendererTextMeshProFor3D.cs(152,42): error CS0103: The name `AnchorPositions' does not exist in the current context

    Assets/ScoreFlash - Text Mesh Pro/3DTextExample/ScoreFlashRendererTextMeshProFor3D.cs(152,33): error CS0200: Property or indexer `TMPro.TextMeshPro.anchor' cannot be assigned to (it is read only)

    If you don't have access or cant' fix, no problem. Not only am I using beta unity but beta tmp, its like a developer's worst nightmare.
     
  38. JRRReynolds

    JRRReynolds

    Joined:
    Oct 29, 2014
    Posts:
    192
    Sorry one more, I missed it:
    Assets/ScoreFlash - Text Mesh Pro/3DTextExample/ScoreFlashRendererTextMeshProFor3D.cs(120,45): error CS0103: The name `AlignmentTypes' does not exist in the current context
    (this and anchor error on all corresponding lines)
     
  39. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Yes, Stephan did quite a bit of refactoring to make TextMesh Pro work better with Unity UI - so that's a good thing. But it did break the ScoreFlash TextMesh Pro Addon. The good news: I already have a patch available that should fix the compilation issues. There might be some issues with alignment / anchoring and widths - but it should compile.

    Here's the link - just install this over the ScoreFlash TextMesh Pro Addon and things should work:

    ScoreFlash TextMesh Pro Integration Patch

    I have tested this with TextMesh Pro 0.1.46B3.3. Let me know how it works for you!
     
  40. JRRReynolds

    JRRReynolds

    Joined:
    Oct 29, 2014
    Posts:
    192
    Works like charm, thanks for all the help! I dropped a review on the asset store for the plugin to reflect the benefit of this addon expansion!
     
  41. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Great! I'm glad it works well for you - and the review is greatly appreciated! :)
     
  42. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Just a quick little update not directly related to ScoreFlash - but if you like ScoreFlash this might still be interesting:

    I've finally published my second package for the Asset Store. It's still a little baby, so it starts with an early adopter price 70% off (just $15 + VAT, instead of $50). It's called (and I guess the name explains what it's all about):


    From the asset store description:
    ... and of course, it also has its own forum thread :)

    And here's a little intro video:


    I hope a lot of people will enjoy using STUUI - feel free to discuss here :)
     
  43. auroxi

    auroxi

    Joined:
    Dec 31, 2012
    Posts:
    85
    Added this to my project, I simply want to show a damage number which all works fine except this:



    How can I resolve please?

    EDIT: I've solved it by using Unity Text as the renderer and lost all styles defined in the file.
     
    Last edited: Jun 18, 2015
  44. auroxi

    auroxi

    Joined:
    Dec 31, 2012
    Posts:
    85
    So now when I'm trying to make text appear in world space at a characters position, I get cases where the position of the text is in the middle of the screen instead, how can I resolve this? It's like it's not getting a position to spawn the text or something, but clearly it exists.
     
  45. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    "In the middle of the screen" does indeed sound like the ScoreFlashFollow3D component wasn't passed (i.e. is null). But as discussed via email: If the object that the message are spawned from isn't visible on screen, it could also be that the position is calculated wrongly and the message should really not be visible at all (e.g. if the object is right behind the camera - so neither the object is visible nor should the messages from that object be visible).

    If that's the case, make sure that renderer and camera are assigned correctly in the ScoreFlashFollow3D component as shown in the attached screenshot:

    ScoreFlashCameraAndRenderer.png

    Also, for world messages, it's usually best to push the messages directly through the ScoreFlashFollow3D component using ScoreFlashFollow3D.Push(...) instead of using ScoreFlash.Instance.PushWorld(...).
     
  46. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    This seems to be an issue coming from the editor - apparently it does sometimes spam stuff to the console / and or editor log. See also this forum posting: Profiler showing LogStringToConsole, what is that?

    I've just code-reviewed ScoreFlash.OnGUI and RenderScoreMessage() which is called from OnGUI does log a warning if the style of the message is not assigned with the message. If that's the case, the issue isn't what you see in the profiler but the warning you get in the console. It would tell you: "Message has no style - something went wrong, look previous for error messages! Most likely, you either need to assign a Skin to ScoreFlash (recommended), or pass a GUIStyle-parameter to the push-method you're using (advanced)!"

    That said ...

    Do you mean the Text-component from the new Unity UI system? So that would be using the prefab ScoreFlashRendererUnityUI:

    ScoreFlashUnityUIPrefab.png

    or a copy of that with your own styling.

    That's really what I'd recommend. Admittedly, most of the examples that come with ScoreFlash still use the old UnityGUI / OnGUI approach. This does have a few small benefits for the purpose of creating simple examples and default configurations but I'd really recommend using the New Unity UI integration.

    I should probably point that out quite prominently in the documentation!
     
  47. JRRReynolds

    JRRReynolds

    Joined:
    Oct 29, 2014
    Posts:
    192
    Hey jashan. I wanted to follow up with you. I've been using scoreflash for a while and it really is a great asset. Once I went thru the tutorials and docs it is marvelously easy to use. 5 *'s!

    I was wondering if you could give me some pointers for 2 questions.
    1) When I delete ScoreFlash from a scene, it tends to throw a bunch of errors. None that prevents the game from running but it adds up in editor, is there a proper way to delete ScoreFlash so that it won't throw these errors?
    2) Is there a tutorial for ScoreFlash with different language (or does it support it at all) - I was trying to see if I could get ScoreFlash with a select number of Japanese characters.

    Thanks
     
  48. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hey, thanks for the feedback! I appreciate it a lot :)

    Regarding your two questions:

    1) You're right - it seems I'm missing some cleanup there. This should be fixed in the next update.

    2) I haven't tried different languages but as long as the GUI system itself supports those, ScoreFlash will as well. So, basically, if there's a way to make e.g. Japanese work with the Unity UI Text component (which I'm pretty sure *should* work given that Unity is quite popular in Asia), it should work just as well with ScoreFlash when using that integration. Also, if, for example, TextMesh Pro properly supports other languages, this should also work.

    What you'll definitely need are the fonts, of course. Let me know in case you run into any trouble - in case I need to extend anything in ScoreFlash, I'd be happy to do that and having some examples would be great but as I don't speak any of those languages, it's kind of hard to do that ;-)
     
  49. jprocha101

    jprocha101

    Joined:
    Apr 8, 2015
    Posts:
    134
    Hi - Am running this asset from the editor and it all looks good. When I install the APK on my Nexus 6 the text starts to look smaller. I am guessing that it uses the retina skin based on pixel density. I got it to look better on my device by adjusting the font size values. I was wondering what the threshold for that density value is?

    Also, if we can only have 2 different font sizes I would think there would be good deal of variation from one Android device to another. Or is the text scaled based on something other than the font size?
     
  50. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    There's various possibilities you have: When using UnityGUI (Unity's old GUI system), you have the option of switching between two skins or fonts which can have different sizes. When this is set up correctly, the font actually shouldn't look smaller on device but just crisper instead. This does, however, have the limitation you already talked about: There's only two different sizes (1x and 2x). Usually, this will be okay even when the screen densities differ a little and therefore the fonts are sometimes a little smaller and sometimes a little larger.

    The threshold for this is at 210 dpi.

    To adjust the size of the fonts more gradually, I'd recommend using ScoreFlash with Unity UI (the new GUI system of Unity that was introduced with 4.6). When using that, you can use the CanvasScaler component (which is added by default to every Canvas). This supports Scale With Screen Size as well as Constant Physical Size.
     
    jprocha101 likes this.