?? hit.c
字號:
#include "mouse.h"
#include "guide.h"
void main()
{
int xmouse=0,ymouse=0,btnmouse=0,xmouse_old=0,ymouse_old=0;
sprite small;
pcx_picture background_pcx,objects_pcx;
Set_Video_Mode(VGA256);
PCX_Load_Screen("mouse.pcx",(pcx_picture_ptr)&objects_pcx,1);
Sprite_Init_Size((sprite_ptr)&small,0,0,0,0,0,0,8,4,1);
PCX_Grab_Bitmap_Size_Screen((pcx_picture_ptr)&objects_pcx,(sprite_ptr)&small,0,0,0,8,4);/*將屏幕內容復制給小圖片*/
Fill_Screen(0);
PCX_Load_Screen("hit.pcx",(pcx_picture_ptr)&objects_pcx,1);/*背景*/
Behind_Sprite_Size((sprite_ptr)&small,8,4);/*取圖片后內容*/
Squeeze_Mouse(MOUSE_RESET,0,0,0);/*初始化鼠標*/
mscurson(lin);/*設置鼠標形狀*/
Squeeze_Mouse(MOUSE_HIDE,0,0,0);/*隱藏鼠標*/
Init_All();
while(1)
{
Squeeze_Mouse(MOUSE_BUTT_POS,&xmouse,&ymouse,&btnmouse);//取鼠標位置
Judge();
if(xmouse!=xmouse_old||ymouse!=ymouse_old) //判斷是否移動過鼠標
{
Erase_Sprite_Size((sprite_ptr)&small,8,4);//顯示小圖片后背景內容
small.x=xmouse/2;
small.y=ymouse;
Behind_Sprite_Size((sprite_ptr)&small,8,4);//保存小圖片后背景內容
Draw_Sprite_Size((sprite_ptr)&small,8,4);//顯示小圖片于鼠標位置
xmouse_old=xmouse;
ymouse_old=ymouse;
}
}
dispose();
Set_Video_Mode(TEXT_MODE);
exit(0);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -