Advertisement
pastamaker

one2three4 v1.1

Jun 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
  2. ; #Warn  ; Enable warnings to assist with detecting common errors.
  3. SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
  4. SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
  5.  
  6.  #Include,<hellbents_gdip>
  7.  SetBatchLines,-1
  8.  #MaxHotkeysPerInterval,10000000000
  9.  popUp:=Layered_Window_SetUp(4,0,0,A_ScreenWidth,A_ScreenHeight,1,"Alwaysontop")
  10.  
  11. surfaceArray:=[]
  12.  
  13.  surface1:=new SurfaceClass
  14. map:=surface1.makemap(200,200,"B9DF4B","One")
  15. r:=100
  16. surface1.set(map,550,350,r,0)
  17.  
  18. surfaceArray.Insert(surface1)
  19.  
  20.  surface2:=new SurfaceClass
  21. map:=surface2.makemap(200,200,"4BDFD6","Two")
  22. surface2.set(map,550,350,r,90)
  23.  
  24.  
  25. surfaceArray.Insert(surface2)
  26.  
  27.  
  28. surface3:=new SurfaceClass
  29. map:=surface3.makemap(200,200,"DF4BCB","Three")
  30. surface3.set(map,550,350,r,180)
  31. surfaceArray.Insert(surface3)
  32.  
  33.  
  34.  surface4:=new SurfaceClass
  35. map:=surface4.makemap(200,200,"F31555","Four")
  36. surface4.set(map,550,350,r,270)
  37. surfaceArray.Insert(surface4)
  38.  
  39.  
  40.  
  41.  
  42.  SetTimer,mainloop,10
  43.  
  44.  return
  45.  
  46.  mainloop:
  47. gosub check1
  48. gosub check2
  49. gosub setpos
  50.  Gdip_GraphicsClear(popUp.g)
  51. for i,value in surfaceArray {
  52.     if(value.whetherDraw())
  53.         value.draw(popup.g)
  54.  
  55.  
  56. }
  57.  
  58.  UpdateLayeredWindow(popUp.hwnd, popUp.hdc, popUp.x, popUp.y, popUp.w, popUp.h)
  59.  
  60.  
  61.  
  62.  
  63.  return
  64.  check1:
  65. if(getkeystate("1")){
  66.  for i,value in surfaceArray
  67.     value.angle-=5 - 360
  68. }
  69.  return
  70.  
  71.  check2:
  72. if(getkeystate("2")){
  73.   for i,value in surfaceArray
  74.     value.angle+=5
  75. }
  76.  return
  77.  setpos:
  78. MouseGetPos,x,y
  79.  
  80.   for i,value in surfaceArray
  81.     value.x3:=x, value.y3:=y
  82.  
  83.  return
  84.  
  85.  
  86.  
  87.  
  88.  class SurfaceClass {
  89.     set(map,x3,y3,R,angle){
  90.         this.map:=map
  91.         gdip_GetImageDimensions(map,  w,  h)
  92.         this.w:=w, this.h:=h
  93.         this.x3:=x3,    this.y3:=y3, this.angle:=angle, this.r:=R
  94.     }
  95.     draw(g){
  96.             x1:=this.x3 - this.w/2
  97.             this.angle:=mod(this.angle,360)
  98.             h:=this.h*cosG(this.angle)
  99.             y1:=this.y3 - this.r*sinG(this.angle) - h/2
  100.             Gdip_DrawImage(g,this.map,x1,y1,this.w,h)
  101.            
  102.            
  103.     }
  104.     makemap(w,h,colour,word){
  105.         map:=Gdip_CreateBitmap(w, h)
  106.         g:=Gdip_GraphicsFromImage(map)
  107.         fill_boxX(g,colour,0,0,w,h)
  108.          Gdip_TextToGraphics(g, word,"x0 y0 s65 cff440F1E ", "Segoe Print")
  109.         return map
  110.        
  111.     }
  112.     whetherDraw(){
  113.         this.angle:=mod(this.angle,360)
  114.         if( (this.angle >=0 && this.angle <= 90) or (this.angle > 270 && this.angle <=359 ))
  115.             return true
  116.         return false
  117.     }
  118. }
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  x::
  127.  Layered_Window_ShutDown(popUp)
  128.  ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement