DBubbleContainer/OpenForPos

From Garry's Mod
Jump to: navigation, search
 DBubbleContainer:OpenForPos( )

Contents

DescriptionPanelFunc

Sets the speech bubble position and size along with the dialog point position.

Arguments

number x

The x position of the dialog point. If this is set to a value greater than half of the set width, the entire bubble container will be moved in addition to the dialog point.

Arguments

number y

The y position of the bubble container. Has no effect unless set to a value greater than the set height + 64 pixels.

Arguments

number w

The width of the bubble container.

Arguments

number h

The height of the bubble container.

Examples

Example

Creates a bubble container that properly fits a 200x200 background panel.

-- Length and width of background panel
local size = 200
		
-- Background panel
BGPanel = vgui.Create("DPanel")
BGPanel:SetSize(size, size)
BGPanel:Center()


local bubble1 = vgui.Create("DBubbleContainer", BGPanel)

-- x = 100 (Set pointer in the middle of the speech bubble)
-- y = 0 (Don't adjust height)
-- w = 180 (20 pixel right margin)
-- h = 184 (16 pixel bottom margin)
bubble1:OpenForPos(size/2, 0, size-20, size-16)

Output:



DBubbleContainer OpenForPos example1.jpg
Personal tools
Navigation