DImageButton

From GMod Wiki

Revision as of 04:51, 15 November 2010 by Andriko (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Derma Control: DImageButton
Parent Class:DButton
Subclasses:
Description:
A button which uses an image instead of text.

Contents

Examples

DescriptionCreates a button with Dr Mossmans face on it.
Used onNewerClient.png
Code
// myParent = a Panel based object.
myButton = vgui.Create("DImageButton", myParent)
myButton:SetMaterial( "VGUI/entities/npc_mossman.vmt" )
myButton:SizeToContents()
myButton.DoClick = function()
        Msg("You clicked the button!\n")
    end
myButton.DoRightClick = function()
        Msg("You right-clicked the button!\n")
    end
 
Outputimagebuttonhq0.png


Methods

NewerClient.png DImageButton.GenerateExample
NewerClient.png DImageButton.GetImage
NewerClient.png DImageButton.Init
NewerClient.png DImageButton.OnMousePressed
NewerClient.png DImageButton.OnMouseReleased
NewerClient.png DImageButton.Paint
NewerClient.png DImageButton.PaintOver
NewerClient.png DImageButton.PerformLayout
NewerClient.png DImageButton.SetDisabled
NewerClient.png DImageButton.SetImage
NewerClient.png DImageButton.SetKeepAspect
NewerClient.png DImageButton.SetMaterial
NewerClient.png DImageButton.SizeToContents

Inherited from DButton

NewerClient.png DButton.SetDrawBackground
NewerClient.png DButton.GetSelected
NewerClient.png DButton.GetDrawBorder
NewerClient.png DButton.IsDown
NewerClient.png DButton.ApplySchemeSettings
NewerClient.png DButton.SetConsoleCommand
NewerClient.png DButton.DoRightClick
NewerClient.png DButton.SetSelected
NewerClient.png DButton.GetDrawBackground
NewerClient.png DButton.DoClick
NewerClient.png DButton.GetDisabled
NewerClient.png DButton.SetDrawBorder

Inherited from DLabel

NewerClient.png DLabel.OnCursorEntered
NewerClient.png DLabel.GetTextColorHovered
NewerClient.png DLabel.SetAutoStretchVertical
NewerClient.png DLabel.GetColor
NewerClient.png DLabel.SetTextColor
NewerClient.png DLabel.GetTextColor
NewerClient.png DLabel.SetTextColorHovered
NewerClient.png DLabel.GetAutoStretchVertical
NewerClient.png DLabel.OnCursorExited
NewerClient.png DLabel.SetColor

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox