Description
A transparent gray speech bubble panel made up of a rounded box and point coming from the bottom.
View source
Parent
Derives methods, etc not listed on this page from DPanel.
Methods
Sets the speech bubble position and size along with the dialog point position.
Example
Creates a bubble container panel in the middle of the screen. The background DPanel is used to allow better control of the dialog point position.
Example
Creates a panel with Bill from Left 4 Dead talking through a speech bubble.
local dimg
= vgui.
Create(
"DImage")
dimg:
SetPos(
0,
ScrH()
-512)
dimg:
SetImage(
"spawnicons/models/survivors/survivor_namvet_128.png")
dimg:
SizeToContents()
local dimg_x, dimg_y
= dimg:
GetPos()
local dimg_w, dimg_h
= dimg:
GetSize()
dimg_x
= dimg_x
+ dimg_w
/2
dimg_y
= dimg_y
+ dimg_h
/2.5
local bubble_w, bubble_h
= 150,
100
local bubble
= vgui.
Create(
"DBubbleContainer")
bubble:
OpenForPos(dimg_x, dimg_y
+bubble_h
-32, bubble_w, bubble_h)
local lbl
= vgui.
Create(
"DLabel", bubble)
lbl:
SetPos(
5,
5)
lbl:
SetSize(
150,
50)
lbl:
SetWrap(
true)
lbl:
SetFont(
"GModNotify")
lbl:
SetText(
"Does this example get the point across?")
lbl:
SetDark(
true)
Output: