@indiegems/gem-web-sdk 10.3.1 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  # The browser surface — API reference
2
2
 
3
- Generated from `@indiegems/gem-web-sdk/sdk` v10.3.1, the version of the package this file ships in. Every symbol below carries an explicit anchor, its `anchor` in `reference.json` beside this file.
3
+ Generated from `@indiegems/gem-web-sdk/sdk` v11.0.0, the version of the package this file ships in. Every symbol below carries an explicit anchor, its `anchor` in `reference.json` beside this file.
4
4
 
5
5
  `@indiegems/gem-web-sdk/sdk` is the one import a game writes, wherever its code runs. `@indiegems/gem-web-sdk/game` exports exactly the symbols on this page and nothing else, for a build that wants only this half.
6
6
 
@@ -5639,15 +5639,22 @@ arcade that handles share.
5639
5639
  ## GemFrame.requestAvatarPicker
5640
5640
 
5641
5641
  ```ts
5642
- requestAvatarPicker(): boolean
5642
+ requestAvatarPicker(tab?: "2d" | "3d"): boolean
5643
5643
  ```
5644
5644
 
5645
5645
  Ask the arcade to open its own avatar picker over your game. Nothing comes
5646
- back: a changed portrait arrives as a new `gem.player`, through `onPlayer`.
5646
+ back: a changed portrait or 3D character arrives as a new `gem.player`,
5647
+ through `onPlayer`.
5647
5648
 
5648
5649
  Prefer `gem.openAvatarPicker`, which documents what a game does with the
5649
5650
  change.
5650
5651
 
5652
+ | Parameter | Type | Description |
5653
+ | --- | --- | --- |
5654
+ | `tab` | `"2d" \| "3d"` | Which tab to open on — `'2d'` (the portrait) or `'3d'` (the 3D
5655
+ character). Omit it to let the arcade decide. Anything else is treated as
5656
+ omitted. An arcade older than the tabs ignores it. |
5657
+
5651
5658
  **Returns.** whether the message left the frame — `false` before the bridge is
5652
5659
  up, for an arcade that has no avatar picker here, and past this frame's
5653
5660
  own limit of six a minute.
@@ -5803,6 +5810,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
5803
5810
  draw your own placeholder rather than a broken image. Pass it through
5804
5811
  [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
5805
5812
 
5813
+ <a id="friend-avatar3did"></a>
5814
+
5815
+ ## Friend.avatar3dId
5816
+
5817
+ ```ts
5818
+ readonly avatar3dId?: string
5819
+ ```
5820
+
5821
+ The id of the 3D character the player wears, when they wear one — an
5822
+ Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
5823
+ avatar picker. What a game that draws Arcade avatars keys its character
5824
+ on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
5825
+ to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
5826
+ absent.
5827
+
5828
+ Independent of the portrait: wearing a 3D character never changes
5829
+ `avatarIconId`, and the other way round. Absent means the game's default
5830
+ look. On `gem.player` it changes when the player wears another one, and
5831
+ `onPlayer` runs again; see `gem.openAvatarPicker`.
5832
+
5833
+ <a id="friend-avatar3dmodelurl"></a>
5834
+
5835
+ ## Friend.avatar3dModelUrl
5836
+
5837
+ ```ts
5838
+ readonly avatar3dModelUrl?: string
5839
+ ```
5840
+
5841
+ The worn 3D character's model — a binary glTF (`.glb`) with one rig,
5842
+ `root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
5843
+ possibly animation clips. Load it with three.js's `GLTFLoader`, after
5844
+ passing it through [platformIconUrl](#platformiconurl), which pins models to the
5845
+ platform's item host exactly as it pins pictures. Absent when no 3D
5846
+ character is worn.
5847
+
5848
+ <a id="friend-avatar3diconurl"></a>
5849
+
5850
+ ## Friend.avatar3dIconUrl
5851
+
5852
+ ```ts
5853
+ readonly avatar3dIconUrl?: string
5854
+ ```
5855
+
5856
+ A rendered portrait of the worn 3D character, for a roster or a menu where
5857
+ loading the model is too much. Not the 2D portrait
5858
+ ([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
5859
+ through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
5860
+
5806
5861
  <a id="friend-badges"></a>
5807
5862
 
5808
5863
  ## Friend.badges
@@ -7611,6 +7666,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
7611
7666
  draw your own placeholder rather than a broken image. Pass it through
7612
7667
  [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
7613
7668
 
7669
+ <a id="gemplayer-avatar3did"></a>
7670
+
7671
+ ## GemPlayer.avatar3dId
7672
+
7673
+ ```ts
7674
+ readonly avatar3dId?: string
7675
+ ```
7676
+
7677
+ The id of the 3D character the player wears, when they wear one — an
7678
+ Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
7679
+ avatar picker. What a game that draws Arcade avatars keys its character
7680
+ on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
7681
+ to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
7682
+ absent.
7683
+
7684
+ Independent of the portrait: wearing a 3D character never changes
7685
+ `avatarIconId`, and the other way round. Absent means the game's default
7686
+ look. On `gem.player` it changes when the player wears another one, and
7687
+ `onPlayer` runs again; see `gem.openAvatarPicker`.
7688
+
7689
+ <a id="gemplayer-avatar3dmodelurl"></a>
7690
+
7691
+ ## GemPlayer.avatar3dModelUrl
7692
+
7693
+ ```ts
7694
+ readonly avatar3dModelUrl?: string
7695
+ ```
7696
+
7697
+ The worn 3D character's model — a binary glTF (`.glb`) with one rig,
7698
+ `root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
7699
+ possibly animation clips. Load it with three.js's `GLTFLoader`, after
7700
+ passing it through [platformIconUrl](#platformiconurl), which pins models to the
7701
+ platform's item host exactly as it pins pictures. Absent when no 3D
7702
+ character is worn.
7703
+
7704
+ <a id="gemplayer-avatar3diconurl"></a>
7705
+
7706
+ ## GemPlayer.avatar3dIconUrl
7707
+
7708
+ ```ts
7709
+ readonly avatar3dIconUrl?: string
7710
+ ```
7711
+
7712
+ A rendered portrait of the worn 3D character, for a roster or a menu where
7713
+ loading the model is too much. Not the 2D portrait
7714
+ ([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
7715
+ through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
7716
+
7614
7717
  <a id="gemplayer-badges"></a>
7615
7718
 
7616
7719
  ## GemPlayer.badges
@@ -7704,9 +7807,10 @@ readonly recommended: GemRecommendedSettings | null
7704
7807
  ```
7705
7808
 
7706
7809
  The player's Arcade-wide defaults for this device — a volume, battery
7707
- saver, a keyboard layout, the gamepad's confirm button, vibration, and the
7810
+ saver, a keyboard layout, the gamepad's confirm button, vibration, the
7708
7811
  camera and controls settings (look sensitivity, gamepad look sensitivity,
7709
- invert look, touch movement) — or `null` when the Arcade did not send them.
7812
+ invert look, touch movement) and a starting graphics quality — or `null`
7813
+ when the Arcade did not send them.
7710
7814
 
7711
7815
  **Recommendations only; the player's own choice in your game wins.** Start
7712
7816
  a setting from here while the player has made no choice of their own for
@@ -7838,6 +7942,36 @@ On a touch screen, the movement thumbstick the player wants: `'floating'`
7838
7942
  appears where the thumb lands, `'fixed'` stays in one place. `'floating'`
7839
7943
  when the Arcade did not say. Your game draws the stick.
7840
7944
 
7945
+ <a id="gemrecommendedsettings-graphicsquality"></a>
7946
+
7947
+ ## GemRecommendedSettings.graphicsQuality
7948
+
7949
+ ```ts
7950
+ readonly graphicsQuality: GemGraphicsQuality
7951
+ ```
7952
+
7953
+ The graphics quality to START at on this device: `'low'`, `'medium'` or
7954
+ `'high'`. The Arcade picks it per device — the tier it detected, or the
7955
+ player's own Graphics choice — so a game opens at a quality that suits the
7956
+ device instead of guessing. A starting point, not a cap: while
7957
+ `graphicsQualityAuto` is true your game may adapt from here as it runs,
7958
+ and `createQualityGovernor` from `@indiegems/gem-web-sdk/quality` does
7959
+ that for you. When the Arcade did not say, `'low'` with `batterySaver`
7960
+ on and `'medium'` otherwise.
7961
+
7962
+ <a id="gemrecommendedsettings-graphicsqualityauto"></a>
7963
+
7964
+ ## GemRecommendedSettings.graphicsQualityAuto
7965
+
7966
+ ```ts
7967
+ readonly graphicsQualityAuto: boolean
7968
+ ```
7969
+
7970
+ Whether the Arcade chose `graphicsQuality` for this device (`true`, the
7971
+ player left Graphics on Auto) or the player picked it by hand (`false`).
7972
+ While it is `false`, hold that quality: never step it down or up on your
7973
+ own. `true` when the Arcade did not say.
7974
+
7841
7975
  <a id="gemcohort"></a>
7842
7976
 
7843
7977
  ## GemCohort
@@ -8638,7 +8772,7 @@ ends, and under an embedder that has no avatar picker.
8638
8772
  ## Gem.openAvatarPicker
8639
8773
 
8640
8774
  ```ts
8641
- openAvatarPicker(): boolean
8775
+ openAvatarPicker(options?: { tab?: "2d" | "3d" }): boolean
8642
8776
  ```
8643
8777
 
8644
8778
  Open the arcade's avatar picker over your game, so the player can change
@@ -8653,22 +8787,36 @@ changeAvatar.onclick = () => {
8653
8787
  };
8654
8788
  ```
8655
8789
 
8790
+ **Two tabs: 2D and 3D.** The picker has a 2D tab — the portrait, a
8791
+ picture ([PlayerIdentity.avatarIconId](#playeridentity-avatariconid)) — and a 3D tab — a whole
8792
+ character with its own model ([PlayerIdentity.avatar3dId](#playeridentity-avatar3did),
8793
+ [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl)). They are separate choices: wearing
8794
+ one never changes the other. Pass `{ tab: '3d' }` or `{ tab: '2d' }` to
8795
+ open on one; omit it and the arcade decides (a game that draws Arcade
8796
+ avatars gets the 3D tab). An arcade older than the tabs ignores it.
8797
+
8656
8798
  **The change arrives as a new player, not as an answer.** Nothing comes
8657
8799
  back from this call. When the player picks a different avatar, the arcade
8658
8800
  pauses your game while the picker is open, then sends the player again —
8659
8801
  your `onPlayer` callback runs and [Gem.player](#gem-player) holds the new
8660
- [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) — and resumes it. Redraw from
8661
- `onPlayer`, which also runs when the player changes their avatar from the
8662
- arcade's own menu without your game asking. A player who closes the picker
8663
- unchanged produces nothing at all.
8802
+ [PlayerIdentity.avatar3dId](#playeridentity-avatar3did) or [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) —
8803
+ and resumes it. Redraw from `onPlayer`, which also runs when the player
8804
+ changes their avatar from the arcade's own menu without your game asking.
8805
+ A player who closes the picker unchanged produces nothing at all.
8664
8806
 
8665
8807
  **Your server learns it only when it reads the room again.** A
8666
- server-authoritative game reads each member's `avatar_icon_id` from the
8667
- room read (`GET /v1/games/{game_id}/game-rooms/{game_room_id}`, or
8668
- `gem.room.get()` on a dedicated server); nothing tells the server the
8669
- player changed. So when `onPlayer` brings a different `avatarIconId`, have
8670
- your client tell your server, and have the server re-read the room — never
8671
- trust the id the client sends.
8808
+ server-authoritative game reads each member's `avatar_3d_id` and
8809
+ `avatar_icon_id` from the room read
8810
+ (`GET /v1/games/{game_id}/game-rooms/{game_room_id}`, or `gem.room.get()`
8811
+ on a dedicated server); nothing tells the server the player changed. So
8812
+ when `onPlayer` brings a different avatar, have your client tell your
8813
+ server, and have the server re-read the room — never trust the id the
8814
+ client sends.
8815
+
8816
+ | Parameter | Type | Description |
8817
+ | --- | --- | --- |
8818
+ | `options` | `{ tab?: "2d" \| "3d" }` | `tab` — `'2d'` or `'3d'`, the tab to open on. Omit it to let
8819
+ the arcade decide; any other value is treated as omitted. |
8672
8820
 
8673
8821
  **Returns.** `true` when the arcade was asked; `false` when it was not and
8674
8822
  never will be for this call — outside the arcade, before the bridge is
@@ -8931,6 +9079,20 @@ honouring them is part of the platform's release checklist.
8931
9079
  Read it at the moment you need it rather than caching it: the locale can
8932
9080
  change mid-session.
8933
9081
 
9082
+ <a id="gem-paused"></a>
9083
+
9084
+ ## Gem.paused
9085
+
9086
+ ```ts
9087
+ readonly paused: boolean
9088
+ ```
9089
+
9090
+ Whether the arcade has your game paused right now: `true` from an
9091
+ `onPause(true)` until the `onPause(false)` that follows it, `false` before
9092
+ any. The same pause `onPause` tells you about, readable at any moment —
9093
+ for code that was not around when the edge arrived, such as a frame-time
9094
+ monitor deciding whether a slow frame counts.
9095
+
8934
9096
  <a id="gem-cohorts"></a>
8935
9097
 
8936
9098
  ## Gem.cohorts
@@ -10294,6 +10456,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
10294
10456
  draw your own placeholder rather than a broken image. Pass it through
10295
10457
  [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
10296
10458
 
10459
+ <a id="playeridentity-avatar3did"></a>
10460
+
10461
+ ## PlayerIdentity.avatar3dId
10462
+
10463
+ ```ts
10464
+ readonly avatar3dId?: string
10465
+ ```
10466
+
10467
+ The id of the 3D character the player wears, when they wear one — an
10468
+ Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
10469
+ avatar picker. What a game that draws Arcade avatars keys its character
10470
+ on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
10471
+ to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
10472
+ absent.
10473
+
10474
+ Independent of the portrait: wearing a 3D character never changes
10475
+ `avatarIconId`, and the other way round. Absent means the game's default
10476
+ look. On `gem.player` it changes when the player wears another one, and
10477
+ `onPlayer` runs again; see `gem.openAvatarPicker`.
10478
+
10479
+ <a id="playeridentity-avatar3dmodelurl"></a>
10480
+
10481
+ ## PlayerIdentity.avatar3dModelUrl
10482
+
10483
+ ```ts
10484
+ readonly avatar3dModelUrl?: string
10485
+ ```
10486
+
10487
+ The worn 3D character's model — a binary glTF (`.glb`) with one rig,
10488
+ `root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
10489
+ possibly animation clips. Load it with three.js's `GLTFLoader`, after
10490
+ passing it through [platformIconUrl](#platformiconurl), which pins models to the
10491
+ platform's item host exactly as it pins pictures. Absent when no 3D
10492
+ character is worn.
10493
+
10494
+ <a id="playeridentity-avatar3diconurl"></a>
10495
+
10496
+ ## PlayerIdentity.avatar3dIconUrl
10497
+
10498
+ ```ts
10499
+ readonly avatar3dIconUrl?: string
10500
+ ```
10501
+
10502
+ A rendered portrait of the worn 3D character, for a roster or a menu where
10503
+ loading the model is too much. Not the 2D portrait
10504
+ ([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
10505
+ through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
10506
+
10297
10507
  <a id="playeridentity-badges"></a>
10298
10508
 
10299
10509
  ## PlayerIdentity.badges
@@ -10332,8 +10542,8 @@ for (const row of opponents) {
10332
10542
  ```
10333
10543
 
10334
10544
  Reads `player_id`, `display_name`, `discriminator`, `display_tag`,
10335
- `avatar_icon_id`, `avatar_icon_url` and `badges`, and nothing else from the
10336
- row. Anything missing, empty or of the wrong type is absent in the result.
10545
+ `avatar_icon_id`, `avatar_icon_url`, `avatar_3d_id`, `avatar_3d_model_url`,
10546
+ `avatar_3d_icon_url` and `badges`, and nothing else from the row. Anything missing, empty or of the wrong type is absent in the result.
10337
10547
 
10338
10548
  | Parameter | Type |
10339
10549
  | --- | --- |
@@ -10349,9 +10559,10 @@ function platformIconUrl(url: string | undefined): string | undefined
10349
10559
 
10350
10560
  The icon URL, if and only if the platform serves it — otherwise `undefined`.
10351
10561
 
10352
- Use it on every [PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl) and
10353
- [PlayerBadge.iconUrl](#playerbadge-iconurl) before it reaches an `<img src>`, a texture
10354
- loader or a `fetch`:
10562
+ Use it on every [PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl),
10563
+ [PlayerIdentity.avatar3dIconUrl](#playeridentity-avatar3diconurl), [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl)
10564
+ and [PlayerBadge.iconUrl](#playerbadge-iconurl) before it reaches an `<img src>`, a texture
10565
+ loader, a `GLTFLoader` or a `fetch`:
10355
10566
 
10356
10567
  ```js
10357
10568
  import { platformIconUrl } from '@indiegems/gem-web-sdk/sdk';
@@ -11692,6 +11903,17 @@ readonly code: "unknown_currency" | "not_purchasable" | "no_price_in_currency" |
11692
11903
  Which check refused: `unknown_currency`, `not_purchasable`,
11693
11904
  `no_price_in_currency` or `quantity_invalid`.
11694
11905
 
11906
+ <a id="gemgraphicsquality"></a>
11907
+
11908
+ ## GemGraphicsQuality
11909
+
11910
+ ```ts
11911
+ type GemGraphicsQuality = "low" | "medium" | "high"
11912
+ ```
11913
+
11914
+ A graphics quality tier: `'low'`, `'medium'` or `'high'`. What
11915
+ `gem.prefs.recommended.graphicsQuality` holds.
11916
+
11695
11917
  <a id="servertokengrant"></a>
11696
11918
 
11697
11919
  ## ServerTokenGrant
@@ -12850,6 +13072,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
12850
13072
  draw your own placeholder rather than a broken image. Pass it through
12851
13073
  [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
12852
13074
 
13075
+ <a id="leaderboardentry-avatar3did"></a>
13076
+
13077
+ ## LeaderboardEntry.avatar3dId
13078
+
13079
+ ```ts
13080
+ readonly avatar3dId?: string
13081
+ ```
13082
+
13083
+ The id of the 3D character the player wears, when they wear one — an
13084
+ Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
13085
+ avatar picker. What a game that draws Arcade avatars keys its character
13086
+ on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
13087
+ to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
13088
+ absent.
13089
+
13090
+ Independent of the portrait: wearing a 3D character never changes
13091
+ `avatarIconId`, and the other way round. Absent means the game's default
13092
+ look. On `gem.player` it changes when the player wears another one, and
13093
+ `onPlayer` runs again; see `gem.openAvatarPicker`.
13094
+
13095
+ <a id="leaderboardentry-avatar3dmodelurl"></a>
13096
+
13097
+ ## LeaderboardEntry.avatar3dModelUrl
13098
+
13099
+ ```ts
13100
+ readonly avatar3dModelUrl?: string
13101
+ ```
13102
+
13103
+ The worn 3D character's model — a binary glTF (`.glb`) with one rig,
13104
+ `root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
13105
+ possibly animation clips. Load it with three.js's `GLTFLoader`, after
13106
+ passing it through [platformIconUrl](#platformiconurl), which pins models to the
13107
+ platform's item host exactly as it pins pictures. Absent when no 3D
13108
+ character is worn.
13109
+
13110
+ <a id="leaderboardentry-avatar3diconurl"></a>
13111
+
13112
+ ## LeaderboardEntry.avatar3dIconUrl
13113
+
13114
+ ```ts
13115
+ readonly avatar3dIconUrl?: string
13116
+ ```
13117
+
13118
+ A rendered portrait of the worn 3D character, for a roster or a menu where
13119
+ loading the model is too much. Not the 2D portrait
13120
+ ([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
13121
+ through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
13122
+
12853
13123
  <a id="leaderboardentry-badges"></a>
12854
13124
 
12855
13125
  ## LeaderboardEntry.badges
@@ -14295,6 +14565,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
14295
14565
  draw your own placeholder rather than a broken image. Pass it through
14296
14566
  [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
14297
14567
 
14568
+ <a id="playerprofile-avatar3did"></a>
14569
+
14570
+ ## PlayerProfile.avatar3dId
14571
+
14572
+ ```ts
14573
+ readonly avatar3dId?: string
14574
+ ```
14575
+
14576
+ The id of the 3D character the player wears, when they wear one — an
14577
+ Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
14578
+ avatar picker. What a game that draws Arcade avatars keys its character
14579
+ on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
14580
+ to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
14581
+ absent.
14582
+
14583
+ Independent of the portrait: wearing a 3D character never changes
14584
+ `avatarIconId`, and the other way round. Absent means the game's default
14585
+ look. On `gem.player` it changes when the player wears another one, and
14586
+ `onPlayer` runs again; see `gem.openAvatarPicker`.
14587
+
14588
+ <a id="playerprofile-avatar3dmodelurl"></a>
14589
+
14590
+ ## PlayerProfile.avatar3dModelUrl
14591
+
14592
+ ```ts
14593
+ readonly avatar3dModelUrl?: string
14594
+ ```
14595
+
14596
+ The worn 3D character's model — a binary glTF (`.glb`) with one rig,
14597
+ `root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
14598
+ possibly animation clips. Load it with three.js's `GLTFLoader`, after
14599
+ passing it through [platformIconUrl](#platformiconurl), which pins models to the
14600
+ platform's item host exactly as it pins pictures. Absent when no 3D
14601
+ character is worn.
14602
+
14603
+ <a id="playerprofile-avatar3diconurl"></a>
14604
+
14605
+ ## PlayerProfile.avatar3dIconUrl
14606
+
14607
+ ```ts
14608
+ readonly avatar3dIconUrl?: string
14609
+ ```
14610
+
14611
+ A rendered portrait of the worn 3D character, for a roster or a menu where
14612
+ loading the model is too much. Not the 2D portrait
14613
+ ([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
14614
+ through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
14615
+
14298
14616
  <a id="playerprofile-badges"></a>
14299
14617
 
14300
14618
  ## PlayerProfile.badges
@@ -16613,6 +16931,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
16613
16931
  draw your own placeholder rather than a broken image. Pass it through
16614
16932
  [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
16615
16933
 
16934
+ <a id="roommember-avatar3did"></a>
16935
+
16936
+ ## RoomMember.avatar3dId
16937
+
16938
+ ```ts
16939
+ readonly avatar3dId?: string
16940
+ ```
16941
+
16942
+ The id of the 3D character the player wears, when they wear one — an
16943
+ Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
16944
+ avatar picker. What a game that draws Arcade avatars keys its character
16945
+ on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
16946
+ to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
16947
+ absent.
16948
+
16949
+ Independent of the portrait: wearing a 3D character never changes
16950
+ `avatarIconId`, and the other way round. Absent means the game's default
16951
+ look. On `gem.player` it changes when the player wears another one, and
16952
+ `onPlayer` runs again; see `gem.openAvatarPicker`.
16953
+
16954
+ <a id="roommember-avatar3dmodelurl"></a>
16955
+
16956
+ ## RoomMember.avatar3dModelUrl
16957
+
16958
+ ```ts
16959
+ readonly avatar3dModelUrl?: string
16960
+ ```
16961
+
16962
+ The worn 3D character's model — a binary glTF (`.glb`) with one rig,
16963
+ `root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
16964
+ possibly animation clips. Load it with three.js's `GLTFLoader`, after
16965
+ passing it through [platformIconUrl](#platformiconurl), which pins models to the
16966
+ platform's item host exactly as it pins pictures. Absent when no 3D
16967
+ character is worn.
16968
+
16969
+ <a id="roommember-avatar3diconurl"></a>
16970
+
16971
+ ## RoomMember.avatar3dIconUrl
16972
+
16973
+ ```ts
16974
+ readonly avatar3dIconUrl?: string
16975
+ ```
16976
+
16977
+ A rendered portrait of the worn 3D character, for a roster or a menu where
16978
+ loading the model is too much. Not the 2D portrait
16979
+ ([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
16980
+ through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
16981
+
16616
16982
  <a id="roommember-badges"></a>
16617
16983
 
16618
16984
  ## RoomMember.badges
@@ -17381,6 +17747,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
17381
17747
  draw your own placeholder rather than a broken image. Pass it through
17382
17748
  [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
17383
17749
 
17750
+ <a id="showcasefriendentry-avatar3did"></a>
17751
+
17752
+ ## ShowcaseFriendEntry.avatar3dId
17753
+
17754
+ ```ts
17755
+ readonly avatar3dId?: string
17756
+ ```
17757
+
17758
+ The id of the 3D character the player wears, when they wear one — an
17759
+ Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
17760
+ avatar picker. What a game that draws Arcade avatars keys its character
17761
+ on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
17762
+ to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
17763
+ absent.
17764
+
17765
+ Independent of the portrait: wearing a 3D character never changes
17766
+ `avatarIconId`, and the other way round. Absent means the game's default
17767
+ look. On `gem.player` it changes when the player wears another one, and
17768
+ `onPlayer` runs again; see `gem.openAvatarPicker`.
17769
+
17770
+ <a id="showcasefriendentry-avatar3dmodelurl"></a>
17771
+
17772
+ ## ShowcaseFriendEntry.avatar3dModelUrl
17773
+
17774
+ ```ts
17775
+ readonly avatar3dModelUrl?: string
17776
+ ```
17777
+
17778
+ The worn 3D character's model — a binary glTF (`.glb`) with one rig,
17779
+ `root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
17780
+ possibly animation clips. Load it with three.js's `GLTFLoader`, after
17781
+ passing it through [platformIconUrl](#platformiconurl), which pins models to the
17782
+ platform's item host exactly as it pins pictures. Absent when no 3D
17783
+ character is worn.
17784
+
17785
+ <a id="showcasefriendentry-avatar3diconurl"></a>
17786
+
17787
+ ## ShowcaseFriendEntry.avatar3dIconUrl
17788
+
17789
+ ```ts
17790
+ readonly avatar3dIconUrl?: string
17791
+ ```
17792
+
17793
+ A rendered portrait of the worn 3D character, for a roster or a menu where
17794
+ loading the model is too much. Not the 2D portrait
17795
+ ([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
17796
+ through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
17797
+
17384
17798
  <a id="showcasefriendentry-badges"></a>
17385
17799
 
17386
17800
  ## ShowcaseFriendEntry.badges
@@ -1,6 +1,6 @@
1
1
  # The server surface — API reference
2
2
 
3
- Generated from `@indiegems/gem-web-sdk/sdk` v10.3.1, the version of the package this file ships in. Every symbol below carries an explicit anchor, its `anchor` in `reference.json` beside this file.
3
+ Generated from `@indiegems/gem-web-sdk/sdk` v11.0.0, the version of the package this file ships in. Every symbol below carries an explicit anchor, its `anchor` in `reference.json` beside this file.
4
4
 
5
5
  `@indiegems/gem-web-sdk/sdk` is the one import a game writes, wherever its code runs. `@indiegems/gem-web-sdk/server` exports exactly the symbols on this page and nothing else, for a build that wants only this half.
6
6