Garry's Mod Wiki

Garry's Mod Wiki

  DLabel:DoRightClick()

Description

Called when the label is right clicked (on key release) by the player.

This will be called after DLabel:OnDepressed and DLabel:OnReleased.

See also DLabel:DoClick, DLabel:DoMiddleClick and DLabel:DoDoubleClick.

Example

Creates a label in the center of the screen, that prints I was right clicked! to the console and disappears when right clicked.

local lbl = vgui.Create( "DLabel" ) lbl:SetFont( "DermaLarge" ) lbl:SetText( "Click me!" ) lbl:SizeToContents() lbl:Center() lbl:SetMouseInputEnabled( true ) function lbl:DoRightClick() print("I was right clicked!") self:Remove() end
Output:
I was clicked!

When the label is right clicked.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...