Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
WoW
Talk
English
Views
Read
Edit
History
More
Search
Navigation
Home
Random page
Help using wiki
Editions
for WoW
for WildStar
for Solar2D
Documentation
for WoW
for WildStar
Reference
WoW
⦁ FrameXML
⦁ AddOns
⦁ API
⦁ WoW Lua
WildStar
⦁ AddOns
⦁ API
⦁ WildStar Lua
Engine
Tools
What links here
Related changes
Special pages
Page information
Site
Recent Changes
Editing
WoW:SetTexCoord Transformations
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Basic concepts == Before wading too far into the Texture waters, it's best to begin with some basic concepts: === Screen coordinates === The screen refers to what the player sees. It may go by various different names in some graphics systems (canvas, surface, etc.) but here we'll just call it the screen. The term ''Screen Coordinates'' is used to specify a point in the screen. In World of Warcraft the origin of the screen coordinates is at the lower left corner. === Texture coordinates === A Texture frame is used to display all or part of an image. It has an arbitrary location, size, and scale, and appears as a rectangular area on the screen with vertical and horizontal edges, just like any other frame. We'll use the term ''Texture Coordinates'' to refer to a location within the frame, where (0,0) is the lower left corner, (1,0) is the lower right corner, (0,1) is the upper left corner, and (1,1) is the upper right corner. "Texture" will always have an initial capital, for consistency with the name of the frame type in the API. Each screen coordinate within the bounds of the Texture on screen can be mapped into a Texture frame coordinate within the box from (0,0) to (1,1). === Image coordinates === Texture frame elements contain images. These are generally loaded from image files located by file paths. The World of Warcraft user interface engine handles different sizes of images: the length of each side is always a power of two (64 x 64, 256 x 256, 512 x 128, etc.). We will use the term ''Image Coordinates'' to refer to locations within the contents of the image rectangle. The corners are (0,0) for the upper left, (1,0) for the upper right, (0,1) for the lower left, and (1,1) for the lower right. '''Notice that the image origin is at the <u>upper left</u>, whereas screen and texture frame origins are at the <u>lower left</u>.''' It is quite possible that a pixel logically outside the image rectangle is visible in the texture frame. To allow for this, the coordinate box from (0,0) to (1,1) containing the entire image is imagined to be extended over an infinite canvas by repeating indefinitely the first and last pixels on each row and column. This will usually give the desired effect, as the pixels at the edge are generally set to the image background colour. === An analogy === Think of the image as a sheet of infinitely flexible rubber, with a faint set of grid lines rules on it. There's an origin, and coordinates, and the contents of the image file is printed onto the rubber between (0,0) an (1,1) and extends as far as you want in each direction. Think of the Texture frame as a rigid rectangular frame, with an attachment point at each of the four corners. The rubber image sheet is attached to each corner of the frame, and stretches between these points. Anything outside the edge of the frame can be ignored; what's within the edges of the frame is what you see on screen. The SetTexCoord method is used to provide the image coordinates of each of these four corner points.
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)