Thread Tools Display Modes
09-11-16, 08:45 AM   #1
asdf
A Deviate Faerie Dragon
Join Date: Feb 2005
Posts: 18
Timed updates rather than event-driven? (scrolling a message)

Hi all,

So after this discussion I decided to write my own combat text addon to serve my needs.

I've made some significant progress already, and it's been a lot of fun actually. However, I've gotten a bit stumped when it comes to a certain aspect of scrolling combat text. How do you fire the update function which updates the string locations on the screen?

I'm following the basic structure of Blizzard_CombatText.lua and borrowing some of their methods, but I can't figure out how they would get a smooth scroll of text on screen when there aren't any events being triggered.

CombatText_OnUpdate(self, elapsed) is what seems to need to be called every time the game loops, but I don't know by what mechanism that's actually happening.

What am I missing here?
  Reply With Quote
09-11-16, 09:56 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
https://www.townlong-yak.com/framexm...batText.xml#51

Code:
local f = CreateFrame("Frame")
f:SetScript("OnUpdate", function(self, elapsed)
    -- Everything in here gets run every time a new video frame is drawn.
    -- "elapsed" is the time in (fractional) seconds since the last OnUpdate ran.
end)
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote
09-11-16, 12:34 PM   #3
asdf
A Deviate Faerie Dragon
Join Date: Feb 2005
Posts: 18
Originally Posted by Phanx View Post
https://www.townlong-yak.com/framexm...batText.xml#51

Code:
local f = CreateFrame("Frame")
f:SetScript("OnUpdate", function(self, elapsed)
    -- Everything in here gets run every time a new video frame is drawn.
    -- "elapsed" is the time in (fractional) seconds since the last OnUpdate ran.
end)
Awesome, thank you.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Timed updates rather than event-driven? (scrolling a message)


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off