12.07.2015 Views

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

Wiley-World.of.Warcraft.Programming.A.Guide.and.Reference.for.Creating.WoW.Addons

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 29 ■ Widget <strong>Reference</strong> 1223The stock UI uses the basic message frame <strong>for</strong> only one purpose, but it gets a lot<strong>of</strong> use; UIErrorsFrame, which displays messages like ‘‘Spell not ready yet’’ or ‘‘You’retoo far away’’, is a MessageFrame. MessageFrame also <strong>for</strong>ms the basis <strong>for</strong> another,more sophisticated type, ScrollingMessageFrame.MessageFrame has all the methods from Frame <strong>and</strong> FontInstance, plus the following:AddMessageAdds a message to those listed in the frame.MessageFrame:AddMessage(“text“ [, red [, green [, blue [, alpha]]]])If the frame was already ‘full’ with messages, then the oldest message isdiscarded when the new one is added.Arguments:text—Text <strong>of</strong> the message (string)red (optional)—Red component <strong>of</strong> the text color <strong>for</strong> the message (0.0 - 1.0)(number)green (optional)—Green component <strong>of</strong> the text color <strong>for</strong> the message(0.0 - 1.0) (number)blue (optional)—Blue component <strong>of</strong> the text color <strong>for</strong> the message (0.0 - 1.0)(number)alpha (optional)—Alpha (opacity) <strong>for</strong> the message (0.0 = fully transparent, 1.0= fully opaque) (number)ClearRemoves all messages displayed in the frame.MessageFrame:Clear()GetFadeDurationReturns the duration <strong>of</strong> the fade-out animation <strong>for</strong> disappearing messages.duration = MessageFrame:GetFadeDuration()For the amount <strong>of</strong> time a message remains in the frame be<strong>for</strong>e beginning t<strong>of</strong>ade, see :GetTimeVisible().Returns:duration—Duration <strong>of</strong> the fade-out animation <strong>for</strong> disappearing messages (inseconds) (number)GetFadingReturns whether messages added to the frame automatically fade out after aperiod <strong>of</strong> time.fading = MessageFrame:GetFading()Returns:fading—1 if messages added to the frame automatically fade out after a period<strong>of</strong> time; otherwise nil (1nil)GetIndentedWordWrapReturns whether long lines <strong>of</strong> text are indented when wrapping.indent = MessageFrame:GetIndentedWordWrap()

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!