s&
About
The Project
infoAbout s&box mapRoadmap monitoringMetricsEngine startup and usage numbers
Updates
newspaperLatest News published_with_changesChangesRelease-by-release changelog
Games
Browse Games Discover Games
gamejamslive now

Game Jam III

Ends Fri 25 Sep
ThemeOne More Round

The jam is running. Build something, or play the entries.

£50,000
prizepool
View the jam
Workshop
Playable
sports_esportsGamesStandalone games and gamemodes
Assets
landscapeMaps view_in_arModels textureMaterials apparelClothing
appsEverythingEvery asset type in one list
Forum
Learn
Documentation
rocket_launchGetting Started docsDocumentation apiAPI Reference
Resources
schoolTutorials manage_searchCode Search
inputLog in with Steam
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.
Facepunch
  • News
  • Docs
  • Metrics
  • FAQ
  • Forum
  • Discord
  • Twitter