codeAPI Reference
s&box IKillIcon: Kill feed icon interface
IKillIcon API Reference
IKillIcon is an interface for components that can display a kill icon in the kill feed or other UI elements.
Type Signature
CSHARP
public interface IKillIcon
{
Texture DisplayIcon { get; set; }
}Property
- Texture DisplayIcon { get; set; } - The icon texture to display when this component appears in the kill feed.
Usage
Implement this interface on any Component that should have a custom kill feed icon:
CSHARP
public class MyExplosiveBarrel : Component, IKillSource, IKillIcon
{
[Property] public Texture KillIcon { get; set; }
public Texture DisplayIcon
{
get => KillIcon;
set => KillIcon = value;
}
public string GetKillIconName()
{
return "explosive_barrel";
}
}Notes
- Used by the kill feed system to determine which icon to show for a kill.
- The kill feed queries IKillIcon on the attacker (IKillSource) to get the display icon.
- If not implemented, the kill feed uses a default icon.
- Texture should be a valid asset path or loaded texture resource.
Was this helpful?