@indiegems/gem-web-sdk 13.4.2 → 14.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.
@@ -2,7 +2,7 @@
2
2
  "schema_version": 2,
3
3
  "source": {
4
4
  "repo": "IndieGems/gem-web-sdk",
5
- "version": "13.4.2"
5
+ "version": "14.0.0"
6
6
  },
7
7
  "entries": [
8
8
  {
@@ -77,6 +77,10 @@
77
77
  "key": "controls",
78
78
  "title": "Camera and look controls"
79
79
  },
80
+ {
81
+ "key": "gameSettings",
82
+ "title": "Game settings in the Arcade menu"
83
+ },
80
84
  {
81
85
  "key": "config",
82
86
  "title": "Your published config"
@@ -6901,6 +6905,29 @@
6901
6905
  "defaultValue": null,
6902
6906
  "guides": []
6903
6907
  },
6908
+ {
6909
+ "id": "GemFrame.declareSettings",
6910
+ "name": "declareSettings",
6911
+ "anchor": "gemframe-declaresettings",
6912
+ "group": "frame",
6913
+ "signature": "declareSettings(settings: { id: string; label: string; kind: \"toggle\" | \"slider\" | \"choice\"; value: string | number | boolean; quick?: boolean; icon?: string; min?: number; max?: number; step?: number; options?: { id: string; label: string }[] }[]): boolean",
6914
+ "documented": true,
6915
+ "summary": "Mirror up to eight of your game's own settings into the arcade's menu —\nthe whole list each time, the latest one winning.\n\nPrefer `gem.settings.declare`, which checks each entry, holds the list\nacross a reconnect and calls your handlers when the player changes one.\nThis one sends only while connected, and only to an arcade that draws game\nsettings.",
6916
+ "deprecated": null,
6917
+ "params": [
6918
+ {
6919
+ "name": "settings",
6920
+ "type": "{ id: string; label: string; kind: \"toggle\" | \"slider\" | \"choice\"; value: string | number | boolean; quick?: boolean; icon?: string; min?: number; max?: number; step?: number; options?: { id: string; label: string }[] }[]",
6921
+ "optional": false,
6922
+ "summary": null
6923
+ }
6924
+ ],
6925
+ "returns": "whether the message left the frame — `false` before the bridge is\n up, for an arcade that draws no game settings, for a list the schema\n refuses, and past this frame's own limit.",
6926
+ "throws": null,
6927
+ "example": null,
6928
+ "defaultValue": null,
6929
+ "guides": []
6930
+ },
6904
6931
  {
6905
6932
  "id": "GemFrame.setGemCorner",
6906
6933
  "name": "setGemCorner",
@@ -8335,6 +8362,644 @@
8335
8362
  "defaultValue": null,
8336
8363
  "guides": []
8337
8364
  },
8365
+ {
8366
+ "id": "GemGameSettingIcon",
8367
+ "name": "GemGameSettingIcon",
8368
+ "anchor": "gemgamesettingicon",
8369
+ "group": "gameSettings",
8370
+ "signature": "type GemGameSettingIcon = \"music\" | \"sfx\" | \"voice\" | \"eye\" | \"text\" | \"hint\" | \"speed\" | \"bright\" | \"controls\" | \"star\"",
8371
+ "documented": true,
8372
+ "summary": "The icon codes a declared setting may carry — the Arcade draws the glyph. An\nicon is optional, and a setting without one gets the Arcade's generic glyph.",
8373
+ "deprecated": null,
8374
+ "params": [],
8375
+ "returns": null,
8376
+ "throws": null,
8377
+ "example": null,
8378
+ "defaultValue": null,
8379
+ "guides": []
8380
+ },
8381
+ {
8382
+ "id": "GemGameSettingValue",
8383
+ "name": "GemGameSettingValue",
8384
+ "anchor": "gemgamesettingvalue",
8385
+ "group": "gameSettings",
8386
+ "signature": "type GemGameSettingValue = boolean | number | string",
8387
+ "documented": true,
8388
+ "summary": "The value of a declared setting: `boolean` for a toggle, `number` for a\nslider, and an option's `id` for a choice.",
8389
+ "deprecated": null,
8390
+ "params": [],
8391
+ "returns": null,
8392
+ "throws": null,
8393
+ "example": null,
8394
+ "defaultValue": null,
8395
+ "guides": []
8396
+ },
8397
+ {
8398
+ "id": "GemGameSettingBase",
8399
+ "name": "GemGameSettingBase",
8400
+ "anchor": "gemgamesettingbase",
8401
+ "group": "gameSettings",
8402
+ "signature": "interface GemGameSettingBase",
8403
+ "documented": true,
8404
+ "summary": "What every declared setting has, whatever its kind.",
8405
+ "deprecated": null,
8406
+ "params": [],
8407
+ "returns": null,
8408
+ "throws": null,
8409
+ "example": null,
8410
+ "defaultValue": null,
8411
+ "guides": []
8412
+ },
8413
+ {
8414
+ "id": "GemGameSettingBase.id",
8415
+ "name": "id",
8416
+ "anchor": "gemgamesettingbase-id",
8417
+ "group": "gameSettings",
8418
+ "signature": "readonly id: string",
8419
+ "documented": true,
8420
+ "summary": "Your own name for the setting — 1 to 40 of `A-Z a-z 0-9 _ -`, unique in\none declaration. It is what [GemGameSettingChange.id](api-reference-game.md#gemgamesettingchange-id) carries back.",
8421
+ "deprecated": null,
8422
+ "params": [],
8423
+ "returns": null,
8424
+ "throws": null,
8425
+ "example": null,
8426
+ "defaultValue": null,
8427
+ "guides": []
8428
+ },
8429
+ {
8430
+ "id": "GemGameSettingBase.label",
8431
+ "name": "label",
8432
+ "anchor": "gemgamesettingbase-label",
8433
+ "group": "gameSettings",
8434
+ "signature": "readonly label: string",
8435
+ "documented": true,
8436
+ "summary": "What the player reads, 1 to 40 characters, **already in the player's\nlanguage** (`gem.prefs.locale`): the Arcade does not translate it. Cut at\n40 characters.",
8437
+ "deprecated": null,
8438
+ "params": [],
8439
+ "returns": null,
8440
+ "throws": null,
8441
+ "example": null,
8442
+ "defaultValue": null,
8443
+ "guides": []
8444
+ },
8445
+ {
8446
+ "id": "GemGameSettingBase.icon",
8447
+ "name": "icon",
8448
+ "anchor": "gemgamesettingbase-icon",
8449
+ "group": "gameSettings",
8450
+ "signature": "readonly icon?: GemGameSettingIcon",
8451
+ "documented": true,
8452
+ "summary": "One of the Arcade's icon codes; a code this SDK does not know is left out\n(with a warning) and the setting is kept with the generic glyph.",
8453
+ "deprecated": null,
8454
+ "params": [],
8455
+ "returns": null,
8456
+ "throws": null,
8457
+ "example": null,
8458
+ "defaultValue": null,
8459
+ "guides": []
8460
+ },
8461
+ {
8462
+ "id": "GemGameToggleSetting",
8463
+ "name": "GemGameToggleSetting",
8464
+ "anchor": "gemgametogglesetting",
8465
+ "group": "gameSettings",
8466
+ "signature": "interface GemGameToggleSetting",
8467
+ "documented": true,
8468
+ "summary": "An on/off setting — Music, Color help.",
8469
+ "deprecated": null,
8470
+ "params": [],
8471
+ "returns": null,
8472
+ "throws": null,
8473
+ "example": null,
8474
+ "defaultValue": null,
8475
+ "guides": []
8476
+ },
8477
+ {
8478
+ "id": "GemGameToggleSetting.id",
8479
+ "name": "id",
8480
+ "anchor": "gemgametogglesetting-id",
8481
+ "group": "gameSettings",
8482
+ "signature": "readonly id: string",
8483
+ "documented": true,
8484
+ "summary": "Your own name for the setting — 1 to 40 of `A-Z a-z 0-9 _ -`, unique in\none declaration. It is what [GemGameSettingChange.id](api-reference-game.md#gemgamesettingchange-id) carries back.",
8485
+ "deprecated": null,
8486
+ "params": [],
8487
+ "returns": null,
8488
+ "throws": null,
8489
+ "example": null,
8490
+ "defaultValue": null,
8491
+ "guides": []
8492
+ },
8493
+ {
8494
+ "id": "GemGameToggleSetting.label",
8495
+ "name": "label",
8496
+ "anchor": "gemgametogglesetting-label",
8497
+ "group": "gameSettings",
8498
+ "signature": "readonly label: string",
8499
+ "documented": true,
8500
+ "summary": "What the player reads, 1 to 40 characters, **already in the player's\nlanguage** (`gem.prefs.locale`): the Arcade does not translate it. Cut at\n40 characters.",
8501
+ "deprecated": null,
8502
+ "params": [],
8503
+ "returns": null,
8504
+ "throws": null,
8505
+ "example": null,
8506
+ "defaultValue": null,
8507
+ "guides": []
8508
+ },
8509
+ {
8510
+ "id": "GemGameToggleSetting.icon",
8511
+ "name": "icon",
8512
+ "anchor": "gemgametogglesetting-icon",
8513
+ "group": "gameSettings",
8514
+ "signature": "readonly icon?: GemGameSettingIcon",
8515
+ "documented": true,
8516
+ "summary": "One of the Arcade's icon codes; a code this SDK does not know is left out\n(with a warning) and the setting is kept with the generic glyph.",
8517
+ "deprecated": null,
8518
+ "params": [],
8519
+ "returns": null,
8520
+ "throws": null,
8521
+ "example": null,
8522
+ "defaultValue": null,
8523
+ "guides": []
8524
+ },
8525
+ {
8526
+ "id": "GemGameToggleSetting.kind",
8527
+ "name": "kind",
8528
+ "anchor": "gemgametogglesetting-kind",
8529
+ "group": "gameSettings",
8530
+ "signature": "readonly kind: \"toggle\"",
8531
+ "documented": true,
8532
+ "summary": "`'toggle'`: what kind of setting this is.",
8533
+ "deprecated": null,
8534
+ "params": [],
8535
+ "returns": null,
8536
+ "throws": null,
8537
+ "example": null,
8538
+ "defaultValue": null,
8539
+ "guides": []
8540
+ },
8541
+ {
8542
+ "id": "GemGameToggleSetting.value",
8543
+ "name": "value",
8544
+ "anchor": "gemgametogglesetting-value",
8545
+ "group": "gameSettings",
8546
+ "signature": "readonly value: boolean",
8547
+ "documented": true,
8548
+ "summary": "Whether it is on now.",
8549
+ "deprecated": null,
8550
+ "params": [],
8551
+ "returns": null,
8552
+ "throws": null,
8553
+ "example": null,
8554
+ "defaultValue": null,
8555
+ "guides": []
8556
+ },
8557
+ {
8558
+ "id": "GemGameToggleSetting.quick",
8559
+ "name": "quick",
8560
+ "anchor": "gemgametogglesetting-quick",
8561
+ "group": "gameSettings",
8562
+ "signature": "readonly quick?: boolean",
8563
+ "documented": true,
8564
+ "summary": "Ask for this toggle in the menu's quick row, beside the Arcade's own Sound\nand Vibration. The first two toggles that ask get it; a third is shown only\nin the settings list.",
8565
+ "deprecated": null,
8566
+ "params": [],
8567
+ "returns": null,
8568
+ "throws": null,
8569
+ "example": null,
8570
+ "defaultValue": null,
8571
+ "guides": []
8572
+ },
8573
+ {
8574
+ "id": "GemGameSliderSetting",
8575
+ "name": "GemGameSliderSetting",
8576
+ "anchor": "gemgameslidersetting",
8577
+ "group": "gameSettings",
8578
+ "signature": "interface GemGameSliderSetting",
8579
+ "documented": true,
8580
+ "summary": "A number between two ends — Music volume, Game speed.",
8581
+ "deprecated": null,
8582
+ "params": [],
8583
+ "returns": null,
8584
+ "throws": null,
8585
+ "example": null,
8586
+ "defaultValue": null,
8587
+ "guides": []
8588
+ },
8589
+ {
8590
+ "id": "GemGameSliderSetting.id",
8591
+ "name": "id",
8592
+ "anchor": "gemgameslidersetting-id",
8593
+ "group": "gameSettings",
8594
+ "signature": "readonly id: string",
8595
+ "documented": true,
8596
+ "summary": "Your own name for the setting — 1 to 40 of `A-Z a-z 0-9 _ -`, unique in\none declaration. It is what [GemGameSettingChange.id](api-reference-game.md#gemgamesettingchange-id) carries back.",
8597
+ "deprecated": null,
8598
+ "params": [],
8599
+ "returns": null,
8600
+ "throws": null,
8601
+ "example": null,
8602
+ "defaultValue": null,
8603
+ "guides": []
8604
+ },
8605
+ {
8606
+ "id": "GemGameSliderSetting.label",
8607
+ "name": "label",
8608
+ "anchor": "gemgameslidersetting-label",
8609
+ "group": "gameSettings",
8610
+ "signature": "readonly label: string",
8611
+ "documented": true,
8612
+ "summary": "What the player reads, 1 to 40 characters, **already in the player's\nlanguage** (`gem.prefs.locale`): the Arcade does not translate it. Cut at\n40 characters.",
8613
+ "deprecated": null,
8614
+ "params": [],
8615
+ "returns": null,
8616
+ "throws": null,
8617
+ "example": null,
8618
+ "defaultValue": null,
8619
+ "guides": []
8620
+ },
8621
+ {
8622
+ "id": "GemGameSliderSetting.icon",
8623
+ "name": "icon",
8624
+ "anchor": "gemgameslidersetting-icon",
8625
+ "group": "gameSettings",
8626
+ "signature": "readonly icon?: GemGameSettingIcon",
8627
+ "documented": true,
8628
+ "summary": "One of the Arcade's icon codes; a code this SDK does not know is left out\n(with a warning) and the setting is kept with the generic glyph.",
8629
+ "deprecated": null,
8630
+ "params": [],
8631
+ "returns": null,
8632
+ "throws": null,
8633
+ "example": null,
8634
+ "defaultValue": null,
8635
+ "guides": []
8636
+ },
8637
+ {
8638
+ "id": "GemGameSliderSetting.kind",
8639
+ "name": "kind",
8640
+ "anchor": "gemgameslidersetting-kind",
8641
+ "group": "gameSettings",
8642
+ "signature": "readonly kind: \"slider\"",
8643
+ "documented": true,
8644
+ "summary": "`'slider'`: what kind of setting this is.",
8645
+ "deprecated": null,
8646
+ "params": [],
8647
+ "returns": null,
8648
+ "throws": null,
8649
+ "example": null,
8650
+ "defaultValue": null,
8651
+ "guides": []
8652
+ },
8653
+ {
8654
+ "id": "GemGameSliderSetting.value",
8655
+ "name": "value",
8656
+ "anchor": "gemgameslidersetting-value",
8657
+ "group": "gameSettings",
8658
+ "signature": "readonly value: number",
8659
+ "documented": true,
8660
+ "summary": "The number now. Clamped into `[min, max]` and snapped onto `step` before it\nis sent.",
8661
+ "deprecated": null,
8662
+ "params": [],
8663
+ "returns": null,
8664
+ "throws": null,
8665
+ "example": null,
8666
+ "defaultValue": null,
8667
+ "guides": []
8668
+ },
8669
+ {
8670
+ "id": "GemGameSliderSetting.min",
8671
+ "name": "min",
8672
+ "anchor": "gemgameslidersetting-min",
8673
+ "group": "gameSettings",
8674
+ "signature": "readonly min?: number",
8675
+ "documented": true,
8676
+ "summary": "The lowest value, `0` when left out. Within ±1 000 000, below `max`.",
8677
+ "deprecated": null,
8678
+ "params": [],
8679
+ "returns": null,
8680
+ "throws": null,
8681
+ "example": null,
8682
+ "defaultValue": null,
8683
+ "guides": []
8684
+ },
8685
+ {
8686
+ "id": "GemGameSliderSetting.max",
8687
+ "name": "max",
8688
+ "anchor": "gemgameslidersetting-max",
8689
+ "group": "gameSettings",
8690
+ "signature": "readonly max?: number",
8691
+ "documented": true,
8692
+ "summary": "The highest value, `100` when left out. Within ±1 000 000, above `min`.",
8693
+ "deprecated": null,
8694
+ "params": [],
8695
+ "returns": null,
8696
+ "throws": null,
8697
+ "example": null,
8698
+ "defaultValue": null,
8699
+ "guides": []
8700
+ },
8701
+ {
8702
+ "id": "GemGameSliderSetting.step",
8703
+ "name": "step",
8704
+ "anchor": "gemgameslidersetting-step",
8705
+ "group": "gameSettings",
8706
+ "signature": "readonly step?: number",
8707
+ "documented": true,
8708
+ "summary": "The increment from `min`, `1` when left out. Greater than `0`.",
8709
+ "deprecated": null,
8710
+ "params": [],
8711
+ "returns": null,
8712
+ "throws": null,
8713
+ "example": null,
8714
+ "defaultValue": null,
8715
+ "guides": []
8716
+ },
8717
+ {
8718
+ "id": "GemGameSettingOption",
8719
+ "name": "GemGameSettingOption",
8720
+ "anchor": "gemgamesettingoption",
8721
+ "group": "gameSettings",
8722
+ "signature": "interface GemGameSettingOption",
8723
+ "documented": true,
8724
+ "summary": "One answer of a [GemGameChoiceSetting](api-reference-game.md#gemgamechoicesetting).",
8725
+ "deprecated": null,
8726
+ "params": [],
8727
+ "returns": null,
8728
+ "throws": null,
8729
+ "example": null,
8730
+ "defaultValue": null,
8731
+ "guides": []
8732
+ },
8733
+ {
8734
+ "id": "GemGameSettingOption.id",
8735
+ "name": "id",
8736
+ "anchor": "gemgamesettingoption-id",
8737
+ "group": "gameSettings",
8738
+ "signature": "readonly id: string",
8739
+ "documented": true,
8740
+ "summary": "Your own name for the answer, 1 to 40 of `A-Z a-z 0-9 _ -`.",
8741
+ "deprecated": null,
8742
+ "params": [],
8743
+ "returns": null,
8744
+ "throws": null,
8745
+ "example": null,
8746
+ "defaultValue": null,
8747
+ "guides": []
8748
+ },
8749
+ {
8750
+ "id": "GemGameSettingOption.label",
8751
+ "name": "label",
8752
+ "anchor": "gemgamesettingoption-label",
8753
+ "group": "gameSettings",
8754
+ "signature": "readonly label: string",
8755
+ "documented": true,
8756
+ "summary": "What the player reads, 1 to 40 characters, already translated.",
8757
+ "deprecated": null,
8758
+ "params": [],
8759
+ "returns": null,
8760
+ "throws": null,
8761
+ "example": null,
8762
+ "defaultValue": null,
8763
+ "guides": []
8764
+ },
8765
+ {
8766
+ "id": "GemGameChoiceSetting",
8767
+ "name": "GemGameChoiceSetting",
8768
+ "anchor": "gemgamechoicesetting",
8769
+ "group": "gameSettings",
8770
+ "signature": "interface GemGameChoiceSetting",
8771
+ "documented": true,
8772
+ "summary": "One of two to four answers — Difficulty: Easy, Normal, Hard.",
8773
+ "deprecated": null,
8774
+ "params": [],
8775
+ "returns": null,
8776
+ "throws": null,
8777
+ "example": null,
8778
+ "defaultValue": null,
8779
+ "guides": []
8780
+ },
8781
+ {
8782
+ "id": "GemGameChoiceSetting.id",
8783
+ "name": "id",
8784
+ "anchor": "gemgamechoicesetting-id",
8785
+ "group": "gameSettings",
8786
+ "signature": "readonly id: string",
8787
+ "documented": true,
8788
+ "summary": "Your own name for the setting — 1 to 40 of `A-Z a-z 0-9 _ -`, unique in\none declaration. It is what [GemGameSettingChange.id](api-reference-game.md#gemgamesettingchange-id) carries back.",
8789
+ "deprecated": null,
8790
+ "params": [],
8791
+ "returns": null,
8792
+ "throws": null,
8793
+ "example": null,
8794
+ "defaultValue": null,
8795
+ "guides": []
8796
+ },
8797
+ {
8798
+ "id": "GemGameChoiceSetting.label",
8799
+ "name": "label",
8800
+ "anchor": "gemgamechoicesetting-label",
8801
+ "group": "gameSettings",
8802
+ "signature": "readonly label: string",
8803
+ "documented": true,
8804
+ "summary": "What the player reads, 1 to 40 characters, **already in the player's\nlanguage** (`gem.prefs.locale`): the Arcade does not translate it. Cut at\n40 characters.",
8805
+ "deprecated": null,
8806
+ "params": [],
8807
+ "returns": null,
8808
+ "throws": null,
8809
+ "example": null,
8810
+ "defaultValue": null,
8811
+ "guides": []
8812
+ },
8813
+ {
8814
+ "id": "GemGameChoiceSetting.icon",
8815
+ "name": "icon",
8816
+ "anchor": "gemgamechoicesetting-icon",
8817
+ "group": "gameSettings",
8818
+ "signature": "readonly icon?: GemGameSettingIcon",
8819
+ "documented": true,
8820
+ "summary": "One of the Arcade's icon codes; a code this SDK does not know is left out\n(with a warning) and the setting is kept with the generic glyph.",
8821
+ "deprecated": null,
8822
+ "params": [],
8823
+ "returns": null,
8824
+ "throws": null,
8825
+ "example": null,
8826
+ "defaultValue": null,
8827
+ "guides": []
8828
+ },
8829
+ {
8830
+ "id": "GemGameChoiceSetting.kind",
8831
+ "name": "kind",
8832
+ "anchor": "gemgamechoicesetting-kind",
8833
+ "group": "gameSettings",
8834
+ "signature": "readonly kind: \"choice\"",
8835
+ "documented": true,
8836
+ "summary": "`'choice'`: what kind of setting this is.",
8837
+ "deprecated": null,
8838
+ "params": [],
8839
+ "returns": null,
8840
+ "throws": null,
8841
+ "example": null,
8842
+ "defaultValue": null,
8843
+ "guides": []
8844
+ },
8845
+ {
8846
+ "id": "GemGameChoiceSetting.value",
8847
+ "name": "value",
8848
+ "anchor": "gemgamechoicesetting-value",
8849
+ "group": "gameSettings",
8850
+ "signature": "readonly value: string",
8851
+ "documented": true,
8852
+ "summary": "The `id` of the option chosen now.",
8853
+ "deprecated": null,
8854
+ "params": [],
8855
+ "returns": null,
8856
+ "throws": null,
8857
+ "example": null,
8858
+ "defaultValue": null,
8859
+ "guides": []
8860
+ },
8861
+ {
8862
+ "id": "GemGameChoiceSetting.options",
8863
+ "name": "options",
8864
+ "anchor": "gemgamechoicesetting-options",
8865
+ "group": "gameSettings",
8866
+ "signature": "readonly options: readonly GemGameSettingOption[]",
8867
+ "documented": true,
8868
+ "summary": "Two to four answers, ids unique. A fifth and later are left out.",
8869
+ "deprecated": null,
8870
+ "params": [],
8871
+ "returns": null,
8872
+ "throws": null,
8873
+ "example": null,
8874
+ "defaultValue": null,
8875
+ "guides": []
8876
+ },
8877
+ {
8878
+ "id": "GemGameSetting",
8879
+ "name": "GemGameSetting",
8880
+ "anchor": "gemgamesetting",
8881
+ "group": "gameSettings",
8882
+ "signature": "type GemGameSetting = GemGameToggleSetting | GemGameSliderSetting | GemGameChoiceSetting",
8883
+ "documented": true,
8884
+ "summary": "One of your game's settings, as `gem.settings.declare` mirrors it into the\nArcade's menu: a toggle, a slider or a choice.",
8885
+ "deprecated": null,
8886
+ "params": [],
8887
+ "returns": null,
8888
+ "throws": null,
8889
+ "example": null,
8890
+ "defaultValue": null,
8891
+ "guides": []
8892
+ },
8893
+ {
8894
+ "id": "GemGameSettingChange",
8895
+ "name": "GemGameSettingChange",
8896
+ "anchor": "gemgamesettingchange",
8897
+ "group": "gameSettings",
8898
+ "signature": "interface GemGameSettingChange",
8899
+ "documented": true,
8900
+ "summary": "The player changed one of your declared settings in the Arcade's menu.",
8901
+ "deprecated": null,
8902
+ "params": [],
8903
+ "returns": null,
8904
+ "throws": null,
8905
+ "example": null,
8906
+ "defaultValue": null,
8907
+ "guides": []
8908
+ },
8909
+ {
8910
+ "id": "GemGameSettingChange.id",
8911
+ "name": "id",
8912
+ "anchor": "gemgamesettingchange-id",
8913
+ "group": "gameSettings",
8914
+ "signature": "readonly id: string",
8915
+ "documented": true,
8916
+ "summary": "The setting's `id`, from your latest declaration.",
8917
+ "deprecated": null,
8918
+ "params": [],
8919
+ "returns": null,
8920
+ "throws": null,
8921
+ "example": null,
8922
+ "defaultValue": null,
8923
+ "guides": []
8924
+ },
8925
+ {
8926
+ "id": "GemGameSettingChange.value",
8927
+ "name": "value",
8928
+ "anchor": "gemgamesettingchange-value",
8929
+ "group": "gameSettings",
8930
+ "signature": "readonly value: GemGameSettingValue",
8931
+ "documented": true,
8932
+ "summary": "The new value, of the setting's kind: a `boolean` for a toggle, a `number`\ninside a slider's range and on its step, an option's `id` for a choice.",
8933
+ "deprecated": null,
8934
+ "params": [],
8935
+ "returns": null,
8936
+ "throws": null,
8937
+ "example": null,
8938
+ "defaultValue": null,
8939
+ "guides": []
8940
+ },
8941
+ {
8942
+ "id": "GameSettingsApi",
8943
+ "name": "GameSettingsApi",
8944
+ "anchor": "gamesettingsapi",
8945
+ "group": "gameSettings",
8946
+ "signature": "interface GameSettingsApi",
8947
+ "documented": true,
8948
+ "summary": "`gem.settings` — mirror up to eight of your game's own settings into the\nArcade's Gem menu. Your own settings button and screen stay: this is a\nsecond door to a few of the same settings, never the only one.",
8949
+ "deprecated": null,
8950
+ "params": [],
8951
+ "returns": null,
8952
+ "throws": null,
8953
+ "example": null,
8954
+ "defaultValue": null,
8955
+ "guides": []
8956
+ },
8957
+ {
8958
+ "id": "GameSettingsApi.declare",
8959
+ "name": "declare",
8960
+ "anchor": "gamesettingsapi-declare",
8961
+ "group": "gameSettings",
8962
+ "signature": "declare(settings: readonly GemGameSetting[]): boolean",
8963
+ "documented": true,
8964
+ "summary": "Show up to eight of your settings in the Arcade's menu, in this order — the\nwhole list each time, the latest call winning. `declare([])` takes them\nall back out.\n\n```js\ngem.settings.declare([\n { id: 'music', label: t('Music'), kind: 'toggle', value: music.on, quick: true, icon: 'music' },\n { id: 'speed', label: t('Game speed'), kind: 'slider', value: speed, min: 0.5, max: 2, step: 0.25 },\n]);\n```\n\n**Keep your own settings button and screen** — top-right, on every screen.\nThis mirrors a few of those settings; it never replaces them, and an\nembedder that draws no game settings shows none of it.\n\n**Declare again whenever your own screen changes a value**, so the menu\nnever shows a stale one. Mark at most two toggles `quick` (good ones:\nMusic, Sound effects, Color help). **Never declare the Arcade's own\nsettings** — master volume or mute, vibration, graphics quality, controls:\nthe Arcade already has them and they reach you as `gem.prefs`.\n\nAn entry that breaks a rule is left out, with a warning through your\n`log`; nothing throws.",
8965
+ "deprecated": null,
8966
+ "params": [
8967
+ {
8968
+ "name": "settings",
8969
+ "type": "readonly GemGameSetting[]",
8970
+ "optional": false,
8971
+ "summary": "Up to eight settings, in the order to show them."
8972
+ }
8973
+ ],
8974
+ "returns": "`true` when the Arcade has been told, or will be within half a\n second; `false` before the bridge is up (the list is held and sent when\n it connects), under an embedder that draws no game settings, and for an\n argument that is not an array.",
8975
+ "throws": null,
8976
+ "example": null,
8977
+ "defaultValue": null,
8978
+ "guides": []
8979
+ },
8980
+ {
8981
+ "id": "GameSettingsApi.onChange",
8982
+ "name": "onChange",
8983
+ "anchor": "gamesettingsapi-onchange",
8984
+ "group": "gameSettings",
8985
+ "signature": "onChange(handler: (change: GemGameSettingChange) => void): () => void",
8986
+ "documented": true,
8987
+ "summary": "Called when the player changes one of your declared settings in the\nArcade's menu. Apply it at once, **even while paused** — the menu holds\nthe pause, and the player should hear the music stop while it is open —\nand keep it where you keep that setting's other changes.\n\n```js\ngem.settings.onChange(({ id, value }) => {\n if (id === 'music') setMusic(value === true);\n});\n```\n\nThe SDK has already written the new value into your declaration, so there\nis no need to declare again for this change.",
8988
+ "deprecated": null,
8989
+ "params": [
8990
+ {
8991
+ "name": "handler",
8992
+ "type": "(change: GemGameSettingChange) => void",
8993
+ "optional": false,
8994
+ "summary": null
8995
+ }
8996
+ ],
8997
+ "returns": "A function that removes the handler.",
8998
+ "throws": null,
8999
+ "example": null,
9000
+ "defaultValue": null,
9001
+ "guides": []
9002
+ },
8338
9003
  {
8339
9004
  "id": "ARCADE_EMBEDDERS",
8340
9005
  "name": "ARCADE_EMBEDDERS",
@@ -8790,7 +9455,7 @@
8790
9455
  "group": "start",
8791
9456
  "signature": "readonly onScreenshot?: (request: { maxWidth: number; maxHeight: number }) => Promise<ImageBitmap | null>",
8792
9457
  "documented": true,
8793
- "summary": "Supply the screenshot yourself, instead of letting the SDK find it.\n\n**You do not need this to get screenshots.** By default the SDK captures\nyour largest visible canvas, which is right for almost every game.\n\n⚠️ A WebGL game must create its context with `{ preserveDrawingBuffer: true }`\nfor that default to work — without it the SDK refuses the capture rather\nthan sending your team a black image, and your reports arrive with no\npicture. That is a one-line change and NOT a reason to reach for this\noption.\n\nReach for it when the default genuinely cannot work, or when you want a say\nper moment:\n\n- your canvas is an `OffscreenCanvas` driven from a worker, or a WebGPU\n surface — nothing on the page can read either, no flag changes that, and\n the platform reports `unreadable` rather than `unsupported` precisely so\n you do not go looking for a flag;\n- you draw across several layered canvases and want them composited;\n- you want to decline while something specific is on screen.\n\n**Return `null` to decline** — a cutscene, licensed art you may not\nredistribute, another player's private board. Declining is a normal answer,\nnot an error: the player is told a picture was not available and can still\nsend their report. Nothing is logged against you for it, and returning\n`null` unconditionally is how a game opts out of screenshots entirely.\n\n```js\nonScreenshot: async ({ maxWidth, maxHeight }) => {\n if (inCutscene) return null;\n return createImageBitmap(myCanvas);\n}\n```\n\nFit the result within `maxWidth` / `maxHeight` if you can; the SDK\ndownscales for you if you overshoot.",
9458
+ "summary": "Supply the screenshot yourself, instead of letting the SDK find it.\n\n**You do not need this to get screenshots.** By default the SDK captures\nyour largest visible canvas, which is right for almost every game: 2D,\nWebGL or WebGPU, and WITHOUT `preserveDrawingBuffer`, which you should leave\noff. The SDK reads the canvas right after a frame you draw, or keeps the\nlast one you drew before your loop stopped. That needs `createGem` called\nbefore your renderer is made, and drawing inside `requestAnimationFrame`.\n\nReach for it when the default genuinely cannot work, or when you want a say\nper moment:\n\n- your canvas is an `OffscreenCanvas` driven from a worker. Nothing on the\n page can read it, no flag changes that, and the platform reports\n `unreadable` rather than `unsupported` precisely so you do not go looking\n for a flag;\n- you draw outside `requestAnimationFrame`, so there is no moment the SDK\n can read your canvas in: render, then `createImageBitmap(canvas)`, in the\n same task;\n- you draw across several layered canvases and want them composited;\n- you want to decline while something specific is on screen.\n\n**Return `null` to decline** — a cutscene, licensed art you may not\nredistribute, another player's private board. Declining is a normal answer,\nnot an error: the player is told a picture was not available and can still\nsend their report. Nothing is logged against you for it, and returning\n`null` unconditionally is how a game opts out of screenshots entirely.\n\n```js\nonScreenshot: async ({ maxWidth, maxHeight }) => {\n if (inCutscene) return null;\n return createImageBitmap(myCanvas);\n}\n```\n\nFit the result within `maxWidth` / `maxHeight` if you can; the SDK\ndownscales for you if you overshoot.",
8794
9459
  "deprecated": null,
8795
9460
  "params": [],
8796
9461
  "returns": null,
@@ -10383,6 +11048,22 @@
10383
11048
  "defaultValue": null,
10384
11049
  "guides": []
10385
11050
  },
11051
+ {
11052
+ "id": "Gem.settings",
11053
+ "name": "settings",
11054
+ "anchor": "gem-settings",
11055
+ "group": "start",
11056
+ "signature": "readonly settings: GameSettingsApi",
11057
+ "documented": true,
11058
+ "summary": "Mirror up to eight of your game's own settings — Music, Color help, Game\nspeed — into the Arcade's Gem menu, and hear when the player changes one\nthere. Up to two toggles can sit in the menu's quick row.\n\n```js\ngem.settings.declare([\n { id: 'music', label: t('Music'), kind: 'toggle', value: music.on, quick: true, icon: 'music' },\n]);\ngem.settings.onChange(({ id, value }) => {\n if (id === 'music') setMusic(value === true); // even while paused\n});\n```\n\n**A mirror, never a replacement: your game still draws its own settings\nbutton and screen**, and every setting you declare is on that screen too.\nDeclare again whenever your screen changes a value. Never declare the\nArcade's own settings — master volume or mute, vibration, graphics,\ncontrols; they reach you as `gem.prefs`.\n\nSee the guide's \"Game settings\" section.",
11059
+ "deprecated": null,
11060
+ "params": [],
11061
+ "returns": null,
11062
+ "throws": null,
11063
+ "example": null,
11064
+ "defaultValue": null,
11065
+ "guides": []
11066
+ },
10386
11067
  {
10387
11068
  "id": "Gem.analytics",
10388
11069
  "name": "analytics",