¡¥á¥Ë¥å¡¼¤ò¡ÖÉÁ²è¤¬¤¹¤ë¤«¤·¤Ê¤¤¤«¡×¤ÎÊÑ¿ô¤òÍÑ°Õ¤¹¤ë
¢¥«¡¼¥½¥ëºÂɸ¤¬¤¢¤ëÈÏ°ÏÆâ¤Ë¸ºß¤¹¤ë¤«¤ò¼èÆÀ¤¹¤ë
°Ê²¼¤Ï¼èÆÀ¤¹¤ë¥â¥¸¥å¡¼¥ë¡£
#module __HSP3MEX__
#deffunc minit
W = (ginfo(10) - ginfo(12)) / 2
T = ginfo(11) - ginfo(13) - W
return 0
#undef mousex
#defcfunc mousex
return ginfo(0) - ginfo(4) - W
#undef mousey
#defcfunc mousey
return ginfo(1) - ginfo(5) - T
#defcfunc GetMouseRectPointer int prm1, int prm2, int prm3, int prm4
minit
x1 = prm1
y1 = prm2
x2 = prm3
y2 = prm4
if mousex() >= x1 & mousey() >= y1 & mousex() <= x2 & mousey() <= y2 {
return 1
}
return 0
#global
// ÊÑ¿ôÀë¸À
MenuButtonSize = 32 ; ¥á¥Ë¥å¡¼¥Ü¥¿¥ó¤Î¥µ¥¤¥º(ÀµÊý·Á¤È¤¹¤ë)
// ¥á¥¤¥ó½èÍý
repeat
redraw 0
color 255, 255, 255
boxf
color 40, 40, 40
boxf 0, ( 480 - MenuButtonSize ), MenuButtonSize, 480
if GetMouseRectPointer( 0, ( 480 - MenuButtonSize ), MenuButtonSize, 480 ) {
title "¥á¥Ë¥å¡¼¥Ü¥¿¥ó¤Î½ê¤Ë¥«¡¼¥½¥ë¤òȯ¸«¡ª"
} else {
title "ºÂɸXY " + mousex() + " , " + mousey()
}
redraw 1
await 16
loop
¢¨Ä̾ï¤ÎHSP´Ø¿ô mousex mousey ¤¬ mousex() mousey() ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ï¡¢
¡¡¥ª¥Ö¥¸¥§¥¯¥È¾å¤Ë¥Þ¥¦¥¹¤¬¹ç¤Ã¤Æ¤â¼èÆÀ¤¹¤ë¤¿¤á¤Ç¤¹¡£
¡¡¸µ´Ø¿ô¤¬Â¸ºß¤·¤¿¾ì¹ç¤ÏÃÖ´¹¤«²¿¤«¤Ç½¤Àµ¤·¤Æ¤¯¤À¤µ¤¤¡£
£¢¤Î¥â¥¸¥å¡¼¥ë¤Î GetMouseRectPointer´Ø¿ô ¤¬ÈÏ°ÏÆâ¤Ë¤Ê¤ë¤ÈTRUE(1)¤Ë¤Ê¤ê¡¢
¡¡¤½¤ì°Ê³°¤À¤ÈFALSE(0)¤Ë¤Ê¤ë¤³¤È¤òÍÞ¤¨¤ë¡£
¤¾åµ¤Î¿·´Ø¿ô¤ÇÌá¤êÃͤ¬ TRUE ¤Î»þ¤Ë stick Ì¿Îá¤Ç º¸¥¯¥ê¥Ã¥¯ ¤ò¤·¤¿»þ¤Ë
¡¡¡¤ÎÊÑ¿ô¤ò ÊÑ¿ô = ÊÑ¿ô ^ 1 ¤Ë¤¹¤ë¡£
¡¡¢¬¤Ë¤¹¤ë¤³¤È¤Ç ÊÑ¿ô¤¬FALSE¤Î»þ¤ËTRUE¤Ë¤Ê¤ê¡¢TRUE¤Î»þ¤ËFALSE¤Ë¤Ê¤ë¡£
¥¡¤ÎÊÑ¿ô¤¬TRUE¤Î»þ¤Ë¥á¥Ë¥å¡¼¤È¤Ê¤ëÉÁ²èÌ¿Îá¤òµÆþ¤¹¤ì¤Ð´°À®¤È¤Ê¤ë¡£
·ë¶É¤Ï°Ê²¼¤Î¥¹¥¯¥ê¥×¥È¤Ë¤Ê¤ë¡£
#module __HSP3MEX__
#deffunc minit
W = (ginfo(10) - ginfo(12)) / 2
T = ginfo(11) - ginfo(13) - W
return 0
#undef mousex
#defcfunc mousex
return ginfo(0) - ginfo(4) - W
#undef mousey
#defcfunc mousey
return ginfo(1) - ginfo(5) - T
#defcfunc GetMouseRectPointer int prm1, int prm2, int prm3, int prm4
minit
x1 = prm1
y1 = prm2
x2 = prm3
y2 = prm4
if mousex() >= x1 & mousey() >= y1 & mousex() <= x2 & mousey() <= y2 {
return 1
}
return 0
#global
// ÊÑ¿ôÀë¸À
MenuFlag = 0 ; ¥á¥Ë¥å¡¼¤ò¡ÖÉÁ²è¤¬¤¹¤ë¤«¤·¤Ê¤¤¤«¡×
MenuButtonSize = 32 ; ¥á¥Ë¥å¡¼¥Ü¥¿¥ó¤Î¥µ¥¤¥º(ÀµÊý·Á¤È¤¹¤ë)
// ¥á¥¤¥ó½èÍý
repeat
stick key ; ¥¡¼´ÉÍý
redraw 0
color 255, 255, 255
boxf
color 40, 40, 40
boxf 0, ( 480 - MenuButtonSize ), MenuButtonSize, 480
if GetMouseRectPointer( 0, ( 480 - MenuButtonSize ), MenuButtonSize, 480 ) {
title "¥á¥Ë¥å¡¼¤Î½ê¤Ë¥«¡¼¥½¥ë¤òȯ¸«¡ª"
if key = 256 {
dialog "¥¯¥ê¥Ã¥¯!!"
MenuFlag ^= 1
}
} else {
title "ºÂɸXY " + mousex() + " , " + mousey()
}
if MenuFlag = 1 {
color 0, 128, 255
boxf 0, 0, 160, ( 480 - MenuButtonSize )
}
redraw 1
await 16
loop
¤³¤ì¤Ï¼«¸ÊÃ濴Ū¤Ëºî¤Ã¤¿¼êÈ´¤¥¹¥¯¥ê¥×¥È¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò»È¤ï¤Ê¤¤ÇɤΤä¤êÊý¤Ê¤Î¤Ç¡¢
¥ª¥Ö¥¸¥§¥¯¥È¤ò»È¤¦Çɤʤ顥¡¥¡¥´èÄ¥¤Ã¤Æ¤¯¤ì¡£