diff --git a/apps/client/src/scenes/game/GameView.tsx b/apps/client/src/scenes/game/GameView.tsx index e2880c7..3556e13 100644 --- a/apps/client/src/scenes/game/GameView.tsx +++ b/apps/client/src/scenes/game/GameView.tsx @@ -3,7 +3,7 @@ * ゲーム画面の描画専用コンポーネント * タイマー表示,PixiJSの描画領域,入力UIの配置のみを担当する */ -import { JoystickInputPresenter } from "./input/joystick/JoystickInputPresenter"; +import { GameInputOverlay } from "./input/GameInputOverlay"; /** 表示と入力に必要なプロパティ */ type Props = { @@ -45,30 +45,6 @@ zIndex: 1, }; -const UI_LAYER_STYLE: React.CSSProperties = { - position: "absolute", - zIndex: 20, - width: "100%", - height: "100%", -}; - -const BOMB_BUTTON_STYLE: React.CSSProperties = { - position: "fixed", - right: "36px", - bottom: "40px", - width: "96px", - height: "96px", - borderRadius: "50%", - border: "2px solid rgba(255,255,255,0.75)", - background: "rgba(220, 60, 60, 0.85)", - color: "white", - fontSize: "18px", - fontWeight: "bold", - zIndex: 9999, - pointerEvents: "auto", - touchAction: "manipulation", -}; - const TimerOverlay = ({ timeLeft }: { timeLeft: string }) =>
{timeLeft}
; /** 画面描画と入力UIをまとめて描画する */ @@ -81,13 +57,8 @@ {/* PixiJS Canvas 配置領域 */}
- {/* UI 配置領域 */} -
- - -
+ {/* 入力UI レイヤー */} +
); }; diff --git a/apps/client/src/scenes/game/input/GameInputOverlay.tsx b/apps/client/src/scenes/game/input/GameInputOverlay.tsx new file mode 100644 index 0000000..17e30b8 --- /dev/null +++ b/apps/client/src/scenes/game/input/GameInputOverlay.tsx @@ -0,0 +1,30 @@ +/** + * GameInputOverlay + * ゲーム入力UIレイヤーを構成する + * ジョイスティック層と爆弾ボタン層を分離して配置する + */ +import { JoystickInputPresenter } from "./joystick/JoystickInputPresenter"; +import { BombButton } from "./bomb/BombButton"; + +/** 入力UIレイヤーの入力プロパティ */ +type GameInputOverlayProps = { + onJoystickInput: (x: number, y: number) => void; + onPlaceBomb: () => void; +}; + +const UI_LAYER_STYLE: React.CSSProperties = { + position: "absolute", + zIndex: 20, + width: "100%", + height: "100%", +}; + +/** 入力UIレイヤーを描画する */ +export const GameInputOverlay = ({ onJoystickInput, onPlaceBomb }: GameInputOverlayProps) => { + return ( +
+ + +
+ ); +}; diff --git a/apps/client/src/scenes/game/input/bomb/BombButton.tsx b/apps/client/src/scenes/game/input/bomb/BombButton.tsx new file mode 100644 index 0000000..68bd4ad --- /dev/null +++ b/apps/client/src/scenes/game/input/bomb/BombButton.tsx @@ -0,0 +1,36 @@ +/** + * BombButton + * 爆弾設置ボタンの見た目とクリック入力を担う + * 画面右下固定の操作ボタンを提供する + */ + +/** 爆弾設置ボタンの入力プロパティ */ +type BombButtonProps = { + onPress: () => void; +}; + +const BOMB_BUTTON_STYLE: React.CSSProperties = { + position: "fixed", + right: "36px", + bottom: "40px", + width: "96px", + height: "96px", + borderRadius: "50%", + border: "2px solid rgba(255,255,255,0.75)", + background: "rgba(220, 60, 60, 0.85)", + color: "white", + fontSize: "18px", + fontWeight: "bold", + zIndex: 9999, + pointerEvents: "auto", + touchAction: "manipulation", +}; + +/** 画面右下の爆弾設置ボタンを描画する */ +export const BombButton = ({ onPress }: BombButtonProps) => { + return ( + + ); +};