feat: add AvatarNametag component (id 1221) - #467
Draft
popuz wants to merge 3 commits into
Draft
Conversation
Adds PBAvatarNametag component for scene-provided text labels above player nametags. Component is attached to player entities; labels are local-only and never relayed to other players. Co-Authored-By: Claude <noreply@anthropic.com>
Test this pull request on NPM or Yarn
|
out-ts/out-js bindings of the published package are generated from public/*.proto only, so without this import the package ships the proto without its TS binding. Co-Authored-By: Claude <noreply@anthropic.com>
Comment-only change: the component now documents resolving on any avatar-bearing entity - the local player, a player in the scene, or a scene-spawned avatar with an AvatarShape. The entity-id reuse warning is scoped to player entities, where it belongs. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
PBAvatarNametag— a plate with scene-provided text drawn above a player's native nametag. Immediate use case: player ranks in Clean The Club, which today are faked with a billboardedTextShapeon theNAME_TAGanchor by every scene that wants them.Single new file:
proto/decentraland/sdk/components/avatar_nametag.proto. Component id 1221 (verified free).Addressing
The component is attached to the player entity itself —
engine.PlayerEntityfor the local player,getPlayer({ userId }).entityfor anyone else. There is deliberately no target/userId field:engine.getEntitiesWith(PlayerIdentityData)), so a target field would be a round trip through a string and back;Player entity ids (32..255) are reused after a disconnect, so the comment also tells creators to resolve the entity on every write and to remove the component when the player leaves.
Colors
Both color fields are
Color3andoptional. TheAvatar*family isColor3throughout;Color4is the UI convention. Plate opacity is already driven by the client's distance fade, so a per-tag alpha would multiply with it. Omitting a color inherits the client's native nametag styling, which is why the defaults are worded semantically rather than as RGB literals — the nametag restyle is still in design and a literal here would propagate into generated docstrings.Field numbers 4–6 are left free for a later
show_background/opacity/ icon slot; underWIRE_JSONbreaking rules those are pure additions.No length limit
The protocol has no validation mechanism (no protovalidate, no PGV) and there is no precedent for stating a numeric cap. The visual limit already exists and is adaptive: the plate is single-line with
overflow: hiddenand an ellipsis. The comment describes the single-line behaviour rather than prescribing a transformation, so the client stays free to change how it handles a stray newline.public/sdk-components.protointentionally untouchedThat aggregate is not exhaustive — 19 components are missing from it, including all of 1209–1220 consecutively. Both consumers glob
decentraland/sdk/components/**/*.protodirectly (unity-explorer/scripts/src/build-protocol.ts,js-sdk-toolchain'scompileEcsComponents), so adding an import there would be cosmetic.Base
Opened against
experimentalrather thanmainbecause the consuming client (unity-explorer) pins experimental builds — a main-based tarball lackscommon/options.protoand the Pulse protos and would drop the Pulse bindings on codegen.🤖 Generated with Claude Code