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.

Chapter 29 ■ Widget <strong>Reference</strong> 1143Texture loading is normally synchronous, so that UI objects are not shownpartially textured while loading; however, non-blocking (asynchronous)texture loading may be desirable in some cases where large numbers <strong>of</strong> texturesneed to be loaded in a short time. This feature is used in the default UI’sicon chooser window <strong>for</strong> macros <strong>and</strong> equipment sets, allowing a large number<strong>of</strong> icon textures to be loaded without causing the game’s frame rate to stagger.Arguments:nonBlocking—True to allow the texture object to load its imagefile in the background; false (default) to halt the game enginewhile the texture loads (boolean)SetRotationRotates the texture image.Texture:SetRotation(radians)This is an efficient shorth<strong>and</strong> <strong>for</strong> the more complex Texture:SetTexCoord().Arguments:radians—Amount by which the texture image should be rotated (in radians;positive values <strong>for</strong> counter-clockwise rotation, negative <strong>for</strong> clockwise) (number)SetTexCoordSets corner coordinates <strong>for</strong> scaling or cropping the texture image.Texture:SetTexCoord(left, right, top, bottom) or iTexture:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy)See example <strong>for</strong> details.Arguments:left—Left edge <strong>of</strong> the scaled/cropped image, as a fraction <strong>of</strong> the image’s widthfrom the left (number)right—Right edge <strong>of</strong> the scaled/cropped image, as a fraction <strong>of</strong> the image’swidth from the left (number)top—Top edge <strong>of</strong> the scaled/cropped image, as a fraction <strong>of</strong> the image’s heightfrom the top (number)bottom—Bottom edge <strong>of</strong> the scaled/cropped image, as a fraction <strong>of</strong> the image’sheight from the top (number)ULx—Upper left corner X position, as a fraction <strong>of</strong> the image’s width from theleft (number)ULy—Upper left corner Y position, as a fraction <strong>of</strong> the image’s height from thetop (number)LLx—Lower left corner X position, as a fraction <strong>of</strong> the image’s width from theleft (number)LLy—Lower left corner Y position, as a fraction <strong>of</strong> the image’s height from thetop (number)URx—Upper right corner X position, as a fraction <strong>of</strong> the image’s width from theleft (number)

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

Saved successfully!

Ooh no, something went wrong!