WoW:API UIFrameFlash: Difference between revisions
Jump to navigation
Jump to search
({{framexmlfunc|FrameXML/UIParent.lua}}) |
m (Move page script moved page API UIFrameFlash to API UIFrameFlash without leaving a redirect) |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{framexmlfunc|FrameXML/UIParent.lua}} | <br>{{framexmlfunc|FrameXML/UIParent.lua}} | ||
Flashes a frame by fading it in/out and showing/hiding it at the end. | Flashes a frame by fading it in/out and showing/hiding it at the end. | ||
UIFrameFlash(frame, fadeInTime, fadeOutTime, flashDuration, showWhenDone, flashInHoldTime, flashOutHoldTime) | UIFrameFlash(frame, fadeInTime, fadeOutTime, flashDuration, showWhenDone, flashInHoldTime, flashOutHoldTime) | ||
=Parameters= | == Parameters == | ||
==Arguments== | === Arguments === | ||
:frame, fadeInTime, fadeOutTime, flashDuration, showWhenDone, flashInHoldTime, flashOutHoldTime | :frame, fadeInTime, fadeOutTime, flashDuration, showWhenDone, flashInHoldTime, flashOutHoldTime | ||
Line 15: | Line 15: | ||
:;flashInHoldTime: Number - number of seconds to hold the fully hidden state. | :;flashInHoldTime: Number - number of seconds to hold the fully hidden state. | ||
:;flashOutHoldTime : Number - number of seconds to hold the fully visible state. | :;flashOutHoldTime : Number - number of seconds to hold the fully visible state. | ||
==Returns== | === Returns === | ||
This function does not return any values. | This function does not return any values. | ||
= Example = | == Example == | ||
UIFrameFlash(UIParent, 1, 2, 15, true, 12, 0) | UIFrameFlash(UIParent, 1, 2, 15, true, 12, 0) | ||
==Result== | === Result === | ||
The UIParent frame and all its children are at first hidden. The UIParent then fades in (1 second), fades out (2 seconds), stays hidden for 12 seconds, and fades in again, remaining shown this time. | The UIParent frame and all its children are at first hidden. The UIParent then fades in (1 second), fades out (2 seconds), stays hidden for 12 seconds, and fades in again, remaining shown this time. | ||
=Details= | == Details == | ||
Several important things to note when using UIFrameFlash: | Several important things to note when using UIFrameFlash: | ||
* Flash cycle starts at hidden. If you call UIFrameFlash on an already visible frame, it'll be hidden. | * Flash cycle starts at hidden. If you call UIFrameFlash on an already visible frame, it'll be hidden. | ||
* Flashing works by modifying the frame's alpha value (:SetAlpha). All of the frame's children fade with their parent frame. | * Flashing works by modifying the frame's alpha value (:SetAlpha). All of the frame's children fade with their parent frame. | ||
* You can not flash the WorldFrame (fails silently). | * You can not flash the WorldFrame (fails silently). | ||
* If you try to flash an already flashing frame, the function fails silently. You may use [[API UIFrameIsFading|UIFrameIsFading (frame)]] to detect if a frame is already flashing, and [[API | * If you try to flash an already flashing frame, the function fails silently. You may use [[API UIFrameIsFading|UIFrameIsFading (frame)]] to detect if a frame is already flashing, and [[API UIFrameFlashStop|UIFrameFlashRemoveFrame (frame)]] to stop the flashing cycle prematurely (make sure to set the desired alpha value manually afterwards). | ||
* Once flashDuration expires, the frame's alpha is bluntly set to either 1 or 0 (depending on showWhenDone). Make sure to set a flashDuration value to coincide with the end of a fade in (if you want the frame to remain visible) or fade out (if not). Otherwise, things will look awkward. | * Once flashDuration expires, the frame's alpha is bluntly set to either 1 or 0 (depending on showWhenDone). Make sure to set a flashDuration value to coincide with the end of a fade in (if you want the frame to remain visible) or fade out (if not). Otherwise, things will look awkward. | ||
* The frame MUST have a name, otherwise one of the internal functions causes an error. |
Latest revision as of 04:47, 15 August 2023
← WoW API < UIFrameFlash
- This function is implemented in Lua here FrameXML/UIParent.lua.
Flashes a frame by fading it in/out and showing/hiding it at the end.
UIFrameFlash(frame, fadeInTime, fadeOutTime, flashDuration, showWhenDone, flashInHoldTime, flashOutHoldTime)
Parameters[edit]
Arguments[edit]
- frame, fadeInTime, fadeOutTime, flashDuration, showWhenDone, flashInHoldTime, flashOutHoldTime
- frame
- Frame Pointer - frame to fade in / out.
- fadeInTime
- Number - duration of the fade in effect.
- fadeOutTime
- Number - duration of the fade out effect.
- flashDuration
- Number - number of seconds to keep repeating the fade in / out cycle.
- showWhenDone
- Boolean - should the frame be visible at the end?
- flashInHoldTime
- Number - number of seconds to hold the fully hidden state.
- flashOutHoldTime
- Number - number of seconds to hold the fully visible state.
Returns[edit]
This function does not return any values.
Example[edit]
UIFrameFlash(UIParent, 1, 2, 15, true, 12, 0)
Result[edit]
The UIParent frame and all its children are at first hidden. The UIParent then fades in (1 second), fades out (2 seconds), stays hidden for 12 seconds, and fades in again, remaining shown this time.
Details[edit]
Several important things to note when using UIFrameFlash:
- Flash cycle starts at hidden. If you call UIFrameFlash on an already visible frame, it'll be hidden.
- Flashing works by modifying the frame's alpha value (:SetAlpha). All of the frame's children fade with their parent frame.
- You can not flash the WorldFrame (fails silently).
- If you try to flash an already flashing frame, the function fails silently. You may use UIFrameIsFading (frame) to detect if a frame is already flashing, and UIFrameFlashRemoveFrame (frame) to stop the flashing cycle prematurely (make sure to set the desired alpha value manually afterwards).
- Once flashDuration expires, the frame's alpha is bluntly set to either 1 or 0 (depending on showWhenDone). Make sure to set a flashDuration value to coincide with the end of a fade in (if you want the frame to remain visible) or fade out (if not). Otherwise, things will look awkward.
- The frame MUST have a name, otherwise one of the internal functions causes an error.