WoW:UIOBJECT ScrollFrame: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Added note about ScrollFrame display glitch)
m (Move page script moved page UIOBJECT ScrollFrame to UIOBJECT ScrollFrame without leaving a redirect)
 
(4 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{widget}}
{{widget}}
{{Stub/API}}


In many cases, ScrollFrames, and in particular the FrameXML-defined FauxScrollFrame, does more than you need. If all you are trying to accomplish is offsetting a list in an array of buttons/fontstrings, as is often the case, all you really need is a [[UIOBJECT Slider|Slider]]. ScrollFrames are for smooth pixel-by-pixel scrolling of a complete frame that is only partially visible.
In many cases, ScrollFrames, and in particular the FrameXML-defined FauxScrollFrame, does more than you need. If all you are trying to accomplish is offsetting a list in an array of buttons/fontstrings, as is often the case, all you really need is a [[UIOBJECT Slider|Slider]]. ScrollFrames are for smooth pixel-by-pixel scrolling of a complete frame that is only partially visible.


Scroll frames are good for scrolling large portions of text, or a large [[UIOBJECT EditBox|EditBox]].


Scroll frames are good for scrolling large portions of text, or large a large [[UIOBJECT EditBox|EditBox]].  However, there is a glitch that will cause dots to appear between the lines of text.  This appearance of this glitch changes depending on the height of the ScrollFrame.  Certain heights have no visible problems (250 worked for me, and there are others).
'''Notice''': Multiple textures, positioned one to another, may start "fidgeting" when the ScrollFrame's ScrollChild containing them is resized/moved/scrolled. And "fidgeting" may mean quite serious distortions, with textures shifting up to 3-4 pixels in an unpredictable direction. Speculation here - apparently this happens because ScrollFrames are (seemingly) created by rendering all their content onto a texture in memory, and treating the ScrollFrame's ScrollChild as a mere Texture, taking its contents from the in-memory texture using SetTexCoord. Now when the 0-1 texture coordinates suffer from precision errors, everything starts to shake. Surprisingly, though, text does NOT suffer much. Bottom line - use ScrollFrames for large images or blocks of text, but not for a large number of multi-textured relatively-positioned controls.
 
== See also ==
* [[XML/ScrollFrame]]

Latest revision as of 04:49, 15 August 2023

Widget API < ScrollFrame

In many cases, ScrollFrames, and in particular the FrameXML-defined FauxScrollFrame, does more than you need. If all you are trying to accomplish is offsetting a list in an array of buttons/fontstrings, as is often the case, all you really need is a Slider. ScrollFrames are for smooth pixel-by-pixel scrolling of a complete frame that is only partially visible.

Scroll frames are good for scrolling large portions of text, or a large EditBox.

Notice: Multiple textures, positioned one to another, may start "fidgeting" when the ScrollFrame's ScrollChild containing them is resized/moved/scrolled. And "fidgeting" may mean quite serious distortions, with textures shifting up to 3-4 pixels in an unpredictable direction. Speculation here - apparently this happens because ScrollFrames are (seemingly) created by rendering all their content onto a texture in memory, and treating the ScrollFrame's ScrollChild as a mere Texture, taking its contents from the in-memory texture using SetTexCoord. Now when the 0-1 texture coordinates suffer from precision errors, everything starts to shake. Surprisingly, though, text does NOT suffer much. Bottom line - use ScrollFrames for large images or blocks of text, but not for a large number of multi-textured relatively-positioned controls.

See also[edit]