游戏的GitHub项目地址:https://github.com/Spawnova/ShinsGameClass?tab=readme-ov-file

包含v1和v2版,可供大家学习。

 

项目打包下载:

蓝奏云:https://wwp.lanzouj.com/inxOh1xvegde   提取码:ahk6

123网盘:https://www.123pan.com/s/ufi3Td-mCO53.html   提取码:ahk6

 

轻量游戏Class

direct2d 游戏/图形类自动热键V1.1自动热键V2,用户友好且快速。支持运行 Windows 7+(包括最新的 Windows 11)的 32 位和 64 位系统。

功能(可能并不总是最新的)

 

#BeginDraw................Begins the drawing process, MUST ALWAYS start with BeginDraw(), if attached to window returns 1 if window is available, 0 otherwise
BeginDraw()

#EndDraw..................End the drawing process,  MUST ALWAYS end with EndDraw()
EndDraw()

#DrawImage................Draw an image
DrawImage(image,dstX,dstY,dstW:=0,dstH:=0,srcX:=0,srcY:=0,srcW:=0,srcH:=0,alpha:=1,drawCentered:=0,rotation:=0)

#DrawText.................Draws text, supports a dropshadow if a valid color is supplied
DrawText(text,x,y,size:=18,color:=0xFF000000,fontName:="Arial",extraOptions:="") #see the comments above the function in the class file for more info

#DrawEllipse..............Draws an ellipse
DrawEllipse(x, y, w, h, color, thickness:=1)

#FillEllipse..............Fills an ellipse
FillEllipse(x, y, w, h, color)

#DrawCircle...............Draw a circle
DrawCircle(x, y, radius, color, thickness:=1)

#FillCircle...............Fill a circle
FillCircle(x, y, radius, color)

#DrawRectangle............Draws a rectangle
DrawRectangle(x, y, w, h, color, thickness:=1)

#FillRectangle............Fills a rectangle
FillRectangle(x, y, w, h, color)

#DrawRoundedRectangle.....Draw a rectangle with rounded corners
DrawRoundedRectangle(x, y, w, h, radiusX, radiusY, color, thickness:=1)

#FillRoundedRectangle.....Fill a rectangle with rounded corners
FillRoundedRectangle(x, y, w, h, radiusX, radiusY, color)

#DrawLine.................Draws a line from 2 positions
DrawLine(x1,y1,x2,y2,color,thickness:=1,rounded:=0)

#DrawLines................Draws an array of lines, points must be in an array [[x,y],[x,y]] etc.
DrawLines(points,color,connect:=0,thickness:=1,rounded:=0)

#DrawPolygon..............Draws a polygon outline, points must be in an array [[x,y],[x,y]] etc.
DrawPolygon(points,color,thickness:=1,rounded:=0,xOffset:=0,yOffset:=0)

#FillPolygon..............Fill a polygon, points must be in an array [[x,y],[x,y]] etc.
FillPolygon(points,color,xoffset:=0,yoffset:=0)

#SetPosition..............Sets the overlay position, only when not attached
SetPosition(x:=-1,y:=-1,w:=0,h:=0)

#GetImageDimensions.......Gets the width and height of a cached image
GetImageDimensions(image,byref w, byref h)

#GetMousePos..............Gets the mouse position relative to the overlay, additionally returns true if the mouse is inside the overlay, 0 otherwise
GetMousePos(byref x, byref y, realRegionOnly:=0)

#GetDistance..............Get the distance between 2 points
GetDistance(x1,y1,x2,y2)

#MouseInRegion............Checks if the mouse is within a specified region
MouseInRegion(x1,y1,x2,y2)

#SetClearColor............Sets the color of the background when the scene is cleared on EndDraw()
SetClearColor(color:=0x222222)
笔记
  • 现已支持 AHK V2!
  • 我仅在我这边进行了测试,并且可以确认它对我在 Windows 10 上使用 32/64 位 AHK_L (AHK V1.1) 和 AHK V2 有效。
  • 如果这对您不起作用,请告诉我,我也许可以提供帮助,也可以不可以,这取决于您的情况。
声明:站内资源为整理优化好的代码上传分享与学习研究,如果是开源代码基本都会标明出处,方便大家扩展学习路径。请不要恶意搬运,破坏站长辛苦整理维护的劳动成果。本站为爱好者分享站点,所有内容不作为商业行为。如若本站上传内容侵犯了原著者的合法权益,请联系我们进行删除下架。