Thread Tools Display Modes
06/12/14, 10:44 AM   #1
Dero
 
Dero's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 14
Masking a Window

Hey there.

Ive got a Question regarding the WINDOW_MANAGER.

Is it possible to not show things like texts/textures outside the regular borders?

Example:
Code:
MyFrame = WINDOW_MANAGER:CreateTopLevelWindow("Frame")
MyFrame:SetDrawLayer(1)
MyFrame:SetAnchor(TOPRIGHT,GuiRoot,TOPRIGHT,0,0)
MyFrame:SetDimensions(100,100)
MyFrame:SetShapeType(1)
MyFrameBG = WINDOW_MANAGER:CreateControlFromVirtual("MyFrameBG",Frame,"ZO_DefaultBackdrop")

MyText = WINDOW_MANAGER:CreateControl("MyText",Frame,CT_LABEL)
MyText:SetText("This text should only display 'This te'")
MyText:SetFont("ZoFontTooltipTitle")
MyText:SetAnchor(TOPLEFT,Frame,TOPLEFT,50,50)
This would be really helpful to create some kind of masks for things
  Reply With Quote
06/12/14, 11:39 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Did you try to set dimensions?
Lua Code:
  1. MyText:SetDimensions(width, height)
  2. --or just width:
  3. MyText:SetWidth(width)
or dimension constraints:
Lua Code:
  1. MyText:SetDimensionConstraints(minWidth, minHeight, maxWidth, maxHeight)
  Reply With Quote
06/12/14, 11:39 AM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
You need to use a scroll frame for this. This is their purpose.
  Reply With Quote
06/12/14, 01:04 PM   #4
Dero
 
Dero's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 14
Did you try to set dimensions?
That doesnt helps me with textures and also not with texts if i've a round Frame.

You need to use a scroll frame for this. This is their purpose.
Got any example for a scrolls frame?
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Masking a Window


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