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.

416 Part III ■ Advanced Addon TechniquesThe element should contain exactly one frame (or framederivative) that contains the contents <strong>of</strong> the scroll frame. This child frame canbe any size, but it will be visually clipped to the size <strong>of</strong> the element. As a matter <strong>of</strong> fact, the horizontal <strong>and</strong> vertical scroll ranges aredefined by the size <strong>of</strong> this child frame.Load the game <strong>and</strong> you should see an image in the center <strong>of</strong> your screensimilar to that shown in Figure 22-3.Figure 22-3: ScrollFrameTestManipulating a ScrollFrameLike any other specific type <strong>of</strong> frame, a ScrollFrame has different methods<strong>and</strong> h<strong>and</strong>ler scripts available. For example, the following methods can be usedon scroll frames:GetHorizontalScroll()—Returns the current scroll value <strong>of</strong> the horizontalscroll component.GetVerticalScroll()—Returns the current scroll value <strong>of</strong> the verticalscroll component.SetHorizontalScroll()—Sets the scroll value <strong>of</strong> the horizontal scrollcomponent.SetVerticalScroll()—Sets the scroll value <strong>of</strong> the vertical scroll component.GetHorizontalScrollRange()—Returns the maximum scroll range <strong>for</strong>the horizontal scroll component.

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

Saved successfully!

Ooh no, something went wrong!