Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API GetUnscaledFrameRect

Last wiki revision 2022-10-23

Extends to return position and size from the lower-left screen corner in any arbitrary coordinate system. left, bottom, width, height = GetUnscaledScaledRect(frame, scale)

  • frame : Region - A region positioned somewhere on the screen
  • scale : Number - Size of the arbitrary coordinate system, divided into Region:GetScaledRect

The following returns only apply if the region has a defined position and size (nil otherwise).

  • left : Number - Distance between the region and left edge of the screen (negative values are beyond the screen edge)
  • bottom : Number - Distance between the region and bottom edge of the screen (negative values are beyond the screen edge)
  • width : Number - Width between the region's left and right edges
  • height : Number - Height between the region's bototm and top edges
  • Despite the name, this function will work with any Region and not merely its Frame subtype.
  • This function is useful to determine the position of one frame relative to the coordinate system of another

The example below shows the difference of GetRect, GetScaledRect and GetUnscaledFrameRect using a tiny 1x1 box a short distance from the lower-left corner of the screen local myFrame = CreateFrame("Frame") -- a frame is a type of region myFrame:SetScale(2) -- the frame's coordinate system is 2x larger myFrame:SetPoint("BOTTOMLEFT", 100, 100) myFrame:SetSize(1,1) print(myFrame:GetRect) -- 100, 100, 1, 1 print(myFrame:GetScaledRect) -- 200, 200, 2, 2 print(GetUnscaledFrameRect(myFrame, 4)) -- 50, 50, 0.5, 0.5

  • - Returns the scale in a region's own coordinate system (scale = GetEffectiveScale)
  • - Returns the scale in a standardized coordinate system (scale = 1)

Source

https://warcraft.wiki.gg/wiki/API_GetUnscaledFrameRect · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.