RSS

Воскресенье, 22.12.2024, 07:20
Главная » WoW API » API Виджеты » Текстура »

Texture:SetTexCoord(left, right, top, bottom) or Texture:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy)

[ править ]
Sets corner coordinates for scaling or cropping the texture image.
[клоны]
Sets corner coordinates for scaling or cropping the texture image. See example for details.


Signature:
Code
Texture:SetTexCoord(left, right, top, bottom) or Texture:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy)

Arguments:
  • left - Left edge of the scaled/cropped image, as a fraction of the image's width from the left (number)
  • right - Right edge of the scaled/cropped image, as a fraction of the image's width from the left (number)
  • top - Top edge of the scaled/cropped image, as a fraction of the image's height from the top (number)
  • bottom - Bottom edge of the scaled/cropped image, as a fraction of the image's height from the top (number)
  • ULx - Upper left corner X position, as a fraction of the image's width from the left (number)
  • ULy - Upper left corner Y position, as a fraction of the image's height from the top (number)
  • LLx - Lower left corner X position, as a fraction of the image's width from the left (number)
  • LLy - Lower left corner Y position, as a fraction of the image's height from the top (number)
  • URx - Upper right corner X position, as a fraction of the image's width from the left (number)
  • URy - Upper right corner Y position, as a fraction of the image's height from the top (number)
  • LRx - Lower right corner X position, as a fraction of the image's width from the left (number)
  • LRy - Lower right corner Y position, as a fraction of the image's height from the top (number)

Examples:
-- create a frame and texture to show the class icons
-- this image includes the icons of all player classes, arranged in a 4x4 grid
CreateFrame("Frame","Test",UIParent)
Test:SetWidth(100)
Test:SetHeight(100)
Test:SetPoint("CENTER",0,0)
Test:CreateTexture("TestTexture")
TestTexture:SetAllPoints()
TestTexture:SetTexture("Interface\Glues\CharacterCreate\UI-CharacterCreate-Classes")

-- the warrior icon is in the top of this 4x4 grid, so its dimensions are 1/4 those of the texture image
-- scales up the warrior class icon to fill the 100x100 frame
TestTexture:SetTexCoord(0, 0.25, 0, 0.25)

Также смотрите: Текстура
Ссылки: http://wowprogramming.com/docs/widgets/Texture/SetTexCoord