I would like to have the background of my [scrolling] window frame be completely transparent. I assume that I’ll have to set an object’s alpha to 0.0, but what would that object be?
Thanks,
I would like to have the background of my [scrolling] window frame be completely transparent. I assume that I’ll have to set an object’s alpha to 0.0, but what would that object be?
Thanks,
What template are you using? Do you have any code?
ScrollFrame elements generally have no background until you (or the template it uses) add one. So you can omit, hide or SetAlpha(0) that.
This code creates an edit box within a scroll frame. My desire is to get the background (over which the text scrolls) completely transparent. Does this snippet help?
Thanks, in advance
local function createTextDisplay(f)
f.SF = CreateFrame("ScrollFrame", "$parent_DF", f, "UIPanelScrollFrameTemplate")
f.SF:SetPoint("TOPLEFT", f, 12, -30)
f.SF:SetPoint("BOTTOMRIGHT", f, -30, 40)
-- Now create the EditBox
f.Text = CreateFrame("EditBox", nil, f)
f.Text:SetMultiLine(true)
f.Text:SetSize(DEFAULT_FRAME_WIDTH - 20, DEFAULT_FRAME_HEIGHT )
f.Text:SetPoint("TOPLEFT", f.SF) -- ORIGINALLY TOPLEFT
f.Text:SetPoint("BOTTOMRIGHT", f.SF) -- ORIGINALLY BOTTOMRIGHT
f.Text:SetMaxLetters(99999)
f.Text:SetFontObject(GameFontNormal) -- Color this R 99, G 14, B 55
f.Text:SetHyperlinksEnabled( true )
f.Text:SetTextInsets(5, 5, 5, 5, 5)
f.Text:SetAutoFocus(false)
f.Text:EnableMouse( false )
f.Text:EnableKeyboard( false )
f.Text:SetScript("OnEscapePressed",
function(self)
self:ClearFocus()
end)
f.SF:SetScrollChild(f.Text)
end
That scrollframe creates no background texture. The only visible elements are the scrollbar top/bottom/thumb buttons. I suspect the frame you’re passing to createTextDisplay() has a background you want to omit/hide/setalpha.
And you didn’t ask, but if the intent is to create a read-only scrollframe with scrolling text, you may be interested in a ScrollingMessageFrame rather than this. (I’ll answer more on that in the other thread.)
And if you did want the text to scroll as user types (maybe not, since keyboard disabled), look for these two functions in SharedUIPanelTemplates.lua:
ScrollingEdit_OnUpdate(self, elapsed, scrollFrame) ScrollingEdit_OnCursorChanged(self, x, y, w, h)
These will make life much easier. There’s other functions in there, but just those two in an OnUpdate and OnCursorChanged will handle a ton of work for you. Curiously, many editboxes in the default UI has that OnUpdate enabled all the time. But you can just have it off and only turn it on for one frame in the OnCursorChanged handler. 99% of the editbox stuff in TinyPad happens in the panels\editor.lua file if you wanted to take a look.
Thanks, Gello. By way of explanation, my addon is a personal combat tracker and it [formats and] prints each combat log event to the edit box. I am using the edit box so that the user can copy the text from the edit box to, say, an excel spreadsheet (the addon has a [format output menu, e.g., CSV) for further analysis.
What I want to do is cosmetic - print the combat log in the frame with the background completely transparent. The addon, Mik’s Scrolling Combat Text did something like this but without a visible frame.
Cheers