Advertisement
TheHirou

Untitled

Apr 30th, 2023
929
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //////////////////////
  2. //CREATION EVENT
  3. //////////////////////
  4. //Timer for animations
  5. timer=0
  6.  
  7. //Activation variables
  8. init[0]=false
  9. init[1]=false
  10.  
  11. //Deactivation variables
  12. deactivate[0]=false
  13.  
  14. //Set window init size
  15. winW=640
  16. winH=480
  17.  
  18. //Load video
  19. videoFile="video.mp4"
  20. video=video_open(videoFile)
  21. video_enable_loop(false)
  22.  
  23. //Resize surface
  24. surface_resize(application_surface,winW,winH)
  25.  
  26. //////////////////////
  27. //STEP EVENT
  28. //////////////////////
  29. if keyboard_check_pressed(ord("R"))
  30. {
  31.     game_restart() 
  32. }
  33.  
  34. window_set_size(winW,winH) 
  35. surface_resize(application_surface,winW,winH)
  36. window_center()
  37.  
  38. //Animation of window
  39. timer++
  40.  
  41. if timer>10 and init[0]=false
  42. {
  43.     init[0]=true   
  44. }
  45.    
  46. if init[0]=true and winH>360 and deactivate[0]=false
  47. {
  48.     winH--
  49. }
  50.  
  51. if timer>60*3
  52. {
  53.     init[1]=true
  54.     deactivate[0]=true
  55. }
  56.  
  57. if init[1]=true
  58. {
  59.     if winH<540
  60.     {
  61.         winH+=1.1
  62.     }
  63.    
  64.     if winW<960
  65.     {
  66.         winW+=2
  67.     }
  68. }
  69.  
  70. if timer>60*6
  71. {
  72.     winW=960
  73.     winH=540
  74. }
  75.  
  76. //////////////////////
  77. //DRAW GUI EVENT
  78. //////////////////////
  79. //Test sprite
  80. draw_sprite(sprGuide,0,winW/2,winH/2)
  81.  
  82.  
  83. //Video
  84. var _videoData=video_draw();
  85. var _videoStatus=_videoData[0];
  86. if (_videoStatus==0)
  87. {
  88.    
  89. var vidWid=960     /2
  90. var vidHei=540     /2
  91. draw_surface(_videoData[1],(winW/2)-vidWid,(winH/2)-vidHei)
  92. }
  93.  
  94.  
  95. //Debug
  96. draw_set_color(c_black)
  97. draw_text(10,100,"H "+string(winH))
  98. draw_text(10,130,"W "+string(winW))
  99. draw_text(10,160,"Placeholder video loaded: "+string(videoFile))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement