Code:
local f = CreateFrame("Frame","AnimationByOnUpdate",UIParent)
f:SetSize(64,64)
local texture = f:CreateTexture(nil,"ARTWORK")
texture:SetAllPoints(true)
texture:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")
texture:SetSnapToPixelGrid(false)
texture:SetTexelSnappingBias(0)
f.xpos = 0
f.xoffset = -300
f.speed = 0.01 -- 2=faster, 0.5=slower
local function translate(self,elapsed)
self.xpos = self.xpos + (self.xoffset*self.speed*elapsed)
self:SetPoint("CENTER",self.xpos,0)
if self.xpos < self.xoffset then
self:SetPoint("CENTER",self.xoffset,0)
self:SetScript("OnUpdate",nil)
end
end
f:SetScript("OnUpdate",translate)