m
→Note
(Changed origin from bottom left to top left) |
m (→Note) |
||
| Line 18: | Line 18: | ||
== Note == | == Note == | ||
:The function | :The function cuts a sub-region out of the texture to display ingame. | ||
:*Unless you want to do rotations, use the ''(left,right,top,bottom)'' notation. | |||
:*The more complex 8-argument form allows for arbitrary affine transformations, see [[SetTexCoord Transformations]] for details.<BR>Basically the four points you specify still have to form a rectangle, but you can rotate and place it more freely.<BR>Experience with matrices is recommended since they can help you find the final coordinates of your points. | |||
:The example below cuts out the lower left quarter of the texture file. | |||
== Example == | == Example == | ||
getglobal("MyAddOnTexture" .. id):SetTexCoord(0, 0.5, 0.5, 1); | getglobal("MyAddOnTexture" .. id):SetTexCoord(0, 0.5, 0.5, 1); | ||