s&
newspaperAbout
infoAbout s&box newspaperLatest News published_with_changesChanges mapRoadmap monitoringMetrics
gamesGames
sports_esportsBrowse Games rocketDiscover Games
business_centerWorkshop
sports_esportsGames landscapeMaps chairModels textureMaterials apparelClothing constructionMore..
forumForum docsDocs
docsDocumentation dashboardApi Reference schoolTutorials
inputLog in with Steam chevron_leftChange Language
简体中文EnglishРусскийEspañolPortuguês-BrasilDeutsch日本語FrançaisPolskiTürkçe한국어PirateItalianoไทย繁體中文УкраїнськаČeštinaNederlandsMagyarDanskSuomiSvenskaNorskΕλληνικάRomânăБългарскиTiếng ViệtBahasa IndonesiaEspañol-Latinoaméricaالعربية
Api
IPressable
chevron_left API Reference
interface
IPressable

Methods

functionsBlurfunctionsCanPressfunctionsGetTooltipfunctionsHoverfunctionsLookfunctionsPressfunctionsPressingfunctionsRelease
IPressable
A component that can be pressed. Like a button. This could be by a player USE'ing it, or by a player walking on it, or by an NPC. A call to Press should ALWAYS call release afterwards. Generally this is done by the player, where holding E presses the button, and releasing E stops pressing it. You need to handle edge cases where the player dies while holding etc.
interface Sandbox.Component .
abstractSandbox.Engine

functions Methods 8

Blur (e)
A player has stopped looking at this
CanPress (e)
bool
Return true if the press is possible right now
GetTooltip (e)
Nullable`1
Get a tooltip to show when looking at this pressable
Hover (e)
A player has started looking at this
Look (e)
A player is still looking at this. Called every frame.
Press (e)
bool
Pressed. Returns true on success, else false. If it returns true then you should call Release when the press finishes. Not everything expects it, but some stuff will.
Pressing (e)
bool
Still being pressed. Return true to allow the press to continue, false cancel the press
Release (e)
To be called when the press finishes. You should only call this after a successful press - ie when Press hass returned true.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter