ScoreFlash MembersScoreFlash API Documentation V4.6.0

The ScoreFlash type exposes the following members.
Constructors

  NameDescription
Public methodScoreFlash
Back to Top
Methods

  NameDescription
Public methodCleanup
Immediately cleans up all messages currently on screen.
Public methodCreateDesignerMessage
Creates a ScoreMessage to be used in the designer.
(Overrides ScoreFlashBase CreateDesignerMessage(String).)
Public methodStatic memberGetAlignBasedOffset
Calculates a pixel offset based on msg.Alignment.ScreenAlign.
Public methodStatic memberPush(Object)
Shows msg nicely. This is the one method you need to know. Usually, you'll use ScoreFlash.Push(object msg) from anywhere in your code.
Public methodStatic memberPush(Object, Color)
Shows msg nicely in the given color!
Public methodStatic memberPush(Object, GUIStyle)
Shows msg using style regardless of normal density or high density screen. It's up to you to make sure that style works correctly. It is recommended that it has alignment set to UpperCenter and wordWrap set to false (word wrap is automatically activated if the message is too long to be properly displayed on screen with minPaddingX.
Public methodStatic memberPush(Object, GUIStyle, GUIStyle)
Shows msg using style or styleHighDensity depending on whether we are on a normal density or high density screen (determined using IsHighDensityDisplay. It's up to you to make sure that style works correctly. It is recommended that it has alignment set to UpperCenter and wordWrap set to false (word wrap is automatically activated if the message is too long to be properly displayed on screen with minPaddingX.
Public methodPushFromInspector
This is just a helper to be able to send messages directly from the inspector. If calling ScoreFlash.Push(...) directly from there, the Screen.width is taken from the inspector window which is not exactly what we want ;-)
Public methodPushLocal(Object)
Public methodPushLocal(Object, Color)
Public methodPushLocal(Object, GUIStyle)
Public methodPushLocal(Object, Color, Int32)
Public methodPushLocal(Object, GUIStyle, GUIStyle)
Public methodPushLocal(Object, GUIStyle, GUIStyle, Int32)
Public methodPushScreen(Vector2, Object)
Public methodPushScreen(Vector2, Object, Color)
Public methodPushScreen(Vector2, Object, GUIStyle)
Public methodPushScreen(Vector2, Object, Color, Int32)
Public methodPushScreen(Vector2, Object, GUIStyle, GUIStyle)
Public methodPushScreen(Vector2, Object, GUIStyle, GUIStyle, Int32)
Public methodPushWorld(ScoreFlashFollow3D, Object)
Public methodPushWorld(Vector3, Vector2, Object)
Public methodPushWorld(ScoreFlashFollow3D, Object, Color)
Public methodPushWorld(ScoreFlashFollow3D, Object, GUIStyle)
Public methodPushWorld(Vector3, Vector2, Object, Color)
Public methodPushWorld(Vector3, Vector2, Object, GUIStyle)
Public methodPushWorld(ScoreFlashFollow3D, Object, GUIStyle, GUIStyle)
Public methodPushWorld(Vector3, Vector2, Object, Color, Int32)
Public methodPushWorld(Vector3, Vector2, Object, GUIStyle, GUIStyle)
Public methodPushWorld(Vector3, Vector2, Object, GUIStyle, GUIStyle, Int32)
Public methodShowObsolete.
Legacy method - no longer recommended. Use ScoreFlash.Instance.PushLocal(object) (PushLocal(Object)) instead.
Public methodUpgradeCheck
Performs a couple of checks to ensure that everything is set up correctly after an upgrade to a new version.
(Overrides ScoreFlashBase UpgradeCheck .)
Back to Top
Fields

  NameDescription
Public fieldalphaFadeInMultiplier
Initial alpha value. This is ignored for FadePhases and used as multiplier for the value from the current color in the other colorSelectionMode modes.
Public fieldalphaFadeOutMultiplier
Alpha value for Fade Out. This is ignored for FadePhases and used as multiplier for with the value from the current color in the other colorSelectionMode modes.
Public fieldalphaReadEndMultiplier
Alpha value for Read End. This is ignored for FadePhases and used as multiplier for with the value from the current color in the other colorSelectionMode modes.
Public fieldalphaReadStartMultiplier
Alpha value for Read Start. This is ignored for FadePhases and used as multiplier for with the value from the current color in the other colorSelectionMode modes.
Public fieldcolorOutline
Color of the outline - should usually be black. Alpha is used to multiply with current text color.
Public fieldcolors
Colors used for colorSelectionMode: Sequence and Random.
Public fieldcolorSelectionMode
How should ScoreFlash handle colors? Default is FadePhases. Possible values are defined by ScoreFlash ColorControl.
Public fieldcurrentDebugMode
What should be shown in the message when debug mode is activated.
Public fieldcustomParent
When using a ScoreFlashRenderer that returns true for RequiresCustomParent, this can be assigned to make sure that the instances of ScoreFlashRenderer are parented to this parent.
Public fielddesignText
Message that is shown while in design mode.
Public fielddisableOutlines
If you don't want outlines to be rendered (which adds a few drawcalls), check this. This is the default on mobile devices. Readability is highly increased with outlines so it is recommended to read this to false unless you use this on a background that makes the texts easy to read!
Public fieldeditorGUISkin
GUI skin for rendering the layout designer in the editor (scene view). Do not touch this!
Public fieldeditorIconSet
Icon set with a couple of icons useful for the editor GUI. Do not touch this!
Public fieldenableDeselectHack
Unity doesn't properly support updating the GameView when an object is deselected, so if you disable this, the design will stay in the game view until it is updated once more. I have a hack for this - but unfortunately, it's causing trouble when the object is being deleted (there's an exception that I cannot catch). Both is not a real problem, it's just a little annoying.
Public fieldensureSingleton
Assures that there is only one instance of ScoreFlash available in any scene by destroying any new instances that are being created.
Public fieldfadeInColor
Initial color.
Public fieldfadeInColorCurve
The animation curve used to drive the color from colorFadeIn to colorReadStart.
Public fieldfadeInOffsetX
The offset the message starts with relative to its main screen position. Positive values in X make the message come from right, negative messages make the message come from left.
Public fieldfadeInOffsetXCurve
The animation curve used to drive fadeInOffset.y while fading in.
Public fieldfadeInOffsetY
The offset the message starts with relative to its main screen position. Positive values in Y make the message come from below, negative values make the message come from above.
Public fieldfadeInOffsetYCurve
The animation curve used to drive fadeInOffset.y while fading in.
Public fieldfadeInScale
The initial scale when the message appears.
Public fieldfadeInScaleCurve
The animation curve used to drive the scale from fadeInScale to it's read start value (this is always 1).
Public fieldfadeInTimeSeconds
The time in seconds that it takes to fade in.
Public fieldfadeOutColor
Color faded to from read color in fade out phase. Should have alpha = 0! WARNING: If "alpha != 0" => text disappears abruptly!
Public fieldfadeOutColorCurve
The animation curve used to drive the color from colorReadEnd to colorFadeOut.
Public fieldfadeOutFloatRightVelocity
Speed with which the message floats right while it fades out. Use negative values to make it float left. WARNING: Values between -15 and 15 (but not 0) may generate stuttering!
Public fieldfadeOutFloatUpVelocity
Speed with which the message floats up while it fades out. Use negative values to make it float down. When using negative values here, you should most likely also use negative values for spreadSpeed!!! WARNING: Values between -15 and 15 (but not 0) may generate stuttering!
Public fieldfadeOutInitialRotationSpeed
This is the initial rotation speed the message gets immediately when moving into fading out. Use rotationAccelleration to make this a little smoother. Set to 0 to not have the message rotate on fading out (rotationAccelleration must also be 0).
Public fieldfadeOutRotationAcceleration
Increases the rotation speed while the message fades out. Set to 0 to not have the message rotate on fading out (initialRotationSpeed must also be 0).
Public fieldfadeOutScale
Scale at the end of the fade out time. The message scales from midScale to this value while it is kept to be read.
Public fieldfadeOutScaleCurve
The animation curve used to drive the scale from readTimeScale to it's fade out end value fadeOutTimeScale.
Public fieldfadeOutTimeSeconds
The time the message takes to fade out.
Public fieldfadeOutVelocityCurve
The animation curve used to drive the velocity on y from readTimeFloatUpVelocity to it's fade out end value fadeOutTimeFloatUpVelocity.
Public fieldfadeOutVelocityXCurve
The animation curve used to drive the velocity on x from readTimeFloatUpVelocity to it's fade out end value fadeOutTimeFloatUpVelocity.
Public fieldfont
The font to be used by ScoreFlash.
Public fieldfontHighDensity
The (optional) font to be used by ScoreFlash when running on a device with a high density display (like Retina displays).
Public fieldforceOutlineOnMobile
Usually, outlines are disabled on mobile devices to reduce draw calls. Check this to also render outlines on mobile devices.
Public fieldguiStyleName
The name of either a default style of a custom style in skin (and skinHighDensity if you also use that) that ScoreFlash uses to get font and style information.
Public fieldincludeMessageSpam
This will send a burst of messages with no delay every once in a while (depends on whether includeVeryLongMessages is active). It ignores messageFrequencyMultiplier.
Public fieldincludeVeryLongMessages
Includes a few messages with very long text to see how that is handled.
Public fieldinnerAnchor
Controls the anchor of the message. Use this for left/center/right aligning the text messages. Possible values are defined by NGAlignment ScreenAlign.
Public fieldisDebugMode
Renders debugging information instead of the actual messages. When using the default, UnityGUI based rendering, this also renders a box around the messages.
Public fieldisDesignMode
Design mode allows you to use the scene view to set up the main layout of ScoreFlash. This works both while playing and while not playing.
Public fieldisTestAutogenerateMessages
Use this to show random messages.
Public fieldisTestForceHighDensity
Use this to test high density screen layouts.
Public fieldlockInnerAnchor
Locks the innerAnchor to screenAlign.
Public fieldlockScreenAlign
Locks the screen alignment. This is only used by the visual designer.
Public fieldmaxSimultanuousMessages
Maximum number of simultanuous messages before we start the "quick mode" which makes older messages age 8 times quicker than usual to avoid information (and drawcall) overflow.
Public fieldmaxWidth
Maximum width of the message before it's wrapped. This works together with minPaddingX.
Public fieldminDistanceBetweenMessages
When messages arrive quickly, there may be multiple shown simultanuously. This values controls how much distance ScoreFlash tries to keep between two messages. If the distance cannot be kept, old messages age quicker so they fade out sooner so there's more room for the new messages.
Public fieldminPaddingX
Minimum distance between the message and the left/right screen borders before the message is wrapped in two (or more) lines. This works together with maxWidth.
Public fieldpaddingY
Obsolete (but I can't officially mark it obsolete because I have to use it myself to grab the value on updates when people have older versions of ScoreFlash. Some day, I'll make this obsolete and eventually remove it. Until then, it's best ignored. Thank you for reading this (you must be really interested if you came here ;-) ).
Public fieldposition
Public fieldreadAddTimeSeconds
To be able to read long texts, the player needs more time. This defines how much longer long messages remain visible if the message in question has more than minLengthCharsToAddTime characters.
Public fieldreadColorCurve
The animation curve used to drive the color from colorReadStart to colorReadEnd.
Public fieldreadColorEnd
Color faded to from max color in "read phase".
Public fieldreadColorStart
Color faded to from initial color in first phase.
Public fieldreadFloatRightVelocity
Speed with which the message floats right while it fades out. Use negative values to make it float left. WARNING: Values between than -15 and 15 (but not 0) may generate stuttering!
Public fieldreadFloatUpVelocity
Speed with which the message floats up while it fades out. Use negative values to make it float down. When using negative values here, you should most likely also use negative values for spreadSpeed!!! WARNING: Values between than -15 and 15 (but not 0) may generate stuttering!
Public fieldreadMinLengthCharsToAddTime
This is the maximum length in characters before readTimeAdd is added to a message.
Public fieldreadScale
Scale at the end of the read time. The message scales from 1 to this value while it is kept to be read.
Public fieldreadScaleCurve
The animation curve used to drive the scale from 1 to it's read end value readTimeScale.
Public fieldreadTimeSeconds
The time the message is kept for the player to read (max to read),
Public fieldreadVelocityCurve
The animation curve used to drive the velocity on the y-axis from 0 to it's read end value readTimeFloatUpVelocity.
Public fieldreadVelocityXCurve
The animation curve used to drive the velocity on the x-axis from 0 to it's read end value readTimeFloatUpVelocity.
Public fieldrendering
Public fieldscoreFlashRenderer
Assign this if you want custom rendering, e.g. using GUIText or NGUI or EZ GUI.
Public fieldscreenAlign
Controls whether the message is aligned to top, middle or bottom of the screen. Defines how position is applied. Possible values are defined by NGAlignment ScreenAlign.
Public fieldskin
Assign a skin that has the custom style ScoreFlash
Public fieldskinHighDensity
Optional skin for retina displays.
Public fieldspreadImmediately
If true, instead of waiting for the fade in phase to finish, messages immediately start pushing other messages. In most cases, that should be true but I kept "false" the default to not break existing code.
Public fieldspreadSpeed
How quickly should messages be spread to meet the minimum distance? Positive values make message move upwards, negative values make message spread downwards (it's important to make this fit the other velocities!)
Public fieldtestMessageDelaySeconds
The usual delay between two messages in seconds. Use this to increase or decrease the frequency in which test messages are being sent to ScoreFlash.
Public fieldtimeReference
Which time reference shall ScoreFlash use - game time or real time? In other words: Should Time.timeScale have an effect (UseGameTime), or not (UseRealTime). Possible values are defined by ScoreFlash TimeReference.
Public fieldwarmUpCount
When using rendering via prefabs, this allows you to instantiate a number of these prefabs immediately on startup to prevent any hiccups later in the game.
Back to Top
Properties

  NameDescription
Public propertyDefaultScoreFlash
Returns this. Used for the designer mode.
(Overrides ScoreFlashBase DefaultScoreFlash.)
Public propertyInnerAnchor
The inner anchor for this layout instance. See innerAnchor.
(Overrides ScoreFlashBase InnerAnchor.)
Public propertyStatic memberInstance
Provides access to the one Instance of ScoreFlash. This only works reliably if ensureSingleton is true! If you have multiple instances of ScoreFlash, using this will have unpredictable results, use Get(String) in that case instead!
Public propertyIsDesignMode
Is the designer actually switched on?
(Overrides ScoreFlashBase IsDesignMode.)
Public propertyLockInnerAnchor
Is the inner anchor currently locked to the screen alignment? See lockInnerAnchor.
(Overrides ScoreFlashBase LockInnerAnchor.)
Public propertyLockScreenAlign
Shall we lock screen align? See lockScreenAlign.
(Overrides ScoreFlashBase LockScreenAlign.)
Public propertyMaxWidth
The maximum width of the messages. See maxWidth.
(Overrides ScoreFlashBase MaxWidth.)
Public propertyMinPaddingX
The minimum padding of the items. See minPaddingX.
(Overrides ScoreFlashBase MinPaddingX.)
Public propertyPosition
The position offset. See position.
(Overrides ScoreFlashBase Position.)
Public propertyPositionWorld
Always returns null.
(Overrides ScoreFlashBase PositionWorld.)
Public propertyScreenAlign
The screen alignment. See screenAlign.
(Overrides ScoreFlashBase ScreenAlign.)
Public propertySupportsInnerAnchor
Returns true.
(Overrides ScoreFlashBase SupportsInnerAnchor.)
Public propertySupportsScreenAlign
Returns true.
(Overrides ScoreFlashBase SupportsScreenAlign.)
Public propertyTemporaryName
This is used for renaming ScoreFlash instances conveniently from the ScoreFlashManager (if you're using this).
Back to Top
See Also