Quantcast
WoWInterface - View Single Post - How to use LineMixin?
View Single Post
05-02-18, 03:01 PM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,460
Thought I had found it .. but nada ..

It's in the taxi map frame. It looks like they have the code part there but it's not exactly the same, but maybe you have to have a Line object as well as a texture object .. but this is just theorising from browsing through those files.

https://www.townlong-yak.com/framexm...taProvider.xml

This xml line being what I suspect you have to use

<Line parentKey="Fill" atlas="_UI-Taxi-Line-horizontal" alpha="0" alphaMode="ADD" />


Will test it out and see



Edit: Yes thats it ..

In my xml file I have this and for simplicity I threw the code in here too

Code:
<UI>
    
        <Frame name="DraggingFrame" inherits = "DraggableFrameTemplate, TooltipTemplate"   parent="UIParent" frameStrata="LOW">
		<Size x="200" y="300"/>
  		<Anchors>
			<Anchor point="CENTER" x = "150" y = "100" />
		</Anchors>
               
        <Layers>
            <Layer level="BACKGROUND">
                <Texture parentKey="Background" > 
                    <Anchors>
                        <Anchor point="TOPLEFT" x = "1" y = "-1"/>
                        <Anchor point="BOTTOMRIGHT" x = "-1" y = "1"/>
                    </Anchors>
                </Texture>
            </Layer>       
            <Layer level="BACKGROUND" textureSubLevel="-2">
                <Line parentKey="Fill" atlas="_UI-Taxi-Line-horizontal" alpha="1" />
            </Layer>            
        </Layers>
        
        <Scripts>
            <OnLoad>
                self:RegisterForDrag("LeftButton")
                self.Fill.line = CreateFromMixins(LineMixin)
                self.Fill.line:SetStartPoint(10,10)
                self.Fill.line:SetEndPoint(20,20)
                self.Fill.line:SetThickness(100)
            </OnLoad> 
       </Scripts>
    </Frame>

</UI>
This draws a line from the top left to the bottom right



Edit2: Grr nevermind .. this is just using the Line's natural drawing mechanism and not the drawline function at all .. as soon as I add that function I get a can't get parent problem, so maybe it's not ready to be used in its entirety yet.
__________________

Last edited by Xrystal : 05-02-18 at 03:14 PM.
  Reply With Quote