WoW:API Texture SetTexCoord: Difference between revisions

m
no edit summary
No edit summary
mNo edit summary
Line 5: Line 5:
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
  obj:SetTexCoord(left,right,top,bottom);
  obj:SetTexCoord(left,right,top,bottom);
obj:SetTexCoord(ULx,ULy,LLx,LLy,URx,URy,LRx,LRy);


== Parameters ==
== Parameters ==
Line 10: Line 11:
:(left,right,top,bottom)
:(left,right,top,bottom)
: Number - (range: 0-1)
: Number - (range: 0-1)
:(ULx,ULy,LLx,LLy,URx,URy,LRx,LRy);
: Number - (range: 0-1)


== Note ==
== Note ==
:The function cut a sub-region,use the new TopLeftPoint is (left,top),new BottomRight is (right,bottom),so you can use the function to rotate the texture or sub-region
:The function cut a sub-region,use the new TopLeftPoint is (left,top),new BottomRight is (right,bottom),so you can use the function to rotate the texture or sub-region.  The more complex 8-argument form allows for arbitrary affine transformations, see [[SetTexCoord Transformations]] for details.
== Example ==
== Example ==
  getglobal("MyAddOnTexture" .. id):SetTexCoord(0, 0.5, 0.5, 1);
  getglobal("MyAddOnTexture" .. id):SetTexCoord(0, 0.5, 0.5, 1);
Anonymous user