music_quiz: 버튼 머리 hitbox 정확한 면 정합 + 라벨 text_display 자동 부착
오프셋 부호 정정 (v1.0.16 까지 모든 버전이 잘못된 convention 사용): stone_button[face=wall, facing=X] AABB 는 facing X 쪽 face 에 붙어 안쪽 1/8 만 채움. 따라서 머리 hitbox center 는: south z = 0.0625 (이전 -0.0625) north z = 0.9375 (이전 1.0625) east x = 0.0625 (이전 -0.0625) west x = 0.9375 (이전 1.0625) 이전 부호는 머리 face 의 normal 방향 쪽으로 머리가 "튀어나온다" 라 가정했는데 실제로는 face 의 안쪽 1/8 로 들어가는 구조였음. 그 결과 v1.0.16 의 width=0.125 interaction 은 머리와 겹치지 않고 옆에 떠 있어 (touch only at edge) 클릭이 안 됨. 라벨 text_display 추가 (사용자 요청): - button_defs 항목에 optional label, label_color, label_font, label_scale 추가. 색 기본 black, 폰트 기본 minecraft:default, 크기 기본 1.0. - handler 가 btn_prep 로 기본값 채운 뒤 btn 호출 — 매크로 인자 미존재 에러 회피. - btn 안에서 facing 별 위치/yaw 로 text_display 1개 summon. 같은 벽 (button 머리 반대편 블록) 의 visible 면에 ~0.01 띄워 부착, y-1. - background:0 (투명) 으로 벽에 직접 새긴 느낌. - label 이 빈 문자열이면 summon 스킵. commands/stop 에 stale text_display 정리도 추가 — 옛 정의 이름으로 남은 라벨이 reload 후에도 지워지지 않는 문제 방지.
This commit is contained in:
@@ -4,14 +4,20 @@
|
||||
# f : facing (south / north / east / west)
|
||||
# c : 클릭 시 실행 명령 (init=0 직접, 그 외 trigger $(n) 투표)
|
||||
#
|
||||
# interaction entity 의 위치/크기는 facing 만 보면 결정됨 — 매번 손으로
|
||||
# ox/oy/oz/w/h 를 적지 않는다. 실제 오프셋 테이블은 repeat/buttons/btn
|
||||
# 안에서 한 곳에만 정의되어 있다 (stone_button[face=wall] 면 정합용).
|
||||
# optional 필드 (버튼 아래 y-1 위치에 같은 벽면 라벨 부착):
|
||||
# label : 표시할 텍스트. 생략하면 라벨 없음.
|
||||
# label_color : 텍스트 색 (예 "black", "red", "#FFAA00"). 기본 "black".
|
||||
# label_font : 텍스트 폰트 (예 "minecraft:default"). 기본 "minecraft:default".
|
||||
# label_scale : 텍스트 크기 (Vector3f 한 축, 3축 동일). 기본 "1.0".
|
||||
#
|
||||
# interaction entity 의 위치/크기와 text_display 의 위치/회전은 facing 만
|
||||
# 보면 결정됨 — 매번 손으로 ox/oy/oz 를 적지 않는다. 실제 오프셋 테이블은
|
||||
# repeat/buttons/btn 안에서 한 곳에만 정의되어 있다.
|
||||
|
||||
data modify storage mq:main button_defs set value []
|
||||
data modify storage mq:main button_defs append value {n:"start", x:364, y:146, z:-263, f:"east", c:"function mq:commands/start with storage mq:main"}
|
||||
data modify storage mq:main button_defs append value {n:"stop", x:364, y:146, z:-265, f:"east", c:"function mq:commands/stop with storage mq:main"}
|
||||
data modify storage mq:main button_defs append value {n:"skip", x:364, y:146, z:-267, f:"east", c:"function mq:commands/skip"}
|
||||
data modify storage mq:main button_defs append value {n:"hint", x:364, y:146, z:-269, f:"east", c:"function mq:commands/hint"}
|
||||
data modify storage mq:main button_defs append value {n:"replay", x:364, y:146, z:-271, f:"east", c:"function mq:commands/replay"}
|
||||
data modify storage mq:main button_defs append value {n:"test", x:144, y:62, z:-213, f:"north", c:"function mq:commands/test"}
|
||||
data modify storage mq:main button_defs append value {n:"start", x:364, y:146, z:-263, f:"east", c:"function mq:commands/start with storage mq:main", label:"게임시작"}
|
||||
data modify storage mq:main button_defs append value {n:"stop", x:364, y:146, z:-265, f:"east", c:"function mq:commands/stop with storage mq:main", label:"정지"}
|
||||
data modify storage mq:main button_defs append value {n:"skip", x:364, y:146, z:-267, f:"east", c:"function mq:commands/skip", label:"넘기기"}
|
||||
data modify storage mq:main button_defs append value {n:"hint", x:364, y:146, z:-269, f:"east", c:"function mq:commands/hint", label:"힌트"}
|
||||
data modify storage mq:main button_defs append value {n:"replay", x:364, y:146, z:-271, f:"east", c:"function mq:commands/replay", label:"다시듣기"}
|
||||
data modify storage mq:main button_defs append value {n:"test", x:144, y:62, z:-213, f:"north", c:"function mq:commands/test", label:"소리 테스트"}
|
||||
|
||||
Reference in New Issue
Block a user