added snes icons

pull/685/head
Greenlamp 2024-05-12 14:18:48 +02:00
parent 3938975710
commit a2dd704737
6 changed files with 117 additions and 9 deletions

View File

@ -0,0 +1,108 @@
{"frames": [
{
"filename": "select.png",
"frame": {"x":0,"y":0,"w":128,"h":128},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
"sourceSize": {"w":128,"h":128}
},
{
"filename": "start.png",
"frame": {"x":128,"y":0,"w":128,"h":128},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
"sourceSize": {"w":128,"h":128}
},
{
"filename": "T_X_A_White_Alt.png",
"frame": {"x":256,"y":0,"w":128,"h":128},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
"sourceSize": {"w":128,"h":128}
},
{
"filename": "T_X_B_White_Alt.png",
"frame": {"x":384,"y":0,"w":128,"h":128},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
"sourceSize": {"w":128,"h":128}
},
{
"filename": "T_X_Dpad_Down_Alt.png",
"frame": {"x":512,"y":0,"w":128,"h":128},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
"sourceSize": {"w":128,"h":128}
},
{
"filename": "T_X_Dpad_Left_Alt.png",
"frame": {"x":640,"y":0,"w":128,"h":128},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
"sourceSize": {"w":128,"h":128}
},
{
"filename": "T_X_Dpad_Right_Alt.png",
"frame": {"x":768,"y":0,"w":128,"h":128},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
"sourceSize": {"w":128,"h":128}
},
{
"filename": "T_X_Dpad_Up_Alt.png",
"frame": {"x":896,"y":0,"w":128,"h":128},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
"sourceSize": {"w":128,"h":128}
},
{
"filename": "T_X_LB_Alt.png",
"frame": {"x":1024,"y":0,"w":128,"h":128},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
"sourceSize": {"w":128,"h":128}
},
{
"filename": "T_X_RB_Alt.png",
"frame": {"x":1152,"y":0,"w":128,"h":128},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
"sourceSize": {"w":128,"h":128}
},
{
"filename": "T_X_X_White_Alt.png",
"frame": {"x":1280,"y":0,"w":128,"h":128},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
"sourceSize": {"w":128,"h":128}
},
{
"filename": "T_X_Y_White_Alt.png",
"frame": {"x":1408,"y":0,"w":128,"h":128},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":128,"h":128},
"sourceSize": {"w":128,"h":128}
}],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "1.0",
"image": "snes.png",
"format": "RGBA8888",
"size": {"w":1536,"h":128},
"scale": "1",
"smartupdate": "$TexturePacker:SmartUpdate:86d994650b80a3f876cc92e4d0928a65:60b6f706b30e87e11c3d01cec0eccf9c:7e443c950e063b6a235f0fd6295e2000$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@ -22,12 +22,12 @@ const pad_unlicensedSNES = {
LC_E: 15
},
icons: {
RC_S: "T_X_B_Color_Alt.png",
RC_E: "T_X_A_Color_Alt.png",
RC_W: "T_X_Y_Color_Alt.png",
RC_N: "T_X_X_Color_Alt.png",
START: "T_X_X_Alt.png",
SELECT: "T_X_Share_Alt.png",
RC_S: "T_X_B_White_Alt.png",
RC_E: "T_X_A_White_Alt.png",
RC_W: "T_X_Y_White_Alt.png",
RC_N: "T_X_X_White_Alt.png",
START: "start.png",
SELECT: "select.png",
LB: "T_X_LB_Alt.png",
RB: "T_X_RB_Alt.png",
LC_N: "T_X_Dpad_Up_Alt.png",

View File

@ -662,8 +662,7 @@ export class InputsController {
* @returns Array Tuple containing the pad type and the currently assigned icon for the button index.
*/
getPressedButtonLabel(button: Phaser.Input.Gamepad.Button): [string, string] {
const type = this.configs[this.chosenGamepad].padType;
return [type === 'snes' ? 'xbox' : type, getCurrenlyAssignedIconFromInputIndex(this.configs[this.chosenGamepad], button.index)];
return [this.configs[this.chosenGamepad].padType, getCurrenlyAssignedIconFromInputIndex(this.configs[this.chosenGamepad], button.index)];
}
/**

View File

@ -216,6 +216,7 @@ export class LoadingScene extends SceneBase {
this.loadAtlas('dualshock', 'inputs');
this.loadAtlas('nswitch', 'inputs');
this.loadAtlas('xbox', 'inputs');
this.loadAtlas('snes', 'inputs');
this.loadSe('select');
this.loadSe('menu_open');

View File

@ -144,7 +144,7 @@ export default class SettingsGamepadUiHandler extends UiHandler {
}
// For null options, add an icon for the key.
const key = getKeyForSettingName(config as GamepadConfig, SettingGamepad[setting]);
const icon = this.scene.add.sprite(0, 0, config.padType === 'snes' ? 'xbox' : config.padType);
const icon = this.scene.add.sprite(0, 0, config.padType);
icon.setScale(0.1);
icon.setOrigin(0, -0.1);
inputsIcons[key] = icon;