View Single Post
03-14-18, 02:20 AM   #3
bryde
A Defias Bandit
Join Date: Mar 2018
Posts: 3
Thanks for the quick answer. Like I said, I'm not actively working on a project so the variable names were just chosen for easy identification.
Sadly however it's still doing what I don't want it to do

I adjusted your code to create a colortexture in the child frame and the texture is still overflowing, using all the 800x800 instead of the 400x400 window created by it's parent:

Lua Code:
  1. local MyFrame = CreateFrame("Frame", nil, UIParent)
  2. MyFrame:SetSize(400, 400)
  3. MyFrame:SetPoint("CENTER", UIParent)
  4.  
  5. local MyFrameChild = CreateFrame("Frame", nil, MyFrame)
  6. MyFrameChild:SetSize(800, 800)
  7. MyFrameChild:SetPoint("CENTER", MyFrame)
  8.  
  9. MyFrameChild.Texture = MyFrameChild:CreateTexture()
  10. MyFrameChild.Texture:SetAllPoints()
  11. MyFrameChild.Texture:SetColorTexture(1,1,1)

As mentioned, fills the 800x800 (and that's perfect), but I only want it to render the 400x400px of the parent. The idea being that the full 800x800 texture is loaded into cache but only the 400x400 part is visible/rendered.
  Reply With Quote