Spawnicon:OnCursorEntered

From GMod Wiki

Jump to: navigation, search
Function
Syntax Spawnicon:OnCursorEntered( Integer enum )
Description:
When the mouse enters the icons button area
Returns: nil
In Object: SpawnIcon
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Spawnicon:OnCursorEntered]Spawnicon:OnCursorEntered [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionRemoves the frame that displays, when you hover the icon, and display a message
Used onNewerClient.png
Code
 
local Frame = vgui.Create("DFrame") --Let's create a nice frame
Frame:SetPos(20, 20)
Frame:SetSize(100, 100)
Frame:SetVisible(true)
Frame:SetDraggable(true)
Frame:ShowCloseButton (true )
 
local Icon = vgui.Create("SpawnIcon", Frame) --Create the icon
Icon:SetPos(20, 20) 
Icon:SetModel("models/Combine_Helicopter/helicopter_bomb01.mdl")
Icon.OnCursorEntered = function()--This is the function to use. 
    print("We're hovering the icon")--Print a message to the console
    return false --Return false to remove the hovereffect
end
 
 
OutputCreates a nice frame with a spawnicon inside of it.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox