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.

1144 Part IV ■ <strong>Reference</strong>URy—Upper right corner Y position, as a fraction <strong>of</strong> the image’s height from thetop (number)LRx—Lower right corner X position, as a fraction <strong>of</strong> the image’s width from theleft (number)LRy—Lower right corner Y position, as a fraction <strong>of</strong> the image’s height from thetop (number)Example:-- create a frame <strong>and</strong> texture to show the class icons-- this image includes the icons <strong>of</strong> all player classes, arranged-- in a 4x4 gridCreateFrame(“Frame“,“Test“,UIParent)Test:SetWidth(100)Test:SetHeight(100)Test:SetPoint(“CENTER“,0,0)Test:CreateTexture(“TestTexture“)TestTexture:SetAllPoints()TestTexture:SetTexture(“Interface\\Glues\\CharacterCreate\\iUI-CharacterCreate-Classes“)-- the warrior icon is in the top <strong>of</strong> this 4x4 grid, so its dimensions-- are 1/4 those <strong>of</strong> the texture image-- scales up the warrior class icon to fill the 100x100 frameTestTexture:SetTexCoord(0, 0.25, 0, 0.25)SetTexCoordModifiesRectSets whether modifying texture coordinates scales or crops the texture image.Texture:SetTexCoordModifiesRect(modifiesRect)See example <strong>for</strong> details.Arguments:modifiesRect—True to cause future Texture:SetTexCoord() operationsto crop the on-screen texture image; false to cause SetTexCoord to scale theimage (boolean)Example:-- create a frame <strong>and</strong> texture to show the class iconsCreateFrame(“Frame“,“Test“,UIParent)Test:SetWidth(100)Test:SetHeight(100)Test:SetPoint(“CENTER“,0,0)Test:CreateTexture(“TestTexture“)TestTexture:SetAllPoints()TestTexture:SetTexture(“Interface\\Glues\\CharacterCreate\\iUI-CharacterCreate-Classes“)-- with ModifiesRect enabled, SetTexCoord crops to show only the-- warrior icon at its existing sizeTestTexture:SetTexCoordModifiesRect(true)TestTexture:SetTexCoord(0, 0.25, 0, 0.25)

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

Saved successfully!

Ooh no, something went wrong!