VGUI Grid: Difference between revisions
Jump to navigation
Jump to search
(New page: {{stub}} VGUI Grid is a vgui2 control. In Episodic mods, it is defined in src\cl_dll\vgui_grid.cpp. Grid is used to group multiple control panels into a grid of control panels. == Exampl...) |
mNo edit summary |
||
Line 32: | Line 32: | ||
img->SetVisible(true); | img->SetVisible(true); | ||
pGrid->SetEntry(0,0,img); | |||
Note: Despite doing all of the above, I haven't been able to get this control to work. --[[User:Ring2ding|Ring2ding]] 18:26, 8 June 2009 (UTC) | Note: Despite doing all of the above, I haven't been able to get this control to work. --[[User:Ring2ding|Ring2ding]] 18:26, 8 June 2009 (UTC) |
Revision as of 11:28, 8 June 2009
VGUI Grid is a vgui2 control. In Episodic mods, it is defined in src\cl_dll\vgui_grid.cpp. Grid is used to group multiple control panels into a grid of control panels.
Example Usage
Before creating anything, we first need to include the header file and use the vgui namespace:
//(Episodic only) #include "vgui_grid.h"
using namespace vgui;
Grids can be created via the c++ keyword new with a simple call to CGrid:
CGrid* pGrid = new CGrid();
Once created, we now need to configure it:
pGrid->SetDimensions(5,5); //columns, rows pGrid->SetSpacing(10,10); //xSpacing, ySpacing pGrid->SetPos(100,100); pGrid->SetVisible(true);
Now we can add control elements to it, for this example we'll use an ImagePanel.
ImagePanel* img = new ImagePanel(this, "img"); img->SetImage(scheme()->GetImage("vgui/eye", false)); img->SetVisible(true); pGrid->SetEntry(0,0,img);
Note: Despite doing all of the above, I haven't been able to get this control to work. --Ring2ding 18:26, 8 June 2009 (UTC)