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
    UPDATE 2015-01-06: ScoreFlash 4.6.1 is out, with Unity UI support, and ON SALE!

    Buy now!
    Score Flash is a simple yet powerful GUI for pushing scores, achievements, collected power ups, tutorial instructions or even chat messages above players' heads in a fancy and highly configurable way. With ScoreFlash, you can easily achieve the effect you may know from the Scrolling Combat Text addon for World of Warcraft. But ScoreFlash can also do a lot more for you - and it's easy!

    Here's a little product video:



    Watch on YouTube (for 720p HD)


    ScoreFlash has no dependencies (it can use UnityGUI or Unity UI) - but also works with TextMesh Pro, NoesisGUI, Daikon Forge GUI, NGUI, EZ GUI, SpriteManager 2, Text Box (package available on request) and PlayMaker!!!



    Visit the Product Page!
    (includes Demo Web Player and a few Videos)


    or

    Buy now!

    ScoreFlash 3 added 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):




    The ScoreFlash Demo Web Player (click to start):


    Here's a video of version 3.1 of ScoreFlash - this version 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):


    While ScoreFlash has no dependencies on other packages (it can use both UnityGUI and Unity UI (uGUI) the new built-in GUI system that came with Unity 4.6) it also has built-in support for quite a few other packages. These are currently free packages also available on the asset store:
    Here's a video showing you how easy it is to go from using ScoreFlash with UnityGUI (the default) to having ScoreFlash use NGUI instead - with other GUI-systems (including Unity UI), it works quite similarly:





    Score Flash is very easy to set up and use; and yet quite versatile, here's the recommended workflow:

    Artist
    1. Drop the prefab into your scene.
    2. Hit play and watch autogenerated design-mode messages appear in GameView
    3. Tweak ScoreFlash to show the messages the way you wish (colors - tutorial, alignment and so on via the custom inspector, fonts via GUISkin - tutorial)
    4. When you're done, switch off automatic test messages (Testing / Autogenerate Messages?)
    5. End playing (make sure the "Keep Changes after Play" checkbox is active to store the changes; it's only visible in playmode and it's the last entry in the inspector of ScoreFlash)

    For all the details, check out: First Steps with Score Flash

    Programmer

    Anywhere in your code, when the user should receive a message, like "+23" or "Jump PowerUp collected" or "Achievement 'Awesome' unlocked" ... or ... "Now please make a right turn and increase velocity by 15%, watch the magic happen and enjoy the intense colors" (hey, I didn't say ScoreFlash could only be used for stuff that makes sense) ... just write:

    Code (csharp):
    1. ScoreFlash.Push("The text you want to show");
    Yes, it's that easy ... so if you're an artist that can read and edit a little code - YOU CAN DO IT, GO GO GO!

    But wait: While it can be that easy, just posting text might feel a little limiting. So, since ScoreFlash V2 there's a new interface IScoreFlash (see API documentation) which hopefully provides any method to post a message you could dream of, including using screen or world coordinates or a ScoreFlashFollow3D

    So, you might be more the kind of developer that enjoys something like:

    Code (csharp):
    1. ScoreFlashManager.Get("SpecificScoreFlashInstance").PushLocal("Awesome message");
    Or maybe your specific game needs you to write something like:

    Code (csharp):
    1. string message = this.rigidbody.velocity.y > 0
    2.     ? string.Format("+{0:0}", this.rigidbody.velocity.y)
    3.     : string.Format("{0:0}", this.rigidbody.velocity.y);
    4.  
    5. ScoreFlashFollow3D follow3D = GetComponent<ScoreFlashFollow3D>();
    6. ScoreFlash.Instance.PushWorld(follow3D, message);

    For more details, check out the ScoreFlash product page. If you are a programmer, you might be primarily interested in the full ScoreFlash API Documentation.

    Features:

    • Supports Unity UI (fka uGUI), Unity's new GUI/UI-system
    • Very easy to set up and use - designed for artists and programmers alike!
    • Has a visual editor (using the scene view) to control the layout
    • Just pop in a prefab and flash your scores, no complicated setup necessary to get started
    • And yet: Highly configurable if you need to - ScoreFlash has several extension points for you to go crazy with it
    • You can use ScoreFlash with TextMesh Pro, NoesisGUI, Daikon Forge GUI, NGUI, EZ GUI, SpriteManager 2, TextBox and PlayMaker; or create your own integration - but also without any external packages (using UnityGUI for rendering the messages)
    • Perfectly integrated into the editor: Trigger test messages right from the inspector in play mode, persist the changes you made while in play mode if you wish (or discard them as Unity would usually do it)
    • Supports pushing messages anywhere on the screen (using screen coordinates), or on top of any 3d object; you can use 3D coordinates, or the ScoreFlashFollow3D-component which provides several configuration options and a way to handle object destruction in a nice way (e.g. keeping momentum instead of abruptly stopping the movement of the message)
    • When using UnityGUI, which does add some draw calls - you can use several settings to optimize for performance, like:
    • Outlines that can be auto-disabled on mobile to save draw calls or be completely disabled (to save drawcalls also on desktop machines - or if your style doesn't need outlines)
    • Several of mechanisms implemented to cope with "score spamming" (i.e. many messages coming in quickly) without degradation of performance, quality, readability and effect
    • Support for high density displays (e.g. Retina), if you need it (implemented via two GUISkins and an internal scale factor for coordinates / distances)
    • Examples in C#, UnityScript and Boo (it's so easy to use that this probably is a little overkill - but hey, I needed to make sure it works with all languages supported by Unity anyways so why not share what I've got ); advanced examples use C#
    • Survives the dreaded "recompile after code change in playmode", so if you took care that changing code in your project while playing works, ScoreFlash won't break it
    • And finally: Just like probably almost everyone else, I'm waiting for the new Unity GUI - and I want to make sure that once it is available, my games use it ... so, I'm committed to making ScoreFlash "just work" with the new Unity GUI with minimal set up / migration. Using ScoreFlash, you are certainly not locked in to an alternative GUI system once the new Unity GUI is finally available. That's one of the reasons I'm keeping ScoreFlash somewhat barebones and simple for now (this doesn't say that using an alternative GUI system right now is a bad idea - actually, most likely, it is a good idea but YMMV).

    Limitations:
    • UnityGUI is pixel perfect - so when doing very slow animations, you will get some stuttering (from one pixel to the next); this isn't an issue when messages are moving at at least "one pixel per frame" but when doing very slow motions (one pixel every many frames), this can be an issue; it's not an issue when you're using Unity UI or any of the other GUI-systems
    • For multiline text messages, the line-height / line spacing depends on your font; with some (e.g. Ubuntu), this works fine - but some have rather large default line spacing and it's not possible to change that in Unity; see also: Font Line Spacing and Kerning in GUI System. Again, most likely this will not effect you; especially not if you're already using fonts in multiline texts in Unity GUI and it works. But I ran into it during development / testing with some free fonts so I want to make sure you know this *can* happen.

    Tested on Unity Versions (ScoreFlash does not require any Unity Pro features):
    • Unity 4.6.0
    • Includes ScoreFlash 3.2.3 which still supports Unity 3.5.7 and up but is no longer updated

    Tested build targets:
    • Web players
    • Standalones (Mac, Linux, Windows)
    • Android (devices: Google Nexus One, Sony Ericsson Xperia Play)
    • iOS (devices: iPhone 3GS, iPad 1, iPhone 4S, iPad 3)


    History
    2012-09-25: Submitted version 1.0.2 to the asset store, waiting for approval (version 1.0.0 wasn't approved, version 1.0.1 tried to fix the issues of 1.0.0 but did so in a way that wasn't so great, so I submitted 1.0.2 while 1.0.1 was still pending approval)

    just ten hours later: Awesome - it's already on the Asset Store! Thanks to the Unity staff - that went really quick! I greatly appreciate it! Unfortunately, in this release, the examples folder was missing because I had named it AssetStore - Examples (another beginner's mistake - by now you can probably tell that this is the first package I published to the Asset Store ). Fixed the naming issue and a few more and re-submitted to the asset store as version 1.0.3.

    2012-09-26: Created new thread (the one you are reading) because the changed title ("[RELEASED]" instead of "[Submitting]" won't show in the list of forum entries) .... link to the old thread

    just a few hours later: Once again UT did an awesome job: I submitted last night, and 1.0.3 with the fixed examples folder is already online. Yes!

    2012-09-27: Cleaned up this posting quite a bit, added the list of features and limitations

    2012-09-29: Score Flash V1.1.0 has been submitted to the Asset Store

    2012-10-01: Score Flash V1.1.0 has been approved and is now available on the Asset Store - here's what you'll get when you update (or when you buy now):

    • Changed primary method from ScoreFlash.Instance.Show(…) to ScoreFlash.Push(…); this is easier to type (the old one still works for now but is no longer recommended to be used)
    • Added ScoreFlash.Push(string text, GUIStyle style) and ScoreFlash.Push(string text, GUIStyle style, GUIStyle styleHighDensity) for more flexibility - this is primarily for people who are already managing their own GUISkins and don't want ScoreFlash to impose anything on them (or require additional "wiring"); this way, you could also use different styles for different messages (using ColorControl.UseColorFromSkin, you could even fully control which colors are used when - set this via Colors / Color Selection Mode / UseColorFromSkin)
    • Added minPaddingX (default: 20F) so you can define how close the message goes to the screen borders (left / right) when scale = 1 (obviously, if scale > 1, the message might clip at the borders) … in the inspector, this is called "Padding left/right before Wrap" and is located below Screen Align in the section "Main Layout"
    • Added new section Colors
    • Added new property: colorSelectionMode which controls how colors are picked and has 4 possible values: FadePhases, UseColorFromSkin, Sequence, Random (see ColorControl), as well as a list to define the colors and
    • added Time Reference (under "Readability and Performance Tweaks") that can take values UseRealTime or UseGameTime (see TimeReference); UseRealTime is the default and important when you use ScoreFlash in a pause-menu (that has Time.scale = 0); UseGameTime is best used if you want slow motion effects to have an effect on how messages are displayed (that's really an art-choice, no right or wrong here)
    • renamed examples folder to Xamples-ScoreFlash (in an attempt to find the ideal "standard name for examples")

    2012-10-02: Created a video on how to work with colors in ScoreFlash

    2012-10-03: ScoreFlash V1.1.1 was submitted to the Asset Store

    2012-10-03: ScoreFlash V1.1.1 has been approved and is now available on the Asset Store - here's what this new version has for you:

    • Added new setting ensureSingleton - default is true, if you set this to false, you can have multiple instances of ScoreFlash in a scene; however, if you do that, you can no longer use ScoreFlash.Push(…) - at least not reliably - instead, you need a reference to each instance and can then use myScoreFlashInstance.PushLocal(…) - this way, you have much greater flexibility (think of different time- and layout-settings for different kinds of messages; thanks to miroku000 for requesting that feature)
    • Removed guiDepth as this didn't have an effect, anyways - use script execution order if you need to get ScoreFlash above other classes rendering UnityGUI stuff
    • Added new examples for PushLocal in C#, JavaScript and Boo
    • Added additional advanced example code to the existing C# example


    2012-10-11: ScoreFlash V2 is almost ready for submission! I'm tweaking the last few issues and getting the whole package ready for the asset store ... ScoreFlash V2 demo Web player released!

    2012-10-14: Added a new tutorial: ScoreFlash - GUISkins, GUIStyles and Fonts ... and a link to the ScoreFlash API Documentation

    2012-10-15: ScoreFlash V2.0.0 has been submitted to the Asset Store for approval - so most likely it will go online shorty (and the price for the package including all source code will go up from $15 to $30).

    2012-10-15: ScoreFlash V2.0.0 has been approved and is now available on the Asset Store - price has increased from $15 to $30.

    NOTE: In case you get compilation errors after upgrading from V1 to V2 - you might have to replace ScoreFlash.Instance with ((ScoreFlash)ScoreFlash.Instance) in some places. This is because ScoreFlash.Instance now returns the ScoreFlash as interface IScoreFlash and "stuff you shouldn't need to change from code" is no longer directly accessible. For common use cases, this makes coding with ScoreFlash much more convenient because you only get what you really need most of the time with Intellisense!!!

    New features in V2.0.0:

    • added IScoreFlash interface which is implemented by ScoreFlash - for a clean set of methods when accessing ScoreFlash (this mainly helps with Intellisense); ScoreFlash.Instance and ScoreFlashManager.Get(string name) return IScoreFlash but you can cast this to ScoreFlash if you really have to (not recommended!)
    • added new base class for custom "renderers": ScoreFlashRendererBase, so you can now use UnityGUI, GUIText (not too useful because it doesn't support scaling and rotating), or even NGUI and EZ GUI (adaptors will come with V2.1) to render the messages which makes ScoreFlash a "one draw-call solution" if you own these tools; the same approach will later be used to support the new Unity GUI system - whenever that becomes available
    • made ScoreFlash much more robust, covering lots of corner cases (most of which are resulting from the added flexibility ScoreFlash now has, like using custom renderers) … if you manage to generate an error that I haven't covered post to the forum (see Help / narayana games )
    • added ScoreFlashManager - the best way to work with multiple instances of ScoreFlash: Simply use ScoreFlashManager.Get(string name) to access any named instance of ScoreFlash
    • each instance of ScoreFlash now supports multiple message queues; this is important if, for instance, you use ScoreFlash for scores above game objects - when using ScoreFlashFollow3D, this just works and ScoreFlash makes sure that messages that belong to different game objects don't interact with each other; if you don't use ScoreFlashFollow3D for 3D positions, it's up to you to make sure things don't get messed up (you can use object.GetInstanceID() and pass it into PushLocal)
    • added utility class Easing - the easing methods from Util are still there but obsolete
    • Made persisting of changes during play much more robust (now supports changes in multiple objects during one session), and much more transparent (now has "store changes immediately" mode, and a new "click button to restore changes from play mode", the latter includes a button to fix all items of one type that were changed with a single button click); this is now used both for ScoreFlash as well as the new ScoreFlashFollow3DEditor … and can be added very easily to your own custom inspectors if you need it, using PlayModeChangesHelper
    • You can now enter any custom or existing style; this is useful if you want to use multiple instances of ScoreFlash with just a single GUISkin
    • added new methods to Util (under common): Util.IsPortrait (simple check for portrait based on Screen.width / Screen.height) and Util.ScaleInverse(…) which simply inverts what Util.Scale(…) does

    2012-10-15: Added a new tutorial: ScoreFlash - Persisting Changes after Playing

    2012-10-16: Submitted V2.1.1 to the Asset Store (should have been V2.1.0 - but the upload failed and I had to increase the version number ).

    2012-10-17: ScoreFlash V2.1.1 was released on the Asset Store. Here's the changelog:

    • Added custom renderer for NGUI - if you have NGUI, you can now use ScoreFlash with a single draw call!
    • Added TestMode to ScoreFlashFollow3D
    • Added direct font assignment (as alternative to using GUISkins)
    • Added selection of "rendering": UnityGUI-GUISkin, UnityGUI-Font, CustomRenderer
    • Fixed a few warnings in Unity 4 (oops :-/ )
    • added proper documentation with examples to PlayModeChangesHelper
    • fixed comparing lists (this failed for list of colors resulting in PlayModeChangesHelper always thinking there was a change in all ScoreFlash instances even when there really was no change)
    • PlayModeChangesHelper now prints a nice list of changes (diff) to the console
    • PlayModeChangesHelper wasn't as reliable in 3.5.6 as in 3.4.2 - fixed

    2012-10-23: Submitted V2.2.0 to the Asset Store

    2012-10-23: ScoreFlash V2.2.0 has been approved and is now available on the Asset Store, here's the change list:

    • Now supporting PlayMaker!!!
    • Added support for EZ GUI … but … consider this "experimental" for now!
    • Added component menus for ScoreFlash, ScoreFlashManager and ScoreFlashFollow3D
    • Polished documentation quite a bit; ScoreFlash class now has quite a few examples right in the class description
    • Added new methods PushLocal(string text, Color color) etc. to send messages in a specific color
    • Removed "Disable Outlines" section when using a custom renderer (it has no effect in that case)
    • Fixed some jittering problems that could occur when using NGUI for rendering: in particular, changed the prefab to have a parent game object with a child UILabel (should have done it this way right from the start!); make sure to also update your NGUI packages if you are using ScoreFlash with NGUI!
    • Added ScoreFlashFollow3D.keepStatic to not follow the messages but use the configuration options
    • added new method FreezeLocation(float timeSeconds) to ScoreFlashFollow3D
    • Made Util.AreEqual(…) methods more robust (these threw exceptions when null-references were passed)
    • ScoreFlashManager "Copy Name" is now called "Copy Ref" and puts ScoreFlashManager.Get("TheName") to the copy buffer which makes this much more useful
    • Fixed a bug where clicking "Show Message" in the test section in the ScoreFlash inspector would go to the wrong ScoreFlash instance
    • ScoreFlashManager now also has "ensureSingleton", which defaults to true (like ScoreFlash)

    2012-10-23: ScoreFlash V2.2.2 is now available; this is a minor refactoring: Util is now called NGUtil, and Easing is now called NGEasing. This fixes problems that could occur when using ScoreFlash together with other packages (e.g. MegaFiers). After upgrading to V2.2.2, please delete the files Easing.cs and Util.cs as well as the folder "Deprecated". They are no longer needed. You may have to replace any references to Easing or Util in your own code with NGEasing and NGUtil (obviously, the ScoreFlash code already uses NGEasing and NGUtil ).

    2012-10-24: ScoreFlash V2.2.3 Added extensive written documentation in PDF format - check it out: First Steps with Score Flash

    2012-12-18: ScoreFlash V2.2.4 is now available (this is a minor bugfix release which fixes an issue with the PlayMaker actions; when you use PlayMaker, make sure to re-import Plugins/NarayanaGames/ScoreFlash/Component/PlayMaker-Actions-Package after you have updated ScoreFlash to 2.2.4!

    2013-02-04: Submitted V3 to the Asset Store

    2013-02-05: ScoreFlash V3 has been approved and is now available on the Asset Store. 3.0.0 is a major new release that adds some features for advanced users - this gives you a lot more power and possibilities (and a bit more to learn to use all that power)!!! Here's the detailed change list:

    • 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

    2013-03-14: Submitted V3.1 to the Asset Store

    2013-03-18: V3.1 is now available on 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

    2013-07-10: ScoreFlash V3.2.0 has been approved and is now available on the Asset Store - price has increased from $30 to $50.

    3.2.0 is primarily a performance improvement release but also adds experimental SpriteManager 2 and Text Box support

    • Text Box: Added experimental support for Catlike Coding’s TextBox
    • ScoreFlashFollow3D: When no reference camera is assigned, Camera.main is used as fallback - but when no camera with tag MainCamera is available in the scene that fallback also fails; added a more informative warning and another fallback (just grabbing any camera that’s available in the scene), so it might work even in that case but you’ll be getting warnings
    • ScoreFlashFollow3D: Instead of testing renderer.IsVisible - which will return true if the renderer is visible in any camera (scene view, minimap cameras, whatever), I’m now doing a test specific to the reference camera; this makes the mechanism to hide messages coming from objects behind the camera much more robust
    • Performance: When ScoreFlash is not enabled, messages are no longer registered
    • Performance: Fixed several places that caused GC-spikes (those were especially related to ScoreFlashFollow3D)
    • Performance: Custom renderers are now handled with an object pool to prevent allocation / instantiation
    • Performance: Added a GUIStyle pool to prevent allocation / GC spikes
    • Performance / NGUI: Custom renderer for NGUI has an option to switch off updating color as this is pretty expensive regarding allocations (resulting in potential GC spikes when running on mobile)
    • SpriteManager 2: Added an example using Sprite Manager 2 (the companion of EZ GUI) to animate a sprite using ScoreFlash; see ScoreFlashRendererSpriteManager2-Package (under Plugins/NarayanaGames/ScoreFlash/CustomRendering
    • NGUI-Integration: Added support for FixedSize and FixedSizeOnMobile
    • NGUI-Integration: Fixed an issue with local pivots which created all kinds of weird behaviors due to a change in NGUI 2.5.0 (FIX: Changing the pivot no longer moves the widget visually, see also: http://www.tasharen.com/forum/index.php?topic=11.25)
    • Added menu “GameObject / Create Other / Score Flash Layout” - in addition to the already existing entries Score Flash and Score Flash Manager

    2014-01-13: ScoreFlash V3.2.1 was a minor release that removed a few warnings that occurred with Unity 4.3.

    ScoreFlash V3.2.2 added support for Daikon Forge GUI and fixed a few issues

    ScoreFlash V3.2.3 fixed several issues with recent Unity and NGUI versions

    2014-08-01: ScoreFlash V4.0.0 - major release
    • Now requires Unity 4.3.4; previous versions are still supported 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 :) )
    2015-01-06: ScoreFlash V4.6.1 - major release
    • Now requires Unity 4.6.0; previous versions (starting from 3.5.7) are still supported with included package ScoreFlash 3.2.3
    • Full support for Unity UI (fka uGUI) added
    • Several cool example scenes added
    • Added Warmup Message Instantiation feature (under Main Layout - only active for Custom Renderers because it only makes sense for those): this will create a set amount of messages (0 to 10) on startup and immediately destroy them - this can be used to prevent instantiation costs during play-time (because the message prefabs that were instantiated remain in a cache in the scene)
    • Fixed bug when using Realtime and Time.timeScale was set to 0
    • Minor Bugfixes



     

    Attached Files:

    Last edited: Jan 6, 2015
  2. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Hi

    Yes, the video is a little long. How is performance on ipad, does it spawn a new gameobject everytime for each effect?
     
  3. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    No, it's just one game object ever (EDIT: ... when using UnityGUI - with NGUI you do get one game object per message; but you save a lot of draw calls ;-) ). There are simple lightweight objects (i.e. not MonoBehaviours) per message, one per message. But those shouldn't hurt performance even if you have lots of them. On iPad 1, performance is fine as long you don't enable "Render Outline on Mobile" and spam message like a maniac. Without outlines, it's one drawcall per message, with outlines it's nine drawcalls per message - so outlines do make quite a difference. However, on more modern iPads, even with the outlines you should be fine (note to self: add something like "Render Outline on old Devices").

    $scoreFlash_Outlines.png
     
    Last edited: Oct 17, 2012
  4. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    EDIT: FIXED - 1.0.3 is online, so this posting is obsolete :)

    A little heads up: The version currently on the Asset Store had the examples folder removed (I had "AssetStore" in its name). A new package has already been submitted and you can use ScoreFlash easily without the examples - but I just to wanted to mention it. The new version (with the examples folder) is 1.0.3; I'll update the posting when it has been approved.
     
    Last edited: Sep 26, 2012
  5. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    There's a new video available now (this is the one on top of the posting):

    ScoreFlash on the Unity Asset Store - Teaser

    It's still 10 minutes, so I guess I need to learn making short videos - but at least it's not 23 minutes. However, the longer one has a lot of information that's not covered in the new one, so you might still want to watch both - first to get your mouth wet, second as a tutorial for the details:

    ScoreFlash - Introduction and Tutorial
     
    Last edited: Sep 26, 2012
  6. Tapgames

    Tapgames

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

    Awesome plugin and super easy!

    One future I like to have is that it can automaticly on spawn choose a random color "not fading". Then it's all red and the next is all blue or green or pruple. Now is every message the same color fading.

    Cheers,

    Roy
     
  7. jashan

    jashan

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

    thanks for the kind words and the great idea - I'm glad you enjoy using ScoreFlash! Btw, I guess you already got 1.0.3, right? So the examples folder is included? Because that new version just became available on the Asset Store about 15 minutes ago:

    About your feature request: That sounds like a cool idea, thank you for the request!

    So, there would be two "modes": One as it is currently available, and another one where you have a list with an arbitrary number of colors you can define (2, 3, 10, 15 ... however many you wish), and then Score Flash picks a random color from that list. And uses that color throughout the three phases (fade in, read, fade out). Correct?

    You'll have that in the next version ;-)

    So, just for some details: How would you like alpha to be handled? Simply fade from 0% to 100%, keep 100% while in the "read" phase and then go back to 0%? Or should the alpha values from the colors from the other state be used (I guess that would be a little difficult for the user)? Or would you like to have 4 sliders with just the alpha channel values for each phase? Anything's possible - what I'm trying to figure out is the right balance of being able to configure things and keeping things simple and easy to use.

    Probably I should include a setting for how the colors should be picked. I could have "in sequence" and "random" (and the third option could be "color fade" which would be the way it's currently implemented). Random could keep track of which colors were already used to make sure that each color gets picked in one cycle. For that, however, you need at least three colors - otherwise it would just alterate between the two in a fully predictable way ;-)

    Let me know what you think and whether this captures your needs.

    Sunny regards,
    Jashan
     
  8. Tapgames

    Tapgames

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

    That's perfect!

    I dont know what you mean with the alpha stuff but thats already working perfectly wright?

    Cheers,

    Roy

    Edit: I used version 1.0.2
     
    Last edited: Sep 26, 2012
  9. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Roy!

    Currently, with each color, you can also define its alpha value. Score Flash has the default settings I found most useful, so it's nothing you really have to worry about - but if you want to, you can do some fancy (or not-so-fancy) things with this.

    For example, you can control whether a message "pops up" (i.e. appears from one frame to the next) or whether it fades in softly. When you have alpha of Initial Color set to 100% (255 in the Unity color picker), it "pops up", when you have alpha of Initial Color set 0% (0 in the Unity color picker), it fades in. Of course, the effect depends on what alpha value you have for Read Start Color as well, and it also depends on the animation curves and times.

    One thing you could do, to give a somewhat weird example, is have alpha=100% for the Initial Color (so the messages pop up), then alpha=0% for the Read Start Color (so the messages immediately fade out), then for example alpha=50% for the Read End Color (so it fades half in again) ... and finally, alpha=100% for Final Color (so at the end, the messages "pop out", i.e. the disappear from one frame to the next).

    In this example, each message would go through the phases in the following way:
    1. Fade In: Fully opaque, "Pop In"
    2. Read Start: Fully transparent, "Faded Out"
    3. Read End: Half transparent, "Faded half way in"
    4. End of Fade Out: Fully opaque, "Pop Out"
    Of course, that would probably look pretty weird and not make a lot of sense ... but someone might want to have exactly that effect, so it's nice that the system provides it. And, as you need slots for the colors anyways, it's also not adding clutter to the interface.

    For the new feature (random color for each message picked from a set of user defined colors), I need to decide whether I want to expose this flexibility or not.
     
  10. Tapgames

    Tapgames

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

    I think you should! The ability to fade using only one random color is always handy :)

    Cheers,

    Roy
     
  11. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Ok, cool, so be it ;-)
     
  12. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I just did a major cleanup of the original posting so this should be much more readable and easier to understand now ... and I am making progress on version 1.1.0 which will include:

    • Random color for each message picked from a set of user defined colors (as suggested by Roy)
    • Setting "use real time" or "use game time" (depending on that setting, ScoreFlash will either ignore Time.scale or use it)
    • ScoreFlash.Push(...) shortcut that can be used instead of ScoreFlash.Instance.Show(...) but will do precisely the same (still using Singleton-pattern under the hood but shorter to write)
    • New (alternative) methods ScoreFlash.Push(string text, GUIStyle style) and ScoreFlash.Push(string text, GUIStyle style, GUIStyle styleHighDensity) for more flexibility - this is primarily for people who are already managing their own GUISkins and don't want ScoreFlash to impose anything on them (or require additional "wiring")
     
    Last edited: Sep 28, 2012
  13. Tapgames

    Tapgames

    Joined:
    Dec 1, 2009
    Posts:
    242
    Cool, keep up the good work!
     
  14. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    So here's a little preview of the upcoming new feature to have different ways of selecting colors, see the screenshot below.

    I realized that I need to change the method name for the new static method, so it won't be ScoreFlash.Show(...) but ScoreFlash.Push(...), which I actually think is better anyways. I'll fix that in the other posting to avoid confusion. The old approach using ScoreFlash.Instance.Show(...) will be kept for compatibility so everything will work as before once the new package is available and you update.

    UseColorFromSkin is something I hadn't thought of before: When I have ScoreFlash.Push(string text, GUIStyle style), it's possible to control the colors from outside ScoreFlash by providing different styles. That way, it's completely up to you what kind of styles you put into ScoreFlash for each message. So this gives you even more flexibility (for example, each message could use a different font and different color). However, you can still use the old skin-based approach ... in fact, that's still the "recommended" approach unless you really need the flexibility the new methods give you.

    $scoreFlash_ColorSelection.png
     
  15. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Version 1.1.0 has been submitted to the Asset Store - here's what you'll get once it has been approved:

    • Changed primary method from ScoreFlash.Instance.Show(…) to ScoreFlash.Push(…); this is easier to type (the old one still works for now but is no longer recommended to be used)
    • Added ScoreFlash.Push(string text, GUIStyle style) and ScoreFlash.Push(string text, GUIStyle style, GUIStyle styleHighDensity) for more flexibility - this is primarily for people who are already managing their own GUISkins and don't want ScoreFlash to impose anything on them (or require additional "wiring"); this way, you could also use different styles for different messages (using ColorControl.UseColorFromSkin, you could even fully control which colors are used when - set this via Colors / Color Selection Mode / UseColorFromSkin)
    • Added minPaddingX (default: 20F) so you can define how close the message goes to the screen borders (left / right) when scale = 1 (obviously, if scale > 1, the message might clip at the borders) … in the inspector, this is called "Padding left/right before Wrap" and is located below Screen Align in the section "Main Layout"
    • Added new section Colors
    • Added new property: colorSelectionMode which controls how colors are picked and has 4 possible values: FadePhases, UseColorFromSkin, Sequence, Random (see ColorControl), as well as a list to define the colors and
    • added Time Reference (under "Readability and Performance Tweaks") that can take values UseRealTime or UseGameTime (see TimeReference); UseRealTime is the default and important when you use ScoreFlash in a pause-menu (that has Time.scale = 0); UseGameTime is best used if you want slow motion effects to have an effect on how messages are displayed (that's really an art-choice, no right or wrong here)
    • renamed examples folder to Xamples-ScoreFlash (in an attempt to find the ideal "standard name for examples")
     
  16. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Score Flash V1.1.0 has been approved and is now available on the asset store - so if you already have it, you should update. And if you don't: Buy ScoreFlash now! ;-)
     
  17. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    I'm using it in a 3D game, so I would like if it can have Push with 3d position. Now you can only specify screen alignment top, bottom middle, which is rather limited.
     
  18. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Thanks for the feedback! Orienting the messages around arbitrary positions is planned for the 2.0 release of Score Flash; I actually ran into the situation that I need this myself for a game I'm currently developing, so that should be available very soon ;-)

    So, what you'll be able to do is attach a component to any game object that gives you several configuration options (like offset) and then you can pass that into Push(...). Another option will be using Screen coordinates. This will make ScoreFlash significantly more flexible ;-)

    Do you feel that will solve your needs? Is there anything specific you'd like to see in that implementation?
     
    Last edited: Oct 2, 2012
  19. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    PS: I just re-read your posting and realized that instead of having to attach a component to your game objects, you might just want to pass the Vector3. Is that correct?

    I'll probably provide both options: The one I suggested (attach a component) makes it possible that the messages "follow" the 3D-objects. That's what I'm already working on because I need this for my own game project. However, for people who don't need that and who don't want to add "stuff" to their existing game objects, the Vector3-based approach will be better. That way, you can simply grab the position from your transform, do with it whatever you wish (e.g. offset), and pass it into ScoreFlash.Push(...).

    Summing up what's scheduled for ScoreFlash V2: There will be 3 ways to control the position per message, in addition to what's already possible which is "all messages go to the same location, either top/middle/bottom" (in addition to "top/middle/bottom"-center, there will very likely be more alignment options for that default mode - so this will also get some love in V2):
    1. Pass a Vector2 with screen coordinates. I might also add an optional alignment parameter to this, so you could say something like "show this message 20px from left and 20px from bottom"; or "show this message right in the center (offset: 0px, 0px)" or "show this message 20px from right screen border and 10px above the vertical middle of the screen" ... the existing animation parameters will still be applicable.
    2. Pass a Vector3 with world coordinates. This will show the message precisely at that position on the screen (you'll have to handle any offsetting in world space yourself) ... the existing animation parameters will still be applicable (so if you start with Initial Offset Y set to -150, it would move from -150 pixels above the location you gave to the location you gave and from there start moving using Read End Float Up Velocity and later Final Float Up Velocity)
    3. Pass a ScoreFlashFollow3D component (this is a new component that will come with V2). This method will show the message at the location of the transform of the game object that ScoreFlashFollow3D is attached to, with an optional offset in 3D-space (which you can set in ScoreFlashFollow3D). As long as the object that component is attached to still lives (i.e. has not been destroyed), the message will follow the object while the usual ScoreFlash animation takes place. If you want to, you could also make it "static" so it doesn't follow your object which would end up being the same behavior as the Vector3-based option. The difference is that when you use the component, it's up to the game object (i.e. how you set up ScoreFlashFollow3D) to decide what should happen, so you have more flexibility and it's more designer-friendly. Also, with ScoreFlashFollow3D you can configure an offset in world space that's automatically added to the location before calculating the screen coordinates.
      The same animation as in all other modes still takes place - however, it's now always relative to the game object that "created" this message; even if the game object still moves. If the game object is destroyed before the message has completed its animation, it will no longer update it's "reference position" ... because there's nothing it could update itself to. I might track it's velocity and keep it going with some momentum to prevent odd visual effects: A fast moving object having a fast moving message that suddenly gets destroyed would have the message suddenly stop which most likely would look really strange to the player; I'll give you the option in case you really want that effect but the default will be "keep going".
      ScoreFlashFollow3D will also have a "test-mode" so that you can set everything up very easily in play mode without having to create "auto-generate messages code" yourself. It will also remember the changes you did in play mode (in precisely the same way that ScoreFlash already does this). This is to make sure ScoreFlash remains very design-friendly (no need to ask a programmer to temporarily add that "send random messages code so I can make this look awesome" for you).

    Oh, and any coordinates in screen space will still pay attention to "am I on a Retina display". So if you say "20px off the top", this will automatically be 40px, if you're on a high density display like iPhone 4 or iPad 3 (if you are on Unity 3.5+ this uses Screen.dpi, so it should also work on most Android devices; if you are on Unity 3.4.2, this uses some heuristics, see also Util.IsHighDensityDisplay and Util.Scale(float)). It already works this way for all "coordinate stuff" I already have but I thought it's worth mentioning that this is something that I'll also take care of in the new version, so you don't have to ;-)

    Let me know what you think!
     
    Last edited: Oct 2, 2012
  20. omarzonex

    omarzonex

    Joined:
    Jan 16, 2012
    Posts:
    158
    jasan very very Nice Cooooooooool Score

    please

    How Drifting Score Script to javascript

    and Animation Score Speed and Accrator and more
     
  21. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I have created a video that explains how to work with colors in ScoreFlash in detail. It's available now on YouTube:

    Score Flash - Working with Colors



    ... now back to work on V2 :)
     
  22. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    I prefer just a Push with Vector3 world position, and an 2d screen offset parameter

    Push ("hello", gameobject.transform.position, new Vector2 (10,10));

    I prefer not to having to add ScoreFollow3DComponent to the gameobject, after all the idea is to make it simple to fire and forget the score.
     
  23. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Ah, ok ... that makes sense. So there will be Push(string msg, Vector3 wordSpacePosition, Vector2 screenSpaceOffset).
     
  24. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    This was posted in the old "Submitting" thread, so I'm quoting the message to get the context.

    At the moment, this is not really supported. You could hack yourself around this and use two ScoreFlash objects by removing the "singleton-stuff", but that's something I wouldn't recommend because it will give you troubles on each update.

    A quick fix that I can offer for V1.1.1 is a checkbox that disables the singleton feature. Then you can create several instances of ScoreFlash, create references as you need and use those. So instead of ScoreFlash.Push(...) you'd do myScoreFlashReference.Push(...). Adding such a checkbox isn't a big deal and I have a few other small improvements I'd like to make available as quickly as possible.

    For V2, I can implement a different approach: You could have a ScoreFlashDelegator which acts as singleton and below that in the hierarchy, you could have as many ScoreFlash instances as you wish, each with their own name and a complete custom configuration. Then you could do something like:

    Code (csharp):
    1. ScoreFlashDelegator.Push("GameObjectName", "Message");
    With GameObjectName being the instance of ScoreFlash that has the configuration you want.

    Would that work for you (also the "quick fix" approach for V1.1.1)?
     
    Last edited: Oct 3, 2012
  25. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    V1.1.1 is now ready for submission :)

    I've also created a Flash-based Web player to showcase the new feature "using multiple instances of ScoreFlash in a single scene". So that Web player showcases two things: a) it also works with Flash and b) it now supports multiple instances with different configurations.

    The package I'm submitting as V1.1.1 also contains a new example scene and new example scripts (as usual in C#, JavaScript and Boo). Unfortunately, JavaScript and Boo don't support optional parameters, so there you'll have to use myScoreFlashInstance.PushLocal(string, null, null) instead of myScoreFlashInstance.PushLocal(string) as you can in C#. But if you're using your own GUIStyles, that doesn't make a difference anyways because you'll pass your own GUIStyles anyways ;-)

    So ... here you go:


    Enjoy!!!​


    I'll let you know when the package is approved and available. Usually, this doesn't take long when submitted during the week.

    PS: Ashkan asked @ ScoreFlash on LinkedIn about usage of GUIText vs. UnityGUI. So, I'm considering adding that if people really want it. Let me know if that's something you really need!
     
    Last edited: Oct 3, 2012
  26. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Score Flash V1.1.1 has been approved and is now available on the asset store!!!

    ... so if you already have it, you should update.


    Also, just to make sure no one misses this (it's also in the OP):

    WARNING: With ScoreFlash V2 - which is currently in development - the price will go up quite a bit - from $15 to $30. This is because ScoreFlash is becoming much bigger than I originally planned. So grab it at $15 while you can (updates on the Asset Store are always free - so you'll get V2 either way: paying $15 now or paying $30 after the V2 release ;-) )!!!

    For people on a budget, I'll provide ScoreFlash.DLL - a "no source code version" which will be available at $15 once ScoreFlash V2 is there, maybe $10, I haven't made the final decision on that, yet. ScoreFlash.DLL will basically be the same package, including examples (with source code, of course) - but none of the sources of ScoreFlash itself or the editor scripts etc.

    The full version of SourceFlash will also include the DLL-package, so if you prefer that for your project, you'll have both options. As the 3.4.2 version of ScoreFlash requires conditional compilation, ScoreFlash.DLL will only be available for Unity 3.5.6 and up (ScoreFlash will still support 3.4.2 for quite some time).
     
  27. miroku000

    miroku000

    Joined:
    Sep 12, 2010
    Posts:
    22
    Thanks for your quick response!

    I downloaded ScoreFlash V1.1.1

    I then added two ScoreFlash Prefabs to my project.

    I added the following to my script:

    public ScoreFlash levelupscoreflash;
    public ScoreFlash pluseonescoreflash;

    I unchecked the "Ensure Singleton" checkbox.
    Then Assigned the two to the corresponding Scoreflash variables in my script.

    Then, I call levelupscoreflash.Push("Swipe the screen Up to jump") ;

    I am getting this error:

    error CS0176: Static member `ScoreFlash.Push(string)' cannot be accessed with an instance reference, qualify it with a type name instead

    What am I doing wrong?
     
  28. miroku000

    miroku000

    Joined:
    Sep 12, 2010
    Posts:
    22
    I fixed my own problem.

    Intead of
    levelupscoreflash.Push("Swipe the screen Up to jump") ;
    It turns out you can use
    levelupscoreflash.PushLocal("Swipe the screen Up to jump") ;
     
  29. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Ah, I was too slow - but I'm glad it worked out for you!!! ;-) ... and yeah:

    For local instances you need to use PushLocal(...) instead of Push(...). I would have preferred to have both methods use the same name - but that's something that isn't supported in C#, so I had to add the postfix "Local". Or some other name ... but "PushLocal" seemed most obvious to me.

    When I ran into this I kind of regretted adding the "super-convenient" way of doing ScoreFlash.Push(...) (instead of the usual way it's done for Singleton patterns with ScoreFlash.Instance.Push(...) ) ... but now that I have this in place, I'd have to break compatibility to fix it. One nice thing about using the static methods is that Intellisense/code-completion only gives you very few methods on ScoreFlash (the class), while you get all the "stuff" inherited from MonoBehaviour when accessing an instance.

    As you're using C#, this works either way (with just the message, or one GUIStyle or two GUIStyles). Due to language limitations in JavaScript and Boo, you have to pass "something" for the two GUIStyle parameters - but that can be null, so if you don't have your own GUIStyle and want to use the one coming from the skin, in JavaScript and Boo (in Boo without the ";" at the end of the line), you'd do:

    Code (csharp):
    1. levelUpScoreFlash.PushLocal("Swipe the screen Up to jump", null, null);
    I could also overload this method but as there are more methods coming I'd like to avoid that and instead work with optional parameters as I'm doing it right now.

    Let me know how it is going for you!
     
  30. Tapgames

    Tapgames

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

    Thank's for the cool update with the colors this is exactly what I needed!

    Roy
     
  31. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hey Roy, that's great to hear! I'll probably release V2 this week, so that will add quite a bit more flexibility :)
     
  32. Tapgames

    Tapgames

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

    Can you tell what cool new stuff is added in v2 before I update my game to the App Store? :)

    Roy
     
  33. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    See above ;-) what V2 adds are a few possibilities to push messages located by positions in 3d space and arbitrary positions on the screen. So, instead of having each message e.g. in the center of the screen, messages could appear above player avatars or above the objects that give you the score or power ups when you pick them up or shoot them or whatever suits your needs ;-)

    Also, a better way to handle multiple different configurations is added.
     
  34. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Very cool, interesting, inspiring!
     
  35. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    ScoreFlash V2 is almost ready for submission! I'm tweaking the last few issues and getting the whole package ready for the asset store ... meanwhile, here's a demo Web player that should give an impression of V2 has for you:

    $ScoreFlashV2_Teaser_01.png
     
  36. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    This is simply great! :) Now I see where it's heading... this library definitely has a future!

    Once upon a time I made something similar with speech bubbles:

     
  37. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Hi Danko, that looks nice :)

    I got a little stuck with ScoreFlash V2 - for the new ScoreFlashFollow3D component that you can attach to any game object to add all kinds of funky ways of following it, I have added a custom inspector GUI (because it's nicer to use sliders than having to enter values between 0 and 1 for some parameters) ... and of course, I also wanted to make it possible to persist changes that were applied during play mode ... until this morning, I had the approach "integrated" into the ScoreFlashEditor class. Now it's an own class that can integrated very easily into any custom inspector ... and it's a whole lot more robust: In particular, it now supports making changes in many different objects and still keeping them after play mode stops even if you have none of the changed objects selected anymore (the previous approach failed miserably in that case).

    Also, you can now check a checkbox to either immediately store all changes when play mode ends - or, which I personally prefer, get a button to do it "on demand". This makes the whole process more transparent, and also makes it possible to discard changes. And, for convenience, you can still store all changes (made to the same object type) with a single button click.

    So this is really awesome, and with the new "multiple ScoreFlash instances in a single scene"-approach, and the possibility to have lots of ScoreFlashFollow3D objects flying around that you want to fine-tune during play mode, it makes a lot of sense. But ... it was just really not expected to be part of this release ...

    So ... I guess I'll push the submission button on Monday, after I've done quite a bit more polishing and testing.
     
  38. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Jashan, you should definitely decouple the system and add the second, 3-D renderer (rendering texts inside 3-D). That's because most likely people will want messages to sort accordingly to their world position (i.e. some world objects could hide them partially). I know it seems like a big step, but speaking from experience - better to think of it now, then when things become much more complicated ;) You don't need much, just an atlas font system... Also, it would be great for mobile gaming.
     
  39. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    In ScoreFlash V2, I'm adding a system that lets you plug in any GUI system that you wish. So you should be able to use NGUI or EZ GUI for rendering the text messages if you own any of these packages (I'll probably release V2.0 without that but unless I hit a really difficult problem it should be part of V2.1 which will be released shorty after V2.0). I already have this approach running with GUIText, which isn't really that useful (same number of draw calls as Unity GUI but no scaling and no rotation) but at least it's a proof-of-concept and an example to start with. I also have an adaptor which uses UnityGUI, which does the same as the core engine but with the "adaptor-based approach".

    It should be fairly easy to create an adaptor for eDriven.Gui as well - but as I haven't worked with eDriven.Gui, I can't say for sure. It may not really match well but it could still be nice to have that. Basically, as long as you have the possibility to have game objects representing your GUI elements, it should work (and as the UnityGUI example shows, you can even make it work with something that "natively" follows a different approach). And of course, once the new Unity GUI becomes available, ScoreFlash will have an adaptor for that as well (I planned to support that right from the start - but the adaptors make it really easy).

    Regarding 3D rendering, I'll look into that. Probably I can use the adaptor based approach for this as well - but I'll have to create a prototype before I can say for sure that this will work. I believe that both EZ GUI and NGUI support 3D GUIs, so once again, if you have those, you might be better off. What will come with ScoreFlash "out of the box" (no dependencies on external packages) is a TextMesh based approach.

    And again, depending on what the new Unity GUI offers once it's there, this will be supported as well.
     
  40. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Thanks for considering eDriven.Gui :) But I have to admit that using eDriven.Gui for this purpose would probably be an overkill. Here's why:

    Speech bubbles tend to move all the time, and are basically not constrained to anything (they have no parent). My GUI system uses invalidation mechanism to accumulate changes. For instance, when manipulating Width this way:

    Code (csharp):
    1. for (int i=0; i < 1000; i++) {
    2.    button.Width = i;
    3. }
    ... using the invalidation, only the last value actualy goes into the rendering phase (button.Width = 1000). This is important because the Width value is actually not only being read for rendering purposes, but in the setter it may trigger the change in size of the parent container, as well as its other children indirectly. So it is processor intensive, thus needs accumulating.

    This comes at a cost: the change in width is being propagated one frame later. Since all the changes go through the same pipeline (X, Y, Width, Height, Text, Color, Alpha...) they are all actually done one frame later. This is most noticable when dragging the dialog in the majority of GUI systems: there's a noticable 'latency' behind a mouse cursor. So, there would also be (maybe not so visible) latencies when rendering a bunch of resizable and moveable labels on screen, constantly changing their color, alpha etc.

    Your solution is interesting from the GUI standpoint because it's minimalistic and... just what it takes. :) If I would have to do something similar for my project, I would also make a lightweight solution, and not use a gigantic GUI framework.
     
    Last edited: Oct 12, 2012
  41. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    The one frame delay probably wouldn't be noticeable for ScoreFlash because most of the time, the texts are moving around anyways, and it's not obvious to the player whether we are one frame ahead or one frame behind. But of course, the usefulness would be questionable. I believe you're using UnityGUI as backend, so it would be a layer in-between just to end up having Unity painting the messages the way they are painted in the default-mode already.

    So, if that's correct and you are using UnityGUI as "rendering backend", the only interesting part about it would really be another "proof-of-concept" to show that the adaptor-based approach is versatile enough that anything goes. I believe doing "3D texts" is probably a more interesting problem to solve for the moment and would show something similar.
     
  42. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Can you explain how can I change the font of the text showed?
    I am getting errors, and the messages not working, if I change the default font in the Inspector (in the ScoreFlash prefab).
    I expected a basic option like that to be easier...
     
  43. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Sure - changing the font actually is very easy:

    From what you're writing, I'd say that most likely you are using a GUI Skin that doesn't have the custom style "ScoreFlash". So to fix that, add a custom style to your GUISkin, and assign your font to that, then assign that GUISkin to your ScoreFlash instance (you probably already did that). Another possibility is that you do have the custom style, but there's a type in the name, like maybe it's "Score Flash" instead of "ScoreFlash".

    The full instructions with all details:

    You have a GUI Skin in the prefab, and there are a few example GUISkins with example fonts coming with the package. In each of these GUI Skins, there's one custom style called "ScoreFlash" - when you change the font there and this is the GUISkin assigned to your ScoreFlash, you get a different font.

    If you want to use a font that's not in one of the examples, the recommended approach is to add a new GUI Skin, add a custom style "ScoreFlash" and assign your font to that style. Of course, you also need to assign the GUI Skin to your ScoreFlash instance (to make things very easy, you could simply copy one of the example GUI skins and change the font in the custom style that's already available there). If you want to automatically handle Retina displays, you'll need two GUI Skins - one with the "normal font" and one with the "Retina font" (usually simply twice the font size).

    I'm not on my home machine ATM, but as soon as I get back I'll send you screenshots with the details. This should also be explained in the tutorials, but I'd have to check to make sure where exactly.

    What is the exact error message you are getting? If there's an issue with the configuration, the error message *should* tell you precisely what the problem is but it could be that I missed a corner case. In that case, it will be fixed in the next version but to do that, I need to know exactly what your error message is (and maybe also what exactly you did to get that error message - but most likely, the error message will be sufficient).

    What I'll do is check if the error message when the custom style is missing isn't helpful - and if that's the case, I'll improve the error message. Sorry for the inconvenience!
     
  44. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Thank you for reporting this issue!

    So, I've just checked hopefully all cases of what could happen. The first case that could cause trouble is if you did not assign a GUISkin at all. That gives you a nice error messages both immediately in the inspector and the console once you start playing (and showing messages):

    $ErrorInspectorNoSkin.png

    When you start playing, you get a warning immediately:

    "Score Flash Renderer" is now in ScoreFlash V2 - if you're using custom renderers, you don't need GUISkins anymore, that's why I've added this to the warning to make it crystal clear. In V1.1.1, it's almost the same warning only without referring to "Score Flash Renderer". In fact, in V1.1.1 it's an error message and it will disable ScoreFlash - this is different in V2 because in V2, you can actually use ScoreFlash without GUISkins.

    So, in V2, whenever you try to push a message (including the autogenerated messages from test mode), you get an error:

    So in the case of forgetting to assign a skin, a believe all cases are covered quite well. What's more likely, though, is that you have a GUISkin assigned - but it doesn't have a ScoreFlash custom style. In the inspector, you do get an error message immediately:

    $ErrorInspectorGuiSkinWithoutScoreFlashStyle.png

    ... but ... what I missed was giving you a nice warning in the console. What you'll run into is a NullReferenceException because I can't get the ScoreFlash-style.

    Sorry about that!

    Fixed for V2.0.0 ;-)

    What you will be getting with V2.0.0 when starting play is a warning:

    ... and whenever you try to send a message, you'll get the warning:

    So using the "default font" will theoretically work (you will see some messages appearing) - but you'll get the warning on each message.

    Also all warnings and error messages should now ping the relevant object; so if the skin is missing for ScoreFlash, you'll ping ScoreFlash when clicking the message, and when your GUISkin is missing the custom style, you'll ping the GUISkin when clicking the message.
     
  45. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    The news is that jashan will make an adapter for eDriven.Gui as output :)

    (this should help him in decoupling his sistem, since eDriven.Gui is also built on top of the immediate mode GUI)

    Can't wait to see the demo..:D
     
  46. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    The error message was: "Custom style ScoreFlash is missing in your GUI style !"

    Sorry but I haven't seen it explained anywhere.
     
    Last edited: Oct 14, 2012
  47. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I appreciate your feedback and agree that having to add a custom style to your GUI skin makes things a little bit more complicated.

    However, in most cases you don't want to use the same font that you're using for your labels also for ScoreFlash: Usually, you'll use a smaller default font, and a larger font for ScoreFlash messages. That's why I decided to use a custom style. That way, it's easy to use your existing GUISkins and you don't have to add a separate skin just for ScoreFlash.

    In V2, ScoreFlash will fall back to the "label" style but it will still post a warning to the console in that case ... but I guess I should add a way to change what style ScoreFlash looks for. I just realized that when you have multiple instances of ScoreFlash with multiple fonts, the current approach does require multiple GUISkins which isn't that great.

    Also, I will create a screencast that explains how to add the custom styles to GUISkins as this seemingly isn't as obvious as I thought when writing those error messages.
     
  48. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    I have created a video that explains how to work with GUISkins, GUIStyles and Fonts in ScoreFlash. While this was done using ScoreFlash V2, it should also help with any difficulties that you might have with ScoreFlash V1.1.1. It's available now on YouTube:


    Let me know if there are still any things that are unclear or any changes you need!

    Btw, I'm packaging up ScoreFlash V2 for submission to the Asset Store. I'm not including support for NGUI, EZ GUI and eDriven.Gui in V2.0.0, yet - but I will include NGUI and EZ GUI in V2.1.0 and eDriven.Gui in V2.1.1 (as usual: unless there's any truly severe issues on the way ... but I doubt it, so I'm almost certain that we'll have support for these packages by the end of this week :) ).

    If you don't have a ScoreFlash license, yet, and you want full source code included, now is probably the last chance to get it at $15. The price will go up to $30 with V2. There will also be a new package, ScoreFlash.DLL, at $15 - but that's without sources (as the name implies).
     
  49. cel

    cel

    Joined:
    Feb 15, 2011
    Posts:
    46
    great!!! could you also make actions for playmaker to pass values to flashscore?
     
  50. dkozar

    dkozar

    Joined:
    Nov 30, 2009
    Posts:
    1,410
    Oh, feel more decoupling coming :)

    Jashan, if decoupled communication is what you need in any step of a development, there's eDriven.Core worth considering (open source, MIT) , especially the Signal class. Lightweight and fast, simply great messaging system.