Class FuncButton
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
func_button. A brush that slides in when pressed and, unless it is told to stay in, slides back out after wait seconds. Ported from Source's CBaseButton, movement included. Not simulated: the button sounds, health-driven damage activation, and the sparks.
public sealed class FuncButton : BaseToggleInheritance
object ← BaseEntity ← BaseModelEntity ← BaseToggle ← FuncButton
Inherited Members
BaseToggle.Speed, BaseToggle.Lip, BaseModelEntity.ModelNode, BaseEntity.Scene, BaseEntity.RootNode, BaseEntity.Transform, BaseEntity.LayerName, BaseEntity.EntitySystem, BaseEntity.Data, BaseEntity.Classname, BaseEntity.TargetName, BaseEntity.SpawnFlags, BaseEntity.ParentTransform, BaseEntity.Owner, BaseEntity.MoveParent, BaseEntity.EntityScale, BaseEntity.ModelName, BaseEntity.Origin, BaseEntity.Angles, BaseEntity.Velocity, BaseEntity.AngularVelocity, BaseEntity.NextThink, BaseEntity.MoveDoneTime, BaseEntity.IsRemoved, BaseEntity.Collider, BaseEntity.IsSolid, BaseEntity.IsTrigger, BaseEntity.IsDrawn, BaseEntity.InPlayableWorld, BaseEntity.IsCollidable, BaseEntity.TouchingEntities, BaseEntity.HasSpawnFlags<TSpawnFlags>(TSpawnFlags), BaseEntity.Spawn(), BaseEntity.Activate(), BaseEntity.Think(), BaseEntity.RoundStart(), BaseEntity.MoveDone(), BaseEntity.TryGetTouchBounds(out Vector3, out Vector3), BaseEntity.ObjectCaps, BaseEntity.Use(BaseEntity?), BaseEntity.Teleport(Vector3, Vector3?), BaseEntity.AcceptInput(string, EntityInputData), BaseEntity.SetNextThink(float), BaseEntity.SetMoveDoneTime(float), BaseEntity.GetSurfaceVelocity(Vector3), BaseEntity.AngleMod(float)
Constructors
FuncButton(EntitySystem, EntitySpawnInfo)
Initializes a func_button from its keyvalues.
public FuncButton(EntitySystem system, EntitySpawnInfo spawnInfo)Parameters
system EntitySystem
spawnInfo EntitySpawnInfo
Properties
IsDisabled
Gets whether the button has been switched off. A disabled button is not drawn, not solid, and not something a trace can find, so a pair of them can share a spot and take turns.
public bool IsDisabled { get; }Property Value
IsLocked
Gets whether the button refuses to press.
public bool IsLocked { get; }Property Value
ObjectCaps
Gets whether a player can press this button. A button that names no way of being activated at all is treated as use-activated: the flag values are Source 1's and the Source 2 games this renders are not confirmed to match, so the permissive reading keeps the button working rather than leaving it inert. A locked button is still usable, because refusing the press is what produces OnUseLocked.
public override EntityCapability ObjectCaps { get; }Property Value
State
Gets where the button is in its travel.
public FuncButton.ButtonState State { get; }Property Value
Wait
Gets the seconds the button stays in before returning; -1 means it stays in for good.
public float Wait { get; }Property Value
Methods
MoveDone()
Runs when comes due, after the tick's movement was applied.
public override void MoveDone()OnStartTouch(BaseEntity)
Runs on the tick other enters this entity's volume. Source's StartTouch.
protected override void OnStartTouch(BaseEntity other)Parameters
other BaseEntity
Spawn()
Sets up the entity: loads its model, reads class-specific keyvalues, and schedules its first think. Called by right after construction, before the entity enters the world.
public override void Spawn()Use(BaseEntity?)
Runs when something presses this entity. Source's CBaseEntity::Use, minus the use type and value, which nothing here distinguishes.
public override void Use(BaseEntity? activator)Parameters
activator BaseEntity?

