Thread Tools Display Modes
07-02-21, 03:50 AM   #1
SegFault
A Defias Bandit
Join Date: Jun 2021
Posts: 3
Originally Posted by Fizzlemizz View Post
If you just want a coloured square, it might be easier to use a texture:
Lua Code:
  1. local p = CreateFrame("Frame", nil, UIParent)
  2. p:SetWidth(100)
  3. p:SetHeight(100)
  4. p:SetPoint("TOPLEFT", 100, -100)
  5. p.Texture = p:CreateTexture()
  6. p.Texture:SetAllPoints()
  7. p.Texture:SetColorTexture(1, 0, 0)
UIParent is the frame that hides when you Alt-Z. Using that as the parent of your top level frame(s) will hide all your frames also.
Thank you very much, I ended up doing this.

Although I didn't call SetAllPoints. What does it do? It seems to work fine without that call.
  Reply With Quote
07-02-21, 07:37 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,906
Originally Posted by SegFault View Post
What does it do?
It anchors the texture to the same points as the parent frame. The same as

Lua Code:
  1. p.Texture:SetPoint("TOPLEFT", p)
  2. p.Texture:SetPoint("BOTTOMRIGHT", p)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 07-02-21 at 08:54 AM.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Drawing a square (basic noob question)


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off