stylet 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.travis.yml +4 -0
  4. data/.yardopts +2 -0
  5. data/Gemfile +16 -0
  6. data/README.org +19 -0
  7. data/Rakefile +17 -0
  8. data/bin/setup +63 -0
  9. data/bin/stylet +8 -0
  10. data/examples/.ruby-version +1 -0
  11. data/examples/00100_lib_hello_world.rb +8 -0
  12. data/examples/00110_lib_sge_check.rb +6 -0
  13. data/examples/00120_lib_/343/202/254/343/203/263/343/203/236/345/200/244/343/201/256/345/244/211/346/233/264.rb +22 -0
  14. data/examples/00130_lib_window_title.rb +8 -0
  15. data/examples/00140_lib_callbacks.rb +8 -0
  16. data/examples/00150_lib_vector.rb +5 -0
  17. data/examples/00160_lib_run.rb +4 -0
  18. data/examples/00170_lib_frame.rb +4 -0
  19. data/examples/00180_lib_config/347/242/272/350/252/215.rb +7 -0
  20. data/examples/00190_lib_/343/201/231/343/201/271/343/201/246/345/220/214/343/201/230/343/202/252/343/203/226/343/202/270/343/202/247/343/202/257/343/203/210.rb +10 -0
  21. data/examples/00200_lib_/343/203/254/343/202/267/343/203/274/343/203/220/343/203/274/343/202/222/347/234/201/347/225/245/343/201/231/343/202/213/346/226/271/346/263/225/343/201/256/343/203/206/343/202/271/343/203/210.rb +28 -0
  22. data/examples/00210_lib_delegators.rb +7 -0
  23. data/examples/00220_lib_template_method.rb +13 -0
  24. data/examples/00230_lib_/350/203/214/346/231/257/347/224/273/345/203/217/350/241/250/347/244/272.rb +9 -0
  25. data/examples/00240_lib_/350/203/214/346/231/257/347/224/273/345/203/217/343/202/222/346/232/227/343/201/2171_/351/273/222/343/201/256/344/270/212/343/201/253/350/203/214/346/231/257.rb +18 -0
  26. data/examples/00250_lib_/350/203/214/346/231/257/347/224/273/345/203/217/343/202/222/346/232/227/343/201/2172_/350/203/214/346/231/257/343/201/256/344/270/212/343/201/253/351/273/222.rb +17 -0
  27. data/examples/00260_lib_/350/203/214/346/231/257/347/224/273/345/203/217/343/202/222/346/232/227/343/201/2173_/350/203/214/346/231/257/343/201/256/344/270/212/343/201/253/351/273/222_/347/224/273/351/235/242/343/202/265/343/202/244/343/202/272/343/203/225/343/202/243/343/203/203/343/203/210_/351/207/215/343/201/204.rb +27 -0
  28. data/examples/00270_lib_/350/203/214/346/231/257/347/224/273/345/203/217/343/202/222/346/232/227/343/201/2173_/350/203/214/346/231/257/343/201/256/344/270/212/343/201/253/351/273/222_/347/224/273/351/235/242/343/202/265/343/202/244/343/202/272/343/203/225/343/202/243/343/203/203/343/203/210_/351/253/230/351/200/237/345/214/226.rb +44 -0
  29. data/examples/00280_lib_/347/211/271/345/256/232/343/201/256/343/202/250/343/203/252/343/202/242/343/201/240/343/201/221/345/276/220/343/200/205/343/201/253/346/266/210/343/201/231.rb +26 -0
  30. data/examples/00290_lib_/350/203/214/346/231/257/350/211/262/345/244/211/346/233/264.rb +5 -0
  31. data/examples/00300_lib_/343/202/255/343/203/243/343/203/251/343/202/257/343/202/277/347/224/273/345/203/217/343/202/222/350/241/250/347/244/272/343/201/231/343/202/213/344/276/213.rb +17 -0
  32. data/examples/00310_lib_/343/202/255/343/203/243/343/203/251/343/202/257/343/202/277/347/224/273/345/203/217/343/201/256/343/202/242/343/203/213/343/203/241/343/203/274/343/202/267/343/203/247/343/203/263.rb +18 -0
  33. data/examples/00320_lib_/343/202/255/343/203/243/343/203/251/343/202/257/343/202/277/346/213/241/345/244/247/347/270/256/345/260/217/345/233/236/350/273/242.rb +21 -0
  34. data/examples/00330_joystick.rb +5 -0
  35. data/examples/00340_joystick_PS3/343/202/242/343/203/212/343/203/255/343/202/260/343/203/254/343/203/220/343/203/274/343/201/256/345/213/225/343/201/215/343/201/214/345/206/205/351/203/250/343/201/247/343/201/257/345/233/233/350/247/222.rb +30 -0
  36. data/examples/00350_joystick_PS3/343/202/242/343/203/212/343/203/255/343/202/260/343/203/254/343/203/220/343/203/274/343/201/256/350/252/277/346/225/264/346/270/210/343/201/277/343/203/231/343/202/257/343/203/210/343/203/253.rb +12 -0
  37. data/examples/00360_lib_mouse.rb +5 -0
  38. data/examples/00370_lib_input.rb +29 -0
  39. data/examples/00380_lib_vputs_align.rb +8 -0
  40. data/examples/00390_/343/203/225/343/202/251/343/203/263/343/203/210/344/270/200/350/246/247.rb +15 -0
  41. data/examples/00400_lib_draw_circle.rb +8 -0
  42. data/examples/00410_SDL/343/201/256draw_rect/343/201/2571/343/203/224/343/202/257/343/202/273/343/203/253/344/275/231/345/210/206/343/201/253/346/217/217/347/224/273/343/201/225/343/202/214/343/202/213/343/201/256/343/201/247/346/263/250/346/204/217.rb +7 -0
  43. data/examples/00420_circle_on_circle.rb +10 -0
  44. data/examples/00430_rotate.rb +16 -0
  45. data/examples/00440_draw_triangle.rb +7 -0
  46. data/examples/00450_parabora_triangle.rb +37 -0
  47. data/examples/00460_ice_hockey.rb +88 -0
  48. data/examples/00470_collision_block_vs_block.rb +120 -0
  49. data/examples/00480_simple_circle_controll.rb +37 -0
  50. data/examples/00490_/347/255/211/351/200/237/347/247/273/345/213/225_uniform_velocity_rain.rb +51 -0
  51. data/examples/00500_/345/212/240/351/200/237/346/224/276/347/211/251/347/267/232_parabora_volcano.rb +94 -0
  52. data/examples/00510_3d.rb +53 -0
  53. data/examples/00520_/343/203/210/343/203/253/343/203/215/343/201/256/343/203/241/343/203/213/343/203/245/343/203/274/351/242/250/343/201/256/345/213/225/343/201/215.rb +77 -0
  54. data/examples/00530_curve_2/346/254/241/343/203/231/343/202/270/343/202/247/346/233/262/347/267/232/343/201/250/347/233/264/347/267/232/343/201/250/343/201/256/344/272/244/347/202/271.rb +43 -0
  55. data/examples/00540_curve_3/346/254/241/343/203/231/343/202/270/343/202/247/346/233/262/347/267/232.rb +40 -0
  56. data/examples/00550_curve_N/346/254/241/343/203/231/343/202/270/343/202/247/346/233/262/347/267/232.rb +92 -0
  57. data/examples/00560_curve_/343/202/271/343/203/227/343/203/251/343/202/244/343/203/263/346/233/262/347/267/232.rb +113 -0
  58. data/examples/00570_/345/206/206/351/201/213/345/213/225_circle_jet_coaster.rb +52 -0
  59. data/examples/00580_/345/206/206/343/202/222/346/212/274/343/201/231/343/201/262/343/201/243/343/201/261/343/202/213_collision_circle_vs_circle_push_or_pull.rb +56 -0
  60. data/examples/00590_/350/212/213/350/231/253/343/202/264/343/203/240/347/264/220/343/203/207/343/203/242_collision_demo_circle_worm.rb +104 -0
  61. data/examples/00600_/346/214/257/343/202/212/345/255/220_swing.rb +145 -0
  62. data/examples/00610_/345/206/205/347/251/215/343/201/250/345/244/226/347/251/215_inner_product.rb +36 -0
  63. data/examples/00620_/346/263/225/347/267/232/343/203/231/343/202/257/343/203/210/343/203/253.rb +23 -0
  64. data/examples/00630_/345/206/206/343/201/250/345/206/206/343/201/256/345/217/215/345/260/204_collision_reflect_circle_vs_circle.rb +222 -0
  65. data/examples/00640_/347/202/271/343/201/250/347/267/232/345/210/206/343/201/256/344/272/244/345/267/256/345/210/244/345/256/232_collision_ray_circle_vs_line.rb +261 -0
  66. data/examples/00650_/345/206/206/343/201/250/347/202/271/343/201/256/345/217/215/345/260/204_collision_circle_vs_dot.rb +36 -0
  67. data/examples/00660_/345/206/206/343/201/250/345/206/206/343/201/250/347/267/232/345/210/206/343/201/256/345/217/215/345/260/204/343/203/207/343/203/242_collision_demo.rb +305 -0
  68. data/examples/00670_/343/203/251/343/202/244/343/203/225/343/202/262/343/203/274/343/203/240.rb +86 -0
  69. data/examples/00680_2/347/202/271/343/202/222/351/200/232/343/202/213/347/233/264/347/267/232/343/201/256/346/226/271/347/250/213/345/274/217.rb +81 -0
  70. data/examples/00690_/343/203/222/343/203/253/343/203/231/343/203/253/343/203/210/346/233/262/347/267/232.rb +77 -0
  71. data/examples/00700_/343/202/263/343/203/203/343/203/233/346/233/262/347/267/232.rb +79 -0
  72. data/examples/00710_/343/202/267/343/202/260/343/203/242/343/202/244/343/203/211/346/233/262/347/267/232.rb +40 -0
  73. data/examples/00720_/343/202/267/343/203/200/346/244/215/347/211/251.rb +44 -0
  74. data/examples/00730_/343/202/257/343/203/252/343/203/225/343/202/251/343/203/274/343/203/211/343/202/242/343/203/210/343/203/251/343/202/257/343/202/277_/345/237/272/346/234/254.rb +29 -0
  75. data/examples/00740_/343/202/257/343/203/252/343/203/225/343/202/251/343/203/274/343/203/211/343/202/242/343/203/210/343/203/251/343/202/257/343/202/277_/346/224/271/350/211/257_/350/211/262/344/273/230/343/201/215.rb +68 -0
  76. data/examples/00750_/343/202/257/343/203/252/343/203/225/343/202/251/343/203/274/343/203/211/343/202/242/343/203/210/343/203/251/343/202/257/343/202/277_/343/203/211/343/203/274/343/203/212/343/203/204/345/236/213.rb +44 -0
  77. data/examples/00760_/347/201/253/350/212/261.rb +42 -0
  78. data/examples/00770_atan/343/201/247atan2/343/202/222/346/233/270/343/201/217.rb +26 -0
  79. data/examples/00780_/346/250/231/346/272/226/343/203/251/343/202/244/343/203/226/343/203/251/343/203/252/343/201/256atan2_sin_cos/343/202/222/344/275/277/343/201/206.rb +15 -0
  80. data/examples/00790_/350/247/222/345/272/246/343/201/250/343/203/251/343/202/270/343/202/242/343/203/263/343/201/256/347/233/270/344/272/222/345/244/211/346/217/233.rb +22 -0
  81. data/examples/00800_/347/220/203/343/201/214/347/233/264/347/267/232/347/232/204/343/201/253/345/213/225/343/201/204/343/201/246/343/201/204/343/202/213/343/201/240/343/201/221/343/201/247/345/233/236/350/273/242/343/201/227/343/201/246/343/201/204/343/202/213/343/202/210/343/201/206/343/201/253/350/246/213/343/201/210/343/202/213.rb +27 -0
  82. data/examples/00810_/343/202/267/343/203/237/343/203/245/343/203/254/343/203/274/343/202/267/343/203/247/343/203/263_/350/273/212.rb +75 -0
  83. data/examples/00820_/343/202/267/343/203/237/343/203/245/343/203/254/343/203/274/343/202/267/343/203/247/343/203/263_/346/210/246/350/273/212.rb +90 -0
  84. data/examples/00830_/350/247/222/345/272/246/345/267/256.rb +36 -0
  85. data/examples/00840_/346/224/276/347/211/251/347/267/232/343/201/247/347/213/231/346/222/203_/346/231/202/351/226/223/345/233/272/345/256/232.rb +61 -0
  86. data/examples/00850_/346/224/276/347/211/251/347/267/232/343/201/247/347/213/231/346/222/203_/350/247/222/345/272/246/345/233/272/345/256/232.rb +84 -0
  87. data/examples/00860_/346/224/276/347/211/251/347/267/232/343/201/247/347/213/231/346/222/203_/351/200/237/345/272/246/345/233/272/345/256/232.rb +66 -0
  88. data/examples/00870_/350/247/222/345/272/246/350/243/234/346/255/243_/345/212/240/351/200/237/343/203/237/343/202/265/343/202/244/343/203/253.rb +60 -0
  89. data/examples/00880_/345/210/235/351/200/237/343/201/214/351/200/237/343/201/204/343/203/237/343/202/265/343/202/244/343/203/253.rb +51 -0
  90. data/examples/00890_/346/255/243/350/246/217/344/271/261/346/225/260/343/201/250/346/250/231/346/272/226/345/201/217/345/267/256/343/201/256/345/217/257/350/246/226/345/214/226.rb +72 -0
  91. data/examples/00900_/345/220/221/345/277/203/345/212/233/343/201/247/345/233/236/350/273/242/343/200/220/350/247/222/345/272/2460/345/272/246/343/201/213/343/202/211/343/200/221.rb +23 -0
  92. data/examples/00910_/345/220/221/345/277/203/345/212/233/343/201/247/345/233/236/350/273/242/343/200/220/344/273/273/346/204/217/343/201/256/350/247/222/345/272/246/343/201/213/343/202/211/343/200/221.rb +33 -0
  93. data/examples/00920_/343/203/236/343/203/252/343/202/252/343/203/226/343/203/251/343/202/266/343/203/274/343/202/272/351/242/250/343/201/253/347/224/273/351/235/242/344/270/241/347/253/257/343/201/214/347/271/213/343/201/243/343/201/246/343/201/204/343/202/213/344/276/213.rb +29 -0
  94. data/examples/00930_/345/212/271/346/236/234/351/237/263.rb +17 -0
  95. data/examples/00940_/343/203/236/343/203/203/343/203/227/343/203/201/343/203/203/343/203/227/343/201/256/343/203/236/343/203/203/343/203/227/351/205/215/347/275/256.rb +71 -0
  96. data/examples/00950_/343/203/236/343/203/203/343/203/227/343/203/201/343/203/203/343/203/227/343/201/256/350/241/250/347/244/272/344/276/213.rb +28 -0
  97. data/examples/00960_/343/203/236/343/203/203/343/203/227/343/203/201/343/203/203/343/203/227/343/201/250/345/215/230/344/270/200/347/224/273/345/203/217/343/201/256/351/201/225/343/201/204/343/202/222/345/220/270/345/217/216/343/201/231/343/202/213/344/276/213.rb +47 -0
  98. data/examples/00970_observer_/343/201/235/343/201/2561_/347/233/264/346/216/245.rb +28 -0
  99. data/examples/00980_observer_/343/201/235/343/201/2562_/346/231/256/351/200/232/343/201/253Singleton/347/211/210.rb +30 -0
  100. data/examples/00990_observer_/343/201/235/343/201/2563_SimpleDelegator/347/211/210.rb +28 -0
  101. data/examples/01000_observer_/343/201/235/343/201/2564_/351/200/206/343/201/253/343/203/253/343/203/274/343/203/227/344/270/273/345/260/216.rb +28 -0
  102. data/examples/01010_observer_/343/201/235/343/201/2565_/343/201/204/343/202/215/343/202/223/343/201/252/346/211/200/343/201/213/343/202/211/345/221/274/343/202/223/343/201/247/343/201/204/343/202/213/343/201/221/343/201/251Singleton/343/201/252/343/201/256/343/201/247/345/256/211/345/205/250.rb +37 -0
  103. data/examples/01020_observer_/343/201/235/343/201/2566_/343/201/204/343/202/215/343/202/223/343/201/252/346/211/200/343/201/213/343/202/211/345/221/274/343/201/266/345/240/264/345/220/210callbacks/343/202/222/344/275/277/343/202/217/343/201/252/343/201/204/343/202/210/343/201/206/343/201/253.rb +30 -0
  104. data/examples/01030_observer_/343/201/235/343/201/2567_/343/202/250/343/203/225/343/202/247/343/202/257/343/203/210/343/202/277/343/202/271/343/202/257/343/202/222/345/233/236/343/201/231/344/276/213.rb +57 -0
  105. data/examples/01040_/343/203/236/343/202/246/343/202/271/343/201/256/344/275/215/347/275/256/343/201/253/343/203/224/343/202/257/343/202/273/343/203/253/343/202/222/346/211/223/343/201/244.rb +18 -0
  106. data/examples/01050_/343/203/224/343/202/257/343/202/273/343/203/253/345/205/250/344/275/223/343/202/222/346/233/270/343/201/215/350/276/274/343/202/200.rb +27 -0
  107. data/examples/01060_effect_/347/224/273/345/203/217/343/201/256/343/202/263/343/203/263/343/203/234/343/203/252/343/203/245/343/203/274/343/203/210/346/263/225/343/201/253/343/202/210/343/202/213/343/202/250/343/203/225/343/202/247/343/202/257/343/203/210/345/207/246/347/220/206.rb +116 -0
  108. data/examples/01070_effect_FF7/343/201/256/346/210/246/351/227/230/343/201/253/345/205/245/343/202/213/343/201/250/343/201/215/343/201/256/343/202/250/343/203/225/343/202/247/343/202/257/343/203/210.rb +33 -0
  109. data/examples/01080_effect_/350/203/214/346/231/257/343/202/222/347/267/251/343/201/217/346/266/210/343/201/227/343/201/246/343/201/204/343/201/217/343/201/250/343/202/271/343/203/240/343/203/274/343/202/272/343/201/253/343/201/252/343/202/213.rb +16 -0
  110. data/examples/01090_/347/224/273/345/203/217/343/201/256/343/202/257/343/203/255/343/202/271/343/203/225/343/202/247/343/203/274/343/203/211.rb +37 -0
  111. data/examples/01100_/343/202/271/343/202/257/343/203/252/343/203/274/343/203/263/346/203/205/345/240/261.rb +8 -0
  112. data/examples/01110_lib_contrib_menu.rb +19 -0
  113. data/examples/01120_/351/233/233/345/236/213_2P/345/257/276/346/210/246/351/242/250STG.rb +109 -0
  114. data/examples/01130_/351/233/233/345/236/213_/346/210/246/350/273/212/345/257/276/346/210/246.rb +396 -0
  115. data/examples/01140_/351/233/233/345/236/213_2P/345/257/276/346/210/246.rb +60 -0
  116. data/examples/01150_/351/233/233/345/236/213_/343/202/271/343/203/274/343/203/221/343/203/274/343/203/236/343/203/252/343/202/252/351/242/250/343/202/242/343/202/257/343/202/267/343/203/247/343/203/263.rb +1251 -0
  117. data/examples/01160_2D/343/202/242/343/203/225/343/202/243/343/203/263/345/244/211/346/217/233.rb +40 -0
  118. data/examples/01170_stackprof.rb +10 -0
  119. data/examples/01180_sdl_/343/202/242/343/203/253/343/203/225/343/202/241/343/203/226/343/203/254/343/203/263/343/203/207/343/202/243/343/203/263/343/202/260/343/201/247/351/207/215/343/201/255/345/220/210/343/201/233/345/241/227/343/202/212/346/275/260/343/201/227.rb +11 -0
  120. data/examples/01190_/343/203/221/343/203/274/343/203/206/343/202/243/343/202/257/343/203/253/345/220/214/345/243/253/343/201/247/344/270/255/345/244/256/343/201/253/345/220/221/343/201/213/343/201/206.rb +79 -0
  121. data/examples/01200_lib_OpenGL.rb +55 -0
  122. data/examples/bezier.rb +202 -0
  123. data/examples/cursor.rb +50 -0
  124. data/examples/helper.rb +38 -0
  125. data/examples/lifegame_patterns.rb +102 -0
  126. data/examples/movable_point.rb +64 -0
  127. data/examples/mtx33.rb +294 -0
  128. data/examples/setup.rb +5 -0
  129. data/examples/stage_infos.rb +1 -0
  130. data/examples/start.sh +2 -0
  131. data/examples/test_all.rb +5 -0
  132. data/examples/testgl.rb +228 -0
  133. data/examples/trash/__0060_shooting2.rb +37 -0
  134. data/examples/trash/__0090_collision_circle1.rb +50 -0
  135. data/examples/trash/__0125_circle_collision.rb +103 -0
  136. data/examples/trash/__0130_circle_collision2.rb +60 -0
  137. data/examples/trash/__0270_circle_cycle_shift.rb +29 -0
  138. data/examples/trash/__bullet_algos.rb +224 -0
  139. data/examples/trash/gunship.rb +39 -0
  140. data/examples//343/203/227/343/203/255/343/202/270/343/202/247/343/202/257/343/202/277/343/203/274/343/201/253/350/241/250/347/244/272/343/201/231/343/202/213/343/201/250/343/201/215.sh +2 -0
  141. data/lib/stylet.rb +1 -0
  142. data/lib/stylet/application_memory_record.rb +33 -0
  143. data/lib/stylet/audio.rb +455 -0
  144. data/lib/stylet/axis_support.rb +62 -0
  145. data/lib/stylet/base.rb +76 -0
  146. data/lib/stylet/callbacks.rb +62 -0
  147. data/lib/stylet/cli.rb +54 -0
  148. data/lib/stylet/collision_support.rb +56 -0
  149. data/lib/stylet/config.rb +39 -0
  150. data/lib/stylet/contrib/menu.rb +508 -0
  151. data/lib/stylet/contrib/shared_pad.rb +32 -0
  152. data/lib/stylet/contrib/sprity.rb +149 -0
  153. data/lib/stylet/core.rb +118 -0
  154. data/lib/stylet/cpu_stat.rb +58 -0
  155. data/lib/stylet/delegators.rb +54 -0
  156. data/lib/stylet/draw.rb +256 -0
  157. data/lib/stylet/draw_support/arrow.rb +56 -0
  158. data/lib/stylet/draw_support/circle.rb +63 -0
  159. data/lib/stylet/draw_support/polygon.rb +22 -0
  160. data/lib/stylet/font.rb +172 -0
  161. data/lib/stylet/fps_adjust.rb +23 -0
  162. data/lib/stylet/fps_stat.rb +41 -0
  163. data/lib/stylet/input.rb +8 -0
  164. data/lib/stylet/input/base.rb +105 -0
  165. data/lib/stylet/input/hardware_bindings.rb +65 -0
  166. data/lib/stylet/input/key_one.rb +162 -0
  167. data/lib/stylet/input/support.rb +72 -0
  168. data/lib/stylet/joystick.rb +31 -0
  169. data/lib/stylet/joystick_adapter.rb +130 -0
  170. data/lib/stylet/joystick_adapters/buffalo_snes_adapter.rb +47 -0
  171. data/lib/stylet/joystick_adapters/elecom_usb_pad_adapter.rb +30 -0
  172. data/lib/stylet/joystick_adapters/hori_rap_v3_sa_adapter.rb +46 -0
  173. data/lib/stylet/joystick_adapters/ps3_standard_adapter.rb +40 -0
  174. data/lib/stylet/joystick_adapters/unknown_adapter.rb +13 -0
  175. data/lib/stylet/keyboard.rb +15 -0
  176. data/lib/stylet/logger.rb +12 -0
  177. data/lib/stylet/mouse.rb +58 -0
  178. data/lib/stylet/palette.rb +17 -0
  179. data/lib/stylet/rect.rb +113 -0
  180. data/lib/stylet/shortcut.rb +8 -0
  181. data/lib/stylet/state.rb +87 -0
  182. data/lib/stylet/stylet.rb +44 -0
  183. data/lib/stylet/system_pause.rb +24 -0
  184. data/lib/stylet/version.rb +3 -0
  185. data/log/.gitkeep +0 -0
  186. data/stylet.gemspec +31 -0
  187. data/test/test_helper.rb +6 -0
  188. data/test/test_input_base.rb +12 -0
  189. data/test/test_input_key_one.rb +43 -0
  190. data/test/test_input_support.rb +47 -0
  191. data/test/test_sample.rb +13 -0
  192. data/test/test_state.rb +26 -0
  193. data/tips.org +16 -0
  194. metadata +391 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 43affd0b99cf2d967c2d30152a028fa3104df14d807e6e49838458a62ac147d9
4
+ data.tar.gz: 1cc60c8846c3457baaf07adead7a01aa7bb123138ea2ad01ba598e6878db46bb
5
+ SHA512:
6
+ metadata.gz: a93963d6bfdf5753d3cbb1d69933a1900c814b65474d1bc118b775a9e72e82e9565e914ab58ef33a5aac71acff635baf917e4f5cd51f882cc53ab5f98506bc82
7
+ data.tar.gz: 20f1038d67037cec9305a8f9096ab5086e3ac4ba3786e4c93e9b096c8a1ae7057f423aed5033deafeb74de59bb479fbd40db03ab0b5d412e50824db162690977
@@ -0,0 +1,14 @@
1
+ /vortex
2
+ /*.html
3
+ /Gemfile.lock
4
+ /*.gem
5
+ /doc
6
+ /.yardoc
7
+ /TODO
8
+ /examples/_*
9
+ /examples/assets
10
+ /_*
11
+ /assets
12
+ /audacity
13
+ /other
14
+ /stylet_support
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.5.1
4
+ script: bundle exec rake
@@ -0,0 +1,2 @@
1
+ --output-dir=doc/yardoc
2
+ lib/**/*.rb
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ ruby "2.5.1"
2
+
3
+ source 'https://rubygems.org'
4
+ gemspec
5
+
6
+ # if File.exist? (path = File.expand_path(File.join(__dir__, "stylet_support")))
7
+ # gem "stylet_support", path: path
8
+ # else
9
+ # gem "stylet_support", github: "akicho8/stylet_support"
10
+ # end
11
+
12
+ gem "ruby-opengl", require: false
13
+
14
+ # bundle config build.rubysdl --enable-bundled-sge
15
+ # ~/.bundle/config
16
+ gem "rubysdl", github: "ohai/rubysdl"
@@ -0,0 +1,19 @@
1
+ * Ruby/SDLを簡単に使うための自分用フレームワーク
2
+
3
+ # - [[https://travis-ci.org/akicho8/stylet][Travis]]: [[https://travis-ci.org/akicho8/stylet.png]]
4
+ - [[https://gemnasium.com/akicho8/stylet/][Gemnasium]]: [[https://gemnasium.com/akicho8/stylet.png]]
5
+ # - [[https://codeclimate.com/github/akicho8/stylet][Code Climate]]: [[https://codeclimate.com/github/akicho8/stylet.png]]
6
+
7
+ # [[https://raw.github.com/akicho8/stylet/master/images/demo1.png]]
8
+ # [[https://raw.github.com/akicho8/stylet/master/images/demo2.png]]
9
+ # [[https://raw.github.com/akicho8/stylet/master/images/demo3.png]]
10
+ # [[https://raw.github.com/akicho8/stylet/master/images/demo4.png]]
11
+
12
+ #+html: <p><img src="https://raw.github.com/akicho8/stylet/master/ss.png" /></a></p>
13
+
14
+ ** セットアップ手順
15
+
16
+ [[https://raw.github.com/akicho8/stylet/master/bin/setup]]
17
+
18
+ このライブラリの動作確認([q]で終了)
19
+ : rsdl -r stylet -e 'Stylet.run { vputs "Hello, world." }'
@@ -0,0 +1,17 @@
1
+ require "bundler"
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ task :default => :test
5
+
6
+ require "rake/testtask"
7
+ Rake::TestTask.new do |t|
8
+ t.libs << "test"
9
+ # t.test_files = FileList['test/test*.rb']
10
+ # t.verbose = true
11
+ # t.options = "--no-use-color"
12
+ end
13
+
14
+ desc "examples/* の最低限の動作確認"
15
+ task :test_examples do
16
+ system("cd examples && ruby test_all.rb")
17
+ end
@@ -0,0 +1,63 @@
1
+ #!/bin/sh
2
+ brew uninstall --ignore-dependencies libogg
3
+ brew uninstall --ignore-dependencies libvorbis
4
+ brew uninstall --ignore-dependencies libpng
5
+
6
+ brew uninstall --ignore-dependencies sdl
7
+ brew uninstall --ignore-dependencies sdl_ttf
8
+ brew uninstall --ignore-dependencies sdl_mixer
9
+ brew uninstall --ignore-dependencies sdl_image
10
+ brew uninstall --ignore-dependencies sdl_gfx
11
+ brew uninstall --ignore-dependencies sdl_net
12
+ brew uninstall --ignore-dependencies sdl_rtf
13
+ brew uninstall --ignore-dependencies sdl_sound
14
+ brew uninstall --ignore-dependencies sge
15
+
16
+ brew update
17
+
18
+ brew install libogg
19
+ brew install libvorbis
20
+ brew install libpng
21
+
22
+ brew install sdl
23
+ brew install sdl_mixer
24
+ brew install sdl_ttf
25
+ brew install sdl_image
26
+
27
+ # SGE install from gist
28
+ # brew install https://gist.github.com/mitmul/5410467/raw/c4fa716635e951b61f489726976b10f00dd41306/sge.rb
29
+
30
+ gem uninstall -ax rsdl
31
+ gem install rsdl
32
+
33
+ # gem uninstall -ax rubysdl
34
+ # gem install specific_install
35
+
36
+ gem install rubysdl
37
+ gem install rubysdl -- --enable-bundled-sge
38
+
39
+ # # いつのまにか効かなくなった
40
+ # gem specific_install ohai/rubysdl -- --enable-bundled-sge
41
+
42
+ # gem git_install ohai/rubysdl -- --enable-bundled-sge
43
+
44
+ # Ruby/SDL 附属の SGE を使う
45
+ # gem install rubysdl -- --enable-bundled-sge
46
+
47
+ # これは Gemfile 用
48
+ # 要は bundler の方も gem install rubysdl -- --enable-bundled-sge を実行してほしい。
49
+ # それには次の指定で ~/.bundle/config に BUNDLE_BUILD__RUBYSDL: "--enable-bundled-sge" を追加することで対応する。
50
+ bundle config --local build.rubysdl --enable-bundled-sge
51
+ bundle config | grep sge
52
+
53
+ # 確認
54
+ ruby -r sdl -e 'p SDL::VERSION'
55
+ ruby -r sdl -e 'p [:ttf, SDL.constants.include?(:TTF)]'
56
+ ruby -r sdl -e 'p [:mixer, SDL.constants.include?(:Mixer)]'
57
+ ruby -r sdl -e 'p [:sge, SDL.respond_to?(:auto_lock)]'
58
+ # ruby -r sdl -e 'p [:sge, SDL.defined?(:CollisionMap)]'
59
+
60
+ # ↓これが動かない
61
+ rsdl -r sdl -e 'SDL.init(SDL::INIT_EVERYTHING); SDL.set_video_mode(640, 480, 16, SDL::SWSURFACE); sleep(3)'
62
+
63
+ # rsdl -r stylet -e 'Stylet.run { vputs "Hello, world." }'
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env rsdl
2
+ begin
3
+ require "stylet"
4
+ rescue LoadError
5
+ require "rubygems"
6
+ require "stylet"
7
+ end
8
+ Stylet.run
@@ -0,0 +1 @@
1
+ 2.5.1
@@ -0,0 +1,8 @@
1
+ require "./setup"
2
+
3
+ # Stylet.config.fps = nil
4
+ # Stylet.config.fps = 20
5
+ # Stylet.config.fps = 60
6
+ Stylet.run do
7
+ vputs "Hello World"
8
+ end
@@ -0,0 +1,6 @@
1
+ require "./setup"
2
+
3
+ Stylet.run do
4
+ vputs "RUBY_VERSION: #{RUBY_VERSION}"
5
+ vputs "SGE: #{SDL.respond_to?(:auto_lock)}"
6
+ end
@@ -0,0 +1,22 @@
1
+ # ガンマ値の変更
2
+ require_relative "helper"
3
+
4
+ class App < Stylet::Base
5
+ include Helper::Cursor
6
+
7
+ setup do
8
+ s = SDL::Surface.load("assets/love_live.png")
9
+ image = s.display_format
10
+ screen.put(image, 0, 0)
11
+ end
12
+
13
+ update do
14
+ b = 0.4 + rsin(1.0 / 256 * frame_counter * 2) * 0.3
15
+ SDL::Screen.set_gamma(0, 0, b)
16
+ end
17
+
18
+ def background_clear
19
+ end
20
+
21
+ run
22
+ end
@@ -0,0 +1,8 @@
1
+ require "./setup"
2
+
3
+ Stylet.run(:title => "(window_title)") do
4
+ vputs title
5
+ if frame_counter >= 60
6
+ self.title = frame_counter.to_s
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require "./setup"
2
+
3
+ class App < Stylet::Base
4
+ update { vputs "Hello, world."}
5
+ update { vputs "Hello, world."}
6
+ update { vputs "Hello, world."}
7
+ run
8
+ end
@@ -0,0 +1,5 @@
1
+ require "./setup"
2
+ include Stylet
3
+
4
+ vector = Vector.new(3, 3)
5
+ p vector.angle
@@ -0,0 +1,4 @@
1
+ require "./setup"
2
+ Stylet.run(:title => "(title)") do |win|
3
+ win.vputs "Hello, world."
4
+ end
@@ -0,0 +1,4 @@
1
+ require "./setup"
2
+ Stylet.context.run(:title => "(title)") do
3
+ Stylet.context.vputs Stylet.context.frame_counter
4
+ end
@@ -0,0 +1,7 @@
1
+ require "./setup"
2
+
3
+ Stylet.run do
4
+ Stylet.config.each do |k, v|
5
+ vputs [k, v]
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ require "./setup"
2
+
3
+ class App < Stylet::Base
4
+ end
5
+
6
+ App.run(:title => "すべて同じオブジェクト") do
7
+ vputs object_id
8
+ vputs Stylet.context.object_id
9
+ vputs Stylet::Base.active_frame.object_id
10
+ end
@@ -0,0 +1,28 @@
1
+ #
2
+ # .Stylet.context を書かない方法の実験
3
+ # Stylet::Delegators の中身がこんな感じ
4
+ #
5
+ require_relative "helper"
6
+ require 'forwardable'
7
+
8
+ class Ball
9
+ delegate :draw_triangle, :srect, :frame_counter, :to => "Stylet::Base.active_frame"
10
+
11
+ def update
12
+ draw_triangle(srect.center, :radius => 128, :angle => 1.0 / 256 * frame_counter)
13
+ end
14
+ end
15
+
16
+ class App < Stylet::Base
17
+ include Helper::CursorWithObjectCollection
18
+
19
+ setup do
20
+ @ball = Ball.new
21
+ end
22
+
23
+ update do
24
+ @ball.update
25
+ end
26
+
27
+ run
28
+ end
@@ -0,0 +1,7 @@
1
+ # Stylet::Delegators で Stylet::Base.active_frame に移譲しまくっているので vputs がそのまま使える
2
+ require "./setup"
3
+
4
+ class App < Stylet::Base
5
+ update { Class.new { include Stylet::Delegators }.new.vputs "ok" }
6
+ run
7
+ end
@@ -0,0 +1,13 @@
1
+ require "./setup"
2
+
3
+ class App < Stylet::Base
4
+ setup do
5
+ self.title = "テンプレートメソッドパターン"
6
+ end
7
+
8
+ update do
9
+ vputs "Hello, world."
10
+ end
11
+
12
+ run
13
+ end
@@ -0,0 +1,9 @@
1
+ require "./setup"
2
+
3
+ Stylet.configure do |config|
4
+ # config.background_image = "background.bmp"
5
+ config.background_image = "assets/love_live.png"
6
+ # config.background_image = "../assets/images/pingpong/pingpong_chara01.png"
7
+ end
8
+
9
+ Stylet.run(:title => "背景画像表示")
@@ -0,0 +1,18 @@
1
+ # 背景画像を暗くする方法1_黒背景にαブレンドで背景描画
2
+ require_relative "helper"
3
+
4
+ class App < Stylet::Base
5
+ include Helper::Cursor
6
+
7
+ setup do
8
+ @image = SDL::Surface.load("assets/bg960x480_green_ruins.png").display_format
9
+ @image.set_alpha(SDL::SRCALPHA, 64)
10
+ end
11
+
12
+ def background_clear
13
+ super # 黒の背景を作る
14
+ screen.put(@image, *cursor.point) # その上に重ねる
15
+ end
16
+
17
+ run
18
+ end
@@ -0,0 +1,17 @@
1
+ # 背景画像を暗くする方法2_背景の上に黒を薄く
2
+ require_relative "helper"
3
+
4
+ class App < Stylet::Base
5
+ include Helper::Cursor
6
+
7
+ setup do
8
+ @image = SDL::Surface.load("assets/bg960x480_green_ruins.png").display_format
9
+ end
10
+
11
+ def background_clear
12
+ screen.put(@image, *cursor.point) # 画像表示
13
+ screen.draw_rect(srect.x, srect.y, srect.w / 2, srect.h, [0, 0, 0], true, 192) # その上に黒
14
+ end
15
+
16
+ run
17
+ end
@@ -0,0 +1,27 @@
1
+ require_relative "helper"
2
+
3
+ class App < Stylet::Base
4
+ include Helper::Cursor
5
+
6
+ setup do
7
+ @image = SDL::Surface.load("assets/bg960x480_green_ruins.png").display_format
8
+ end
9
+
10
+ def background_clear
11
+ # 画面サイズに合わせて画像表示
12
+ SDL::Surface.transform_draw(
13
+ @image, # これを
14
+ screen, # ここに
15
+ 0, # 回転角度
16
+ srect.w.to_f / @image.w, # x倍率
17
+ srect.h.to_f / @image.h, # y倍率
18
+ @image.w / 2, @image.h / 2, # 画像の拡大や回転の中心を
19
+ srect.w / 2, srect.h / 2, # 転送先のどこに合わせるか
20
+ SDL::Surface::TRANSFORM_AA) # 綺麗フラグ
21
+
22
+ # その上に半透明の黒
23
+ screen.draw_rect(*srect, [0, 0, 0], true, 192)
24
+ end
25
+
26
+ run
27
+ end
@@ -0,0 +1,44 @@
1
+ # 背景画像を暗く3_背景の上に黒_画面サイズフィット_高速化
2
+ require_relative "helper"
3
+
4
+ class App < Stylet::Base
5
+ include Helper::Cursor
6
+
7
+ def screen_open
8
+ super
9
+
10
+ _image = SDL::Surface.load("assets/bg960x480_green_ruins.png").display_format
11
+
12
+ # 画面サイズと同じバッファを作る
13
+ temp_surface = screen.copy_rect(*srect)
14
+
15
+ # 画面サイズに合わせて画像表示
16
+ SDL::Surface.transform_draw(
17
+ _image, # これを
18
+ temp_surface, # ここに
19
+ 0, # 回転角度
20
+ srect.w.to_f / _image.w, # x倍率
21
+ srect.h.to_f / _image.h, # y倍率
22
+ _image.w / 2, _image.h / 2, # 画像の拡大や回転の中心を
23
+ srect.w / 2, srect.h / 2, # 転送先のどこに合わせるか
24
+ SDL::Surface::TRANSFORM_AA) # 綺麗フラグ
25
+
26
+ # その上に黒
27
+ temp_surface.draw_rect(*srect, [0, 0, 0], true, 192)
28
+ _image.destroy
29
+
30
+ # リサイズで再び呼ばれている可能性があるため前回のを解放する
31
+ if @image
32
+ @image.destroy
33
+ end
34
+
35
+ @image = temp_surface
36
+ end
37
+
38
+ def background_clear
39
+ # コピーを取ったものを毎回高速に描画
40
+ screen.put(@image, *cursor.point)
41
+ end
42
+
43
+ run
44
+ end