squib 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (392) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -2
  3. data/CHANGELOG.md +16 -1
  4. data/appveyor.yml +2 -3
  5. data/lib/squib/args/sheet.rb +66 -34
  6. data/lib/squib/graphics/save_pdf.rb +1 -1
  7. data/lib/squib/import/data_frame.rb +7 -7
  8. data/lib/squib/version.rb +1 -1
  9. data/samples/autoscale_font/_autoscale_font.rb +1 -1
  10. data/samples/build_groups/build_groups.rb +3 -3
  11. data/samples/colors/_colors.rb +1 -0
  12. data/samples/{config_text_markup.rb → config/config_text_markup.rb} +0 -0
  13. data/samples/{custom_config.rb → config/custom_config.rb} +0 -0
  14. data/samples/{cairo_access.rb → images/_cairo_access.rb} +0 -0
  15. data/samples/images/_images.rb +1 -1
  16. data/samples/{unicode.rb → images/_unicode.rb} +0 -0
  17. data/samples/intro/01_hello.rb +1 -2
  18. data/samples/intro/02_options.rb +1 -2
  19. data/samples/intro/03_layout.rb +1 -2
  20. data/samples/intro/04_arrays.rb +1 -2
  21. data/samples/intro/05_excel.rb +3 -4
  22. data/samples/{tgc_proofs.rb → proofs/_tgc_proofs.rb} +1 -4
  23. data/samples/saves/_save_pdf.rb +7 -0
  24. data/samples/{embed_text.rb → text/_embed_text.rb} +1 -0
  25. data/samples/text/_text.rb +1 -1
  26. data/samples/{text_options.rb → text/_text_options.rb} +1 -1
  27. data/samples/{bug134.rb → text/bug134.rb} +0 -0
  28. data/squib.gemspec +17 -16
  29. metadata +90 -596
  30. data/benchmarks/antialias_best.rb +0 -13
  31. data/benchmarks/antialias_best.yml +0 -1
  32. data/benchmarks/antialias_fast.rb +0 -13
  33. data/benchmarks/antialias_fast.yml +0 -1
  34. data/benchmarks/backend-svg.yml +0 -4
  35. data/benchmarks/backend_memory.rb +0 -14
  36. data/benchmarks/backend_svg.rb +0 -14
  37. data/benchmarks/shiny-purse.png +0 -0
  38. data/benchmarks/spanner.svg +0 -91
  39. data/benchmarks/tons_of_png.rb +0 -6
  40. data/benchmarks/tons_of_svg.rb +0 -7
  41. data/benchmarks/tons_of_text.rb +0 -8
  42. data/docs/Makefile +0 -216
  43. data/docs/_static/css/squibdocs.css +0 -23
  44. data/docs/args/draw.rst +0 -36
  45. data/docs/args/expansion.rst +0 -3
  46. data/docs/args/layout.rst +0 -6
  47. data/docs/args/output_dir.rst +0 -6
  48. data/docs/args/range.rst +0 -6
  49. data/docs/args/transform.rst +0 -51
  50. data/docs/args/trim.rst +0 -11
  51. data/docs/args/wh.rst +0 -12
  52. data/docs/args/xy.rst +0 -12
  53. data/docs/arrays.rst +0 -80
  54. data/docs/backends.rst +0 -20
  55. data/docs/bleed.rst +0 -13
  56. data/docs/build_groups.rst +0 -45
  57. data/docs/colors.rst +0 -90
  58. data/docs/conf.py +0 -287
  59. data/docs/config.rst +0 -135
  60. data/docs/data.rst +0 -26
  61. data/docs/dsl/background.rst +0 -20
  62. data/docs/dsl/build.rst +0 -32
  63. data/docs/dsl/build_groups.rst +0 -23
  64. data/docs/dsl/circle.rst +0 -27
  65. data/docs/dsl/cm.rst +0 -19
  66. data/docs/dsl/configure.rst +0 -18
  67. data/docs/dsl/csv.rst +0 -81
  68. data/docs/dsl/curve.rst +0 -63
  69. data/docs/dsl/data_frame.rst +0 -85
  70. data/docs/dsl/deck.rst +0 -45
  71. data/docs/dsl/disable_build.rst +0 -25
  72. data/docs/dsl/disable_build_globally.rst +0 -46
  73. data/docs/dsl/ellipse.rst +0 -23
  74. data/docs/dsl/enable_build.rst +0 -25
  75. data/docs/dsl/enable_build_globally.rst +0 -44
  76. data/docs/dsl/grid.rst +0 -31
  77. data/docs/dsl/hand.rst +0 -40
  78. data/docs/dsl/hint.rst +0 -15
  79. data/docs/dsl/inches.rst +0 -19
  80. data/docs/dsl/index.rst +0 -9
  81. data/docs/dsl/line.rst +0 -52
  82. data/docs/dsl/mm.rst +0 -19
  83. data/docs/dsl/png.rst +0 -49
  84. data/docs/dsl/polygon.rst +0 -28
  85. data/docs/dsl/rect.rst +0 -22
  86. data/docs/dsl/save.rst +0 -23
  87. data/docs/dsl/save_pdf.rst +0 -89
  88. data/docs/dsl/save_png.rst +0 -46
  89. data/docs/dsl/save_sheet.rst +0 -55
  90. data/docs/dsl/showcase.rst +0 -76
  91. data/docs/dsl/star.rst +0 -35
  92. data/docs/dsl/svg.rst +0 -119
  93. data/docs/dsl/text.rst +0 -292
  94. data/docs/dsl/triangle.rst +0 -50
  95. data/docs/dsl/use_layout.rst +0 -16
  96. data/docs/dsl/xlsx.rst +0 -56
  97. data/docs/guides/game_icons.rst +0 -126
  98. data/docs/guides/getting-started/index.rst +0 -5
  99. data/docs/guides/getting-started/part_0_learning_ruby.rst +0 -145
  100. data/docs/guides/getting-started/part_1_zero_to_game.rst +0 -217
  101. data/docs/guides/getting-started/part_2_iconography.rst +0 -228
  102. data/docs/guides/getting-started/part_3_workflows.rst +0 -46
  103. data/docs/guides/getting-started/part_4_ruby_power.rst +0 -18
  104. data/docs/guides/git.rst +0 -14
  105. data/docs/guides/guard.rst +0 -84
  106. data/docs/guides/hello_world.rst +0 -65
  107. data/docs/guides/projects.rst +0 -35
  108. data/docs/help.rst +0 -157
  109. data/docs/index.rst +0 -35
  110. data/docs/install.rst +0 -68
  111. data/docs/layouts.rst +0 -290
  112. data/docs/learning.rst +0 -12
  113. data/docs/make.bat +0 -263
  114. data/docs/parameters.rst +0 -34
  115. data/docs/server.bat +0 -1
  116. data/docs/text_feature.rst +0 -115
  117. data/docs/units.rst +0 -14
  118. data/samples/autoscale_font/.gitignore +0 -2
  119. data/samples/autoscale_font/card_00_expected.png +0 -0
  120. data/samples/backend/.gitignore +0 -1
  121. data/samples/backend/_backend-config.yml +0 -5
  122. data/samples/backend/backend_00_expected.png +0 -0
  123. data/samples/backend/backend_01_expected.png +0 -0
  124. data/samples/backend/backend_vectorized_expected.pdf +0 -0
  125. data/samples/backend/backend_vectors_00_expected.svg +0 -84
  126. data/samples/backend/backend_vectors_01_expected.svg +0 -84
  127. data/samples/backend/shiny-purse.png +0 -0
  128. data/samples/backend/showcase_expected.png +0 -0
  129. data/samples/backend/spanner.svg +0 -91
  130. data/samples/ball.png +0 -0
  131. data/samples/build_groups/.gitignore +0 -1
  132. data/samples/build_groups/Rakefile +0 -25
  133. data/samples/colors/.gitignore +0 -1
  134. data/samples/colors/color_constants_00_expected.png +0 -0
  135. data/samples/colors/colors_00_expected.png +0 -0
  136. data/samples/colors/gradient_00_expected.png +0 -0
  137. data/samples/config_disable_quotes.yml +0 -3
  138. data/samples/config_text_markup.yml +0 -9
  139. data/samples/custom-config.yml +0 -5
  140. data/samples/customconfig-imgdir/shiny-purse2.png +0 -0
  141. data/samples/customconfig-imgdir/spanner2.svg +0 -91
  142. data/samples/data/.gitignore +0 -1
  143. data/samples/data/explode_quantities.xlsx +0 -0
  144. data/samples/data/quantity_explosion.csv +0 -3
  145. data/samples/data/sample.csv +0 -3
  146. data/samples/data/sample.xlsx +0 -0
  147. data/samples/data/sample_csv_00_expected.png +0 -0
  148. data/samples/data/sample_csv_01_expected.png +0 -0
  149. data/samples/data/sample_csv_qty_00_expected.png +0 -0
  150. data/samples/data/sample_excel_00_expected.png +0 -0
  151. data/samples/data/sample_excel_01_expected.png +0 -0
  152. data/samples/data/sample_excel_02_expected.png +0 -0
  153. data/samples/data/sample_excel_resources_00_expected.png +0 -0
  154. data/samples/data/sample_excel_resources_01_expected.png +0 -0
  155. data/samples/data/sample_xlsx_qty_00_expected.png +0 -0
  156. data/samples/glass-heart.svg +0 -52
  157. data/samples/grit.png +0 -0
  158. data/samples/images/.gitignore +0 -8
  159. data/samples/images/_images_00_expected.png +0 -0
  160. data/samples/images/angler-fish.png +0 -0
  161. data/samples/images/ball.png +0 -0
  162. data/samples/images/glass-heart.svg +0 -52
  163. data/samples/images/grit.png +0 -0
  164. data/samples/images/offset.svg +0 -85
  165. data/samples/images/robot-golem.svg +0 -1
  166. data/samples/images/shiny-purse.png +0 -0
  167. data/samples/images/spanner.svg +0 -91
  168. data/samples/images/sprites.png +0 -0
  169. data/samples/images/with-alpha.png +0 -0
  170. data/samples/intro/.gitignore +0 -2
  171. data/samples/intro/auto-repair.svg +0 -1
  172. data/samples/intro/crawling.svg +0 -1
  173. data/samples/intro/data.xlsx +0 -0
  174. data/samples/intro/humans.svg +0 -1
  175. data/samples/intro/ninja-mask.svg +0 -1
  176. data/samples/intro/part1_00_expected.png +0 -0
  177. data/samples/intro/part2_00_expected.png +0 -0
  178. data/samples/intro/part3_00_expected.png +0 -0
  179. data/samples/intro/part3_layout.yml +0 -34
  180. data/samples/intro/part4_00_expected.png +0 -0
  181. data/samples/intro/part4_01_expected.png +0 -0
  182. data/samples/intro/part5_00_expected.png +0 -0
  183. data/samples/intro/part5_01_expected.png +0 -0
  184. data/samples/intro/part5_02_expected.png +0 -0
  185. data/samples/intro/part5_03_expected.png +0 -0
  186. data/samples/intro/part5_hand_expected.png +0 -0
  187. data/samples/intro/part5_showcase_expected.png +0 -0
  188. data/samples/intro/pirate-skull.svg +0 -1
  189. data/samples/intro/robot-golem.svg +0 -1
  190. data/samples/layouts/custom-layout.yml +0 -60
  191. data/samples/layouts/custom-layout2.yml +0 -15
  192. data/samples/layouts/expected_layouts_builtin_economy_00.png +0 -0
  193. data/samples/layouts/expected_layouts_builtin_fantasy_00.png +0 -0
  194. data/samples/layouts/expected_layouts_builtin_hand_00.png +0 -0
  195. data/samples/layouts/expected_layouts_builtin_playing_card_00.png +0 -0
  196. data/samples/layouts/expected_layouts_builtin_tuck_box_00.png +0 -0
  197. data/samples/layouts/shiny-purse.png +0 -0
  198. data/samples/layouts/spanner.svg +0 -91
  199. data/samples/load_images_config.yml +0 -1
  200. data/samples/offset.svg +0 -71
  201. data/samples/pokercard.png +0 -0
  202. data/samples/project/Gemfile +0 -6
  203. data/samples/project/Guardfile +0 -18
  204. data/samples/project/Rakefile +0 -25
  205. data/samples/project/bw/robot-golem.svg +0 -53
  206. data/samples/project/color/robot-golem.svg +0 -1
  207. data/samples/project/config.yml +0 -2
  208. data/samples/project/layouts/characters.yml +0 -3
  209. data/samples/project/layouts/skills.yml +0 -3
  210. data/samples/ranges/glass-heart.svg +0 -52
  211. data/samples/ranges/ranges_00_expected.png +0 -0
  212. data/samples/saves/.gitignore +0 -1
  213. data/samples/saves/hand_expected.png +0 -0
  214. data/samples/saves/hand_pretty_expected.png +0 -0
  215. data/samples/saves/save-pdf-small_expected.pdf +0 -0
  216. data/samples/saves/save-pdf_expected.pdf +0 -0
  217. data/samples/saves/save_png_00_expected.png +0 -0
  218. data/samples/saves/save_png_trimmed_00_expected.png +0 -0
  219. data/samples/saves/save_sheet_00_expected.png +0 -0
  220. data/samples/saves/save_sheet_01_expected.png +0 -0
  221. data/samples/saves/save_sheet_range_00_expected.png +0 -0
  222. data/samples/saves/save_sheet_range_01_expected.png +0 -0
  223. data/samples/saves/save_single_sheet_00_expected.png +0 -0
  224. data/samples/saves/saves_notrim_01_expected.png +0 -0
  225. data/samples/saves/showcase2_expected.png +0 -0
  226. data/samples/saves/showcase_expected.png +0 -0
  227. data/samples/saves/showcase_individual_00_expected.png +0 -0
  228. data/samples/saves/showcase_individual_01_expected.png +0 -0
  229. data/samples/saves/showcase_individual_02_expected.png +0 -0
  230. data/samples/saves/showcase_individual_03_expected.png +0 -0
  231. data/samples/saves/spanner.svg +0 -91
  232. data/samples/shapes/.gitignore +0 -1
  233. data/samples/shapes/shape_00_expected.png +0 -0
  234. data/samples/shiny-purse.png +0 -0
  235. data/samples/spanner.svg +0 -91
  236. data/samples/sprites.png +0 -0
  237. data/samples/text/.gitignore +0 -2
  238. data/samples/text/README.md +0 -1
  239. data/samples/text/_text_00_expected.png +0 -0
  240. data/samples/text/config.yml +0 -2
  241. data/samples/units/units_00_expected.png +0 -0
  242. data/samples/units/using_units.yml +0 -10
  243. data/spec/api/api_data_spec.rb +0 -172
  244. data/spec/api/api_groups_spec.rb +0 -49
  245. data/spec/api/api_settings_spec.rb +0 -38
  246. data/spec/api/api_units_spec.rb +0 -37
  247. data/spec/args/box_spec.rb +0 -127
  248. data/spec/args/draw_spec.rb +0 -101
  249. data/spec/args/embed_key_spec.rb +0 -13
  250. data/spec/args/input_file_spec.rb +0 -21
  251. data/spec/args/paint_spec.rb +0 -22
  252. data/spec/args/paragraph_spec.rb +0 -153
  253. data/spec/args/range_spec.rb +0 -41
  254. data/spec/args/save_batch_spec.rb +0 -51
  255. data/spec/args/scale_box_spec.rb +0 -71
  256. data/spec/args/sheet_spec.rb +0 -80
  257. data/spec/args/showcase_special_spec.rb +0 -15
  258. data/spec/args/transform_spec.rb +0 -25
  259. data/spec/args/typographer_spec.rb +0 -71
  260. data/spec/args/unit_conversion_spec.rb +0 -29
  261. data/spec/card_spec.rb +0 -11
  262. data/spec/commands/new_spec.rb +0 -48
  263. data/spec/conf_spec.rb +0 -47
  264. data/spec/data/conf/basic.yml +0 -1
  265. data/spec/data/conf/empty.yml +0 -1
  266. data/spec/data/conf/unrecognized.yml +0 -4
  267. data/spec/data/csv/basic.csv +0 -3
  268. data/spec/data/csv/custom_opts.csv +0 -2
  269. data/spec/data/csv/dup_cols.csv +0 -3
  270. data/spec/data/csv/newline.csv +0 -3
  271. data/spec/data/csv/qty.csv +0 -3
  272. data/spec/data/csv/qty_named.csv +0 -3
  273. data/spec/data/csv/with_spaces.csv +0 -3
  274. data/spec/data/csv/yield.csv +0 -3
  275. data/spec/data/layouts/easy-circular-extends.yml +0 -6
  276. data/spec/data/layouts/empty-rule.yml +0 -1
  277. data/spec/data/layouts/empty.yml +0 -1
  278. data/spec/data/layouts/extends-nonexists.yml +0 -3
  279. data/spec/data/layouts/extends-units-mixed.yml +0 -8
  280. data/spec/data/layouts/extends-units.yml +0 -8
  281. data/spec/data/layouts/hard-circular-extends.yml +0 -9
  282. data/spec/data/layouts/multi-extends-single-entry.yml +0 -14
  283. data/spec/data/layouts/multi-level-extends.yml +0 -10
  284. data/spec/data/layouts/multifile-a.yml +0 -4
  285. data/spec/data/layouts/multifile-b.yml +0 -4
  286. data/spec/data/layouts/multifile-extends-a.yml +0 -8
  287. data/spec/data/layouts/multifile-extends-b.yml +0 -9
  288. data/spec/data/layouts/no-extends.yml +0 -5
  289. data/spec/data/layouts/pre-extends.yml +0 -7
  290. data/spec/data/layouts/self-circular-extends.yml +0 -3
  291. data/spec/data/layouts/single-extends.yml +0 -7
  292. data/spec/data/layouts/single-level-multi-extends.yml +0 -12
  293. data/spec/data/samples/autoscale_font/_autoscale_font.rb.txt +0 -133
  294. data/spec/data/samples/basic.rb.txt +0 -248
  295. data/spec/data/samples/cairo_access.rb.txt +0 -59
  296. data/spec/data/samples/colors/_gradients.rb.txt +0 -84
  297. data/spec/data/samples/config_text_markup.rb.txt +0 -74
  298. data/spec/data/samples/custom_config.rb.txt +0 -59
  299. data/spec/data/samples/data/_csv.rb.txt +0 -231
  300. data/spec/data/samples/data/_excel.rb.txt +0 -704
  301. data/spec/data/samples/embed_text.rb.txt +0 -431
  302. data/spec/data/samples/hello_world.rb.txt +0 -38
  303. data/spec/data/samples/images/_more_load_images.rb.txt +0 -335
  304. data/spec/data/samples/layouts.rb.txt +0 -489
  305. data/spec/data/samples/ranges/_ranges.rb.txt +0 -484
  306. data/spec/data/samples/saves/_hand.rb.txt +0 -594
  307. data/spec/data/samples/saves/_portrait_landscape.rb.txt +0 -57
  308. data/spec/data/samples/saves/_save_pdf.rb.txt +0 -1601
  309. data/spec/data/samples/saves/_saves.rb.txt +0 -873
  310. data/spec/data/samples/saves/_showcase.rb.txt +0 -5942
  311. data/spec/data/samples/shapes/_draw_shapes.rb.txt +0 -757
  312. data/spec/data/samples/text_options.rb.txt +0 -1158
  313. data/spec/data/samples/tgc_proofs.rb.txt +0 -102
  314. data/spec/data/samples/units/_units.rb.txt +0 -53
  315. data/spec/data/xlsx/basic.xlsx +0 -0
  316. data/spec/data/xlsx/explode_quantities.xlsx +0 -0
  317. data/spec/data/xlsx/formulas.xlsx +0 -0
  318. data/spec/data/xlsx/whitespace.xlsx +0 -0
  319. data/spec/data/xlsx/with_macros.xlsm +0 -0
  320. data/spec/deck_spec.rb +0 -73
  321. data/spec/graphics/cairo_context_wrapper_spec.rb +0 -104
  322. data/spec/graphics/embedding_utils_spec.rb +0 -73
  323. data/spec/graphics/graphics_save_doc_spec.rb +0 -74
  324. data/spec/import/data_frame_spec.rb +0 -251
  325. data/spec/layout_parser_spec.rb +0 -226
  326. data/spec/logger_spec.rb +0 -12
  327. data/spec/samples/_diffs/gitkeep.txt +0 -0
  328. data/spec/samples/diff-with-css.example.html +0 -39
  329. data/spec/samples/expected/autoscale_00.png +0 -0
  330. data/spec/samples/expected/autoscale_01.png +0 -0
  331. data/spec/samples/expected/autoscale_02.png +0 -0
  332. data/spec/samples/expected/backend_00.png +0 -0
  333. data/spec/samples/expected/backend_00.svg +0 -78
  334. data/spec/samples/expected/backend_01.png +0 -0
  335. data/spec/samples/expected/backend_01.svg +0 -78
  336. data/spec/samples/expected/basic_00.png +0 -0
  337. data/spec/samples/expected/basic_01.png +0 -0
  338. data/spec/samples/expected/basic_02.png +0 -0
  339. data/spec/samples/expected/cairo_access_00.png +0 -0
  340. data/spec/samples/expected/cairo_access_01.png +0 -0
  341. data/spec/samples/expected/card_00.png +0 -0
  342. data/spec/samples/expected/card_01.png +0 -0
  343. data/spec/samples/expected/colors_00.png +0 -0
  344. data/spec/samples/expected/config_disable_text_00.png +0 -0
  345. data/spec/samples/expected/config_text_00.png +0 -0
  346. data/spec/samples/expected/custom-config_00.png +0 -0
  347. data/spec/samples/expected/embed_00.png +0 -0
  348. data/spec/samples/expected/embed_multisheet_00.png +0 -0
  349. data/spec/samples/expected/gitkeep.txt +0 -0
  350. data/spec/samples/expected/gradient_00.png +0 -0
  351. data/spec/samples/expected/hand.png +0 -0
  352. data/spec/samples/expected/hand_pretty.png +0 -0
  353. data/spec/samples/expected/landscape_00.png +0 -0
  354. data/spec/samples/expected/layout2_00.png +0 -0
  355. data/spec/samples/expected/layout_00.png +0 -0
  356. data/spec/samples/expected/layout_builtin_hand_00.png +0 -0
  357. data/spec/samples/expected/layout_builtin_playing_card_00.png +0 -0
  358. data/spec/samples/expected/load_images_00.png +0 -0
  359. data/spec/samples/expected/portrait_00.png +0 -0
  360. data/spec/samples/expected/ranges_00.png +0 -0
  361. data/spec/samples/expected/sample_csv_00.png +0 -0
  362. data/spec/samples/expected/sample_csv_01.png +0 -0
  363. data/spec/samples/expected/sample_excel_00.png +0 -0
  364. data/spec/samples/expected/sample_excel_01.png +0 -0
  365. data/spec/samples/expected/sample_excel_02.png +0 -0
  366. data/spec/samples/expected/save_sheet_00.png +0 -0
  367. data/spec/samples/expected/save_sheet_01.png +0 -0
  368. data/spec/samples/expected/save_sheet_range_00.png +0 -0
  369. data/spec/samples/expected/save_sheet_range_01.png +0 -0
  370. data/spec/samples/expected/save_single_sheet_00.png +0 -0
  371. data/spec/samples/expected/saves_notrim_01.png +0 -0
  372. data/spec/samples/expected/shape_00.png +0 -0
  373. data/spec/samples/expected/showcase.png +0 -0
  374. data/spec/samples/expected/showcase2.png +0 -0
  375. data/spec/samples/expected/showcase_individual_00.png +0 -0
  376. data/spec/samples/expected/showcase_individual_01.png +0 -0
  377. data/spec/samples/expected/showcase_individual_02.png +0 -0
  378. data/spec/samples/expected/showcase_individual_03.png +0 -0
  379. data/spec/samples/expected/text_00.png +0 -0
  380. data/spec/samples/expected/text_01.png +0 -0
  381. data/spec/samples/expected/text_02.png +0 -0
  382. data/spec/samples/expected/tgc_sample_00.png +0 -0
  383. data/spec/samples/expected/units_00.png +0 -0
  384. data/spec/samples/run_samples_spec.rb +0 -17
  385. data/spec/samples/samples_regression_spec.rb +0 -71
  386. data/spec/samples/sanity.html.erb +0 -28
  387. data/spec/samples/sanity.rb +0 -70
  388. data/spec/sanity/.gitignore +0 -1
  389. data/spec/sanity/sanity.html.erb +0 -42
  390. data/spec/sanity/sanity_test.rb +0 -42
  391. data/spec/sanity/tests.yml +0 -12
  392. data/spec/spec_helper.rb +0 -159
@@ -1,228 +0,0 @@
1
- The Squib Way pt 2: Iconography
2
- ===================================
3
-
4
- In the previous guide, we walked you through the basics of going from ideas in your head to a very simple set of cards ready for playtesting at the table. In this guide we take the next step: creating a visual language.
5
-
6
- Art: Graphic Design vs. Illustration
7
- ------------------------------------
8
-
9
- A common piece of advice in the prototyping world is "Don't worry about artwork, just focus on the game and do the artwork later". That's good advice, but a bit over-simplified. What folks usually mean by "artwork" is really "illustration", like the oil painting of a wizard sitting in the middle of the card or the intricate border around the edges.
10
-
11
- But games are more than just artwork with text - they're a system of rules that need to be efficiently conveyed to the players. They're a *visual language*. When players are new to your game, the layout of the cards need to facilitate learning. When players are competing in their 30th game, though, they need the cards to maximize usability by reducing their memory load, moving gameplay along efficiently, and provide an overall aesthetic that conveys the game theme. That's what graphic design is all about, and requires a game designer's attention much more than commissioning an illustration.
12
-
13
- Developing the visual language on your cards is not a trivial task. It's one that takes a lot of iteration, feedback, testing, improvement, failure, small successes, and reverse-engineering. It's something you should consider in your prototype early on. It's also a series of decisions that don't necessarily require artistic ability - just an intentional effort applied to usability.
14
-
15
- Icons and the their placement are, perhaps, the most efficient and powerful tools in your toolbelt for conveying your game's world. In the prototyping process, you don't need to be worried about using icons that are your *final* icons, but you should put some thought into what the visuals will look like because you'll be iterating on that in the design process.
16
-
17
- Iconography in Popular Games
18
- ----------------------------
19
-
20
- When you get a chance, I highly recommend studying the iconography of some popular games. What works for you? What didn't? What kinds of choices did the designers make that works *for their game*? Here are a few that come my mind:
21
-
22
- Race for the Galaxy
23
- ^^^^^^^^^^^^^^^^^^^
24
-
25
- The majority of the cards in RFTG have no description text on them, and yet the game contains hundreds of unique cards. RFTG has a vast, rich visual iconography that conveys a all of the bonuses and trade-offs of a card efficiently to the user. As a drawback, though, the visual language can be intimidating to new players - every little symbol and icon means a new thing, and sometimes you just need to memorize that "this card does that", until you realize that the icons show that.
26
-
27
- But once you know the structure of the game and what various bonuses mean, you can understand new cards very easily. Icons are combined in creative ways to show new bonuses. Text is used only when a bonus is much more complicated than what can be expressed with icons. Icons are primarily arranged along left side of the card so you can hold them in your hand and compare bonuses across cards quickly. All of these design decisions match the gameplay nicely because the game consists of a lot of scrolling through cards in your hand and evaluating which ones you want to play.
28
-
29
- Go check out `images of Race for the Galaxy on BoardGameGeek.com <https://boardgamegeek.com/boardgame/28143/race-galaxy>`_.
30
-
31
- Dominion
32
- ^^^^^^^^
33
-
34
- Unlike RFTG, Dominion has a much simpler iconography. Most of the bonuses are conveyed in a paragraph of text in the description, with a few classifications conveyed by color or format. The text has icons embedded in it to tie in the concept of Gold, Curses, or Victory Points.
35
-
36
- But Dominion's gameplay is much different: instead of going through tons of different cards, you're only playing with 10 piles of cards in front of you. So each game really just requires you to remember what 10 cards mean. Once you purchase a card and it goes into your deck, you don't need to evaluate its worth quickly as in RFTG because you already bought it. Having most of the game's bonuses in prose means that new bonuses are extremely flexible in their expression. As a result, Dominion's bonuses and iconography is much more about text and identifying known cards than about evaluating new ones.
37
-
38
- Go check out images of Dominion `on BoardGameGeek.com <https://boardgamegeek.com/boardgame/36218/dominion>`_
39
-
40
- How Squib Supports Iconography
41
- ------------------------------
42
-
43
- Squib is good for supporting any kind of layout you can think of, but it's also good for supporting multiple ways of translating your data into icons on cards. Here are some ways that Squib provides support for your ever-evolving iconography:
44
-
45
- * :doc:`/dsl/svg` method, and all of its features like scaling, ID-specific rendering, direct XML manipulation, and all that the SVG file format has to offer
46
- * :doc:`/dsl/png` method, and all of its features like blending operators, alpha transparency, and masking
47
- * Layout files allow multiple icons for one data column (see :doc:`/layouts`)
48
- * Layout files also have the ``extends`` feature that allows icons to inherit details from each other
49
- * The ``range`` option on :doc:`/dsl/text`, :doc:`/dsl/svg`, and :doc:`/dsl/png` allows you to specify text and icons for any subset of your cards
50
- * The :doc:`/dsl/text` method allows for embedded icons.
51
- * The :doc:`/dsl/text` method allows for Unicode characters (if the font supports it).
52
- * Ruby provides neat ways of aggregating data with ``inject``, ``map``, and ``zip`` that gives you ultimate flexibility for specifying different icons for different cards.
53
-
54
- Back to the Example: Drones vs. Humans
55
- --------------------------------------
56
-
57
- Ok, let's go back to our running example, project ``arctic-lemming`` from Part 1. We created cards for playtesting, but we never put down the faction for each card. That's a good candidate for an icon.
58
-
59
- Let's get some stock icons for this exercise. For this example, I went to http://game-icons.net. I set my foreground color to black, and background to white. I then downloaded "auto-repair.svg" and "backup.svg". I'm choosing not to rename the files so that I can find them again on the website if I need to. (If you want to know how to do this process DIRECTLY from Ruby, and not going to the website, check out my *other* Ruby gem called `game_icons <https://github.com/andymeneely/game_icons>`_ - it's tailor-made for Squib! We've got some documentation in :doc:`/guides/game_icons`
60
-
61
- When we were brainstorming our game, we placed one category of icons in a single column ("faction"). Presumably, one would want the faction icon to be in the same place on every card, but a different icon depending on the card's faction. There are a couple of ways of accomplishing this in Squib. First, here some less-than-clean ways of doing it::
62
-
63
- svg range: 0, file: 'auto_repair.svg' # hard-coded range number? not flexible
64
- svg range: 1, file: 'auto_repair.svg' # hard-coded range number? not flexible
65
- svg range: 2, file: 'backup.svg' # hard-coded range number? not flexible
66
- svg range: 3, file: 'backup.svg' # hard-coded range number? not flexible
67
- # This gets very hard to maintain over time
68
- svg file: ['auto_repair.svg', 'auto_repair.svg', 'backup.svg', 'backup.svg']
69
- # This is slightly easier to maintain, but is more verbose and still hardcoded
70
- svg range: 0..1, file 'auto_repair.svg'
71
- svg range: 2..3, file 'backup.svg'
72
-
73
- That's too much hardcoding of data into our Ruby code. That's what layouts are for. Now, we've already specified a layout file in our prior example. Fortunately, Squib supports *multiple* layout files, which get combined into a single set of layout styles. So let's do that: we create our own layout file that defines what a ``human`` is and what a ``drone`` is. Then just tell ``svg`` to use the layout data. The data column is simply an array of factions, the icon call is just connecting the factions to their styles with::
74
-
75
- svg layout: data['faction']
76
-
77
- So, putting it all together, our code looks like this.
78
-
79
- .. raw:: html
80
-
81
- <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
82
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/gist-embed/2.4/gist-embed.min.js"></script>
83
- <code data-gist-id="d2bb2eb028b27cf1dace"
84
- data-gist-file="_part2_01_factions.rb"
85
- data-gist-highlight-line="13"
86
- ></code>
87
- <code data-gist-id="d2bb2eb028b27cf1dace"
88
- data-gist-file="_part2_01_factions.yml"></code>
89
- <code data-gist-id="d2bb2eb028b27cf1dace" data-gist-file="data.csv"></code>
90
- <code data-gist-id="d2bb2eb028b27cf1dace"
91
- data-gist-file="_part2_01_factions_00.png"></code>
92
-
93
- **BUT!** There's a very important software design principle we're violating here. It's called DRY: Don't Repeat Yourself. In making the above layout file, I hit copy and paste. What happens later when we change our mind and want to move the faction icon!?!? We have to change TWO numbers. Blech.
94
-
95
- There's a better way: ``extends``
96
-
97
- The layout files in Squib also support a special keyword, ``extends``, that allows us to "copy" (or "inherit") another style onto our own, and then we can override as we see fit. Thus, the following layout is a bit more DRY:
98
-
99
- .. raw:: html
100
-
101
- <code data-gist-id="d2bb2eb028b27cf1dace"
102
- data-gist-file="_part2_02_factions.yml"></code>
103
-
104
- Much better!
105
-
106
- Now if we want to add a new faction, we don't have to copy-pasta any code! We just extend from faction and call in our new SVG file. Suppose we add a new faction that needs a bigger icon - we can define our own ``width`` and ``height`` beneath the ``extends`` that will override the parent values of 75.
107
-
108
- Looks great! Now let's get these cards out to the playtesting table!
109
-
110
- At this point, we've got a very scalable design for our future iterations. Let's take side-trip and discuss why this design works.
111
-
112
- Why Ruby+YAML+Spreadsheets Works
113
- --------------------------------
114
-
115
- In software design, a "good" design is one where the problem is broken down into a set of easier duties that each make sense on their own, where the interaction between duties is easy, and where to place new responsibilities is obvious.
116
-
117
- In Squib, we're using automation to assist the prototyping process. This means that we're going to have a bunch of decisions and responsibilities, such as:
118
-
119
- * *Game data decisions*. How many of this card should be in the deck? What should this card be called? What should the cost of this card be?
120
- * *Style Decisions*. Where should this icon be? How big should the font be? What color should we use?
121
- * *Logic Decisions*. Can we build this to a PDF, too? How do we save this in black-and-white? Can we include a time stamp on each card? Can we just save one card this time so we can test quickly?
122
-
123
- With the Ruby+YAML+Spreadsheets design, we've separated these three kinds of questions into three areas:
124
-
125
- * Game data is in a spreadsheet
126
- * Styles are in YAML layout files
127
- * Code is in Ruby
128
-
129
- When you work with this design, you'll probably find yourself spending a lot of time working on one of these files for a long time. That means this design is working.
130
-
131
- For example, you might be adjusting the exact location of an image by editing your layout file and re-running your code over and over again to make sure you get the exact x-y coordinates right. That's fine. You're not making game data decisions in that moment, so you shouldn't be presented with any of that stuff. This eases the cognitive complexity of what you're doing.
132
-
133
- The best way to preserve this design is to try to keep the Ruby code clean. As wonderful as Ruby is, it's the hardest of the three to edit. It is code, after all. So don't clutter it up with game data or style data - let it be the glue between your styles and your game.
134
-
135
- Ok, let's get back to this prototype.
136
-
137
- Illustration: One per Card
138
- --------------------------
139
-
140
- The cards are starting to come together, but we have another thing to do now. When playtesting, you need a way of visually identifying the card immediately. Reading text takes an extra moment to identify the card - wouldn't it be nice if we had some sort of artwork, individualized to the card?
141
-
142
- Of course, we're not going to commission an artist or do our own oil paintings just yet. Let's get some placeholder art in there. Back to GameIcons, we're going to use "ninja-mask.svg", "pirate-skull.svg", "shambling-zombie.svg", and "robot-golem.svg".
143
-
144
- Method 1: Put the file name in data
145
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
146
-
147
- The difference between our Faction icon and our Illustration icon is that the Illustration needs to be different for every card. We already have a convenient way to do something different on every card - our CSV file!
148
-
149
- Here's how the CSV would look:
150
-
151
- .. raw:: html
152
-
153
- <code data-gist-id="d2bb2eb028b27cf1dace"
154
- data-gist-file="data_pt2_03.csv"></code>
155
-
156
- In our layout file we can center it in the middle of the card, nice and big. And then the Ruby & YAML would look like this:
157
-
158
- .. raw:: html
159
-
160
- <code data-gist-id="d2bb2eb028b27cf1dace"
161
- data-gist-file="_part2_03_illustrations.yml"
162
- data-gist-highlight-line="12-16"></code>
163
- <code data-gist-id="d2bb2eb028b27cf1dace"
164
- data-gist-file="_part2_03_illustrations_m1.rb"
165
- data-gist-highlight-line="14"></code>
166
-
167
- And our output will look like this:
168
-
169
- .. raw:: html
170
-
171
- <code data-gist-id="d2bb2eb028b27cf1dace"
172
- data-gist-file="_part2_03_illustrations_00.png"></code>
173
-
174
-
175
- Method 2: Map title to file name
176
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
177
-
178
- There are some drawbacks to Method 1. First, you're putting artwork graphics info inside your game data. This can be weird and unexpected for someone new to your code (i.e. that person being you when you put your project down for a few months). Second, when you're working on artwork you'll have to look up what the name of every file is in your CSV. (Even writing this tutorial, I forgot that "zombie" is called "shambling-zombie.svg" and had to look it up, distracting me from focusing on writing.)
179
-
180
- There's another way of doing this, and it's more Ruby-like because it follows the `Convention over Configuration <https://en.wikipedia.org/wiki/Convention_over_configuration>`_ philosophy. The idea is to be super consistent with your naming so that you don't have to *configure* that, say, "pirate" has an illustration "pirate-skull". The illustration should be literally the title of the card - converted to lowercase because that's the convention for files. That means it should just be called "pirate.svg", and Squib should know to "just put an SVG that is named after the title". Months later, when you want to edit the illustration for pirate, you will probably just open "pirate.svg".
181
-
182
- To do this, you'll need to convert an array of Title strings from your CSV (``data['title']`` to an array of file names. Ruby's ``map`` was born for this.
183
-
184
- .. note::
185
-
186
- If you're new to Ruby, here's a quick primer. The ``map`` method gets run on every element of an array, and it lets you specify a *block* (either between curly braces for one line or between ``do`` and ``end`` for multiple lines). It then returns another Array of the same size, but with every value mapped using your block. So::
187
-
188
- [1, 2, 3].map { |x| 2 * x } # returns [2, 4, 6]
189
- [1, 2, 3].map { |x| "$#{x}" } # returns ["$1", "$2", "$3"]
190
- ['NARF', 'ZORT'].map { |x| x.downcase } # returns ['narf', 'zort']
191
-
192
-
193
-
194
- Thus, if we rename our illustration files from "pirate-skull.svg" to "pirate.svg", we can have CSV data that's JUST game data:
195
-
196
- .. raw:: html
197
-
198
- <code data-gist-id="d2bb2eb028b27cf1dace"
199
- data-gist-file="data.csv"
200
- data-gist-highlight-line="14"></code>
201
-
202
- And our Ruby code will figure out the file name:
203
-
204
- .. raw:: html
205
-
206
- <code data-gist-id="d2bb2eb028b27cf1dace"
207
- data-gist-file="_part2_03_illustrations_m2.rb"
208
- data-gist-highlight-line="3,14-15"></code>
209
-
210
- And our output images look identical to Method 1.
211
-
212
- Learn by Example
213
- ----------------
214
-
215
- In my game, Your Last Heist, I use some similar methods as above:
216
-
217
- * `Use a different background depending <https://github.com/andymeneely/project-timber-wolf/blob/156a5d417dd8021e3f391a67c08b8e9f06f58c2b/src/characters.rb#L14-L16>`_ on if the character is level 1 or 2. Makes use of `Ruby's ternary operator <https://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Control_Structures#short-if_expression_.28aka_ternary_operator.29>`_.
218
- * `Only put an image if the data is non-nil <https://github.com/andymeneely/project-timber-wolf/blob/156a5d417dd8021e3f391a67c08b8e9f06f58c2b/src/characters.rb#L19-L21>`_. Some characters have a third skill, others do not. Only load a third skill image if they have a third skill. This line leverages the fact that when you do ``svg file: nil``, the ``svg`` simply does nothing.
219
- * `Method 2 from above, but into its own directory <https://github.com/andymeneely/project-timber-wolf/blob/156a5d417dd8021e3f391a67c08b8e9f06f58c2b/src/characters.rb#L23>`_.
220
- * `Use different-sized backdrops depending on the number of letters in the text <https://github.com/andymeneely/project-timber-wolf/blob/156a5d417dd8021e3f391a67c08b8e9f06f58c2b/src/characters.rb#L24-L31>`_. This one is cool because I can rewrite the description of a card, and it will automatically figure out which backdrop to use based on how many letters the text has. This makes use of `Ruby's case-when expression <https://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Control_Structures#case_expression>`_.
221
- * After saving the regular cards, we end our script by `creating some annotated figures <https://github.com/andymeneely/project-timber-wolf/blob/156a5d417dd8021e3f391a67c08b8e9f06f58c2b/src/characters.rb#L68-L76>`_ for the rulebook by drawing some text on top of it and saving it using ``showcase``.
222
-
223
- Are We Done?
224
- ------------
225
-
226
- At this stage, you've got most of what you need to build a game from prototype through completion. Between images and text, you can do pretty much anything. Squib does much more, of course, but these are the basic building blocks.
227
-
228
- But, prototyping is all about speed and agility. The faster you can get what you need, the sooner you can playtest, and the sooner you can make it better. Up next, we'll be looking at workflow: ways to help you get what you need quickly and reliably.
@@ -1,46 +0,0 @@
1
- The Squib Way pt 3: Workflows
2
- ===============================
3
-
4
- .. warning::
5
-
6
- Under construction
7
-
8
- As we mentioned at the end :doc:`/guides/getting-started/part_2_iconography`, we've pretty much got most of what we need to prototype a game through completion. From here on out, the :doc:`/dsl/index` will be your best resource for getting things done. Everything from here one out is optional, but useful.
9
-
10
- But, as you explore Squib's features and work away at your games, you'll pick up a few tricks and conventions to follow that makes your time easier. After years of developing games with Squib, here are some helpful ways of improving your workflow.
11
-
12
- Improving your workflow comes down to a few principles:
13
-
14
- * **Automate what will be tedious**. There's a balance here. What do you anticipate will change about your game as you develop it? What do you anticipate will *not* change? If you automate *everything*, you will probably spend more time on automating than game development. If you don't automate anything, you'll be re-making every component whenever you make a game design change.
15
- * **Focus on one thing only: visual, game, or build**. Cognitively, you'll have an easier time when you focus on one thing and one thing only. The more loose ends you need to keep in your head, the more mistakes you'll make.
16
-
17
- Additionally, improving your workflow can help you pivot to other tasks you might need for polishing your game later on, such as:
18
-
19
- * Quickly building one card at a time to reduce the time between builds
20
- * Maintaining a printer-friendly, black-and-white version of your game in tandem with a color version
21
- * Building annotated figures for your rulebook
22
- * Rolling back to older versions of your game
23
-
24
- Organizing Your Project
25
- -----------------------
26
-
27
- Most games involve build multiple decks. Initially, you might think to put all of your Ruby code inside one file. That can work, but it gets slow and cumbersome. Instead, I like to organize my code into separate source code files inside of a `src` directory.
28
-
29
- Keeping your artwork in its own folder will also make it easier for you to find what you need later on. Also, using `img_dir` parameter in the `config.yml` will let you switch the entire image directory over in one
30
-
31
- Using a Rakefile
32
- ----------------
33
-
34
-
35
-
36
- * Setting up rake tasks
37
- * Advanced project layout: splitting out decks into different files
38
- * Testing individual files (build groups, ranges, id-lookup)
39
- * Marketing images (using output as images, dependency in Rakefile)
40
- * Rulebook figures (build groups, annotate after saving)
41
- * Switch from built-in layouts to your own layout
42
- * Launch what you need with Launchy
43
- * Auto-building with Guard
44
- * Maintaining color and black-and-white builds (build groups, multiple layout files). Changing build sessions within Guard
45
- * Configuring different things for each build
46
- * Git (save to json, tagging, rolling back, Gemfile.lock)
@@ -1,18 +0,0 @@
1
- The Squib Way pt 4: Ruby Power!
2
- ===============================
3
-
4
- .. warning::
5
-
6
- To be written.
7
-
8
-
9
- This part is about cataloging some powerful things you can do if you're willing to write some Ruby.
10
-
11
- * Modifying XML at runtime (e.g. convert to black-and-white from color)
12
- * Using Travis to build and then post to something like Dropbox
13
- * Scaling the size of text based on its contents
14
- * Advanced Array techniques: inject, transpose, map, join (use the pre-req example)
15
- * Building newlines yourself (i.e. with your own placeholder like "%n" in Your Last Heist)
16
- * Summarization card backs for Your Last Heist as an example
17
- * "Lacks" string for Your Last Heist
18
- * Rules doc written in Markdown
@@ -1,14 +0,0 @@
1
- Squib + Git
2
- ===========
3
-
4
- .. warning::
5
-
6
- To be written
7
-
8
-
9
- Ideas:
10
- * .gitignore
11
- * Workflow
12
- * Tracking binary data (show json method)
13
- * Snippet about "what's changed"
14
- * Releases via tags and versioning
@@ -1,84 +0,0 @@
1
- Autobuild with Guard
2
- ====================
3
-
4
- .. warning::
5
-
6
- Under construction - going to fold this into the Workflow guide. For now, you can see my samples. This is mostly just a brain dump.
7
-
8
- Throughout your prototyping process, you'll be making small adjustments and then examining the graphical output. Re-running your code can get tedious, because you're cognitively switching from one context to another, e.g. editing x-y coordinates to running your code.
9
-
10
- Ruby has a great tool for this: `Guard <https://github.com/guard/guard>`_. With Guard, you specify one configuration file (i.e. a ``Guardfile``), and then Guard will *watch* a set of files, then execute a *task*. There are many ways of executing a task, but the cleanest way is via a ``rake`` in a ``Rakefile``.
11
-
12
- Project layout
13
- --------------
14
-
15
- Here's our project layout:
16
-
17
- .. code-block:: text
18
-
19
- .
20
- ├── config.yml
21
- ├── Gemfile
22
- ├── Guardfile
23
- ├── img
24
- │   └── robot-golem.svg
25
- ├── layouts
26
- │   ├── characters.yml
27
- │   └── skills.yml
28
- ├── Rakefile
29
- └── src
30
- ├── characters.rb
31
- └── skills.rb
32
-
33
- Using Guard + Rake
34
- ------------------
35
-
36
- Guard is a gem, just like Squib. When using Guard, I recommend also using Bundler. So your Gemfile will look like this.
37
-
38
- .. literalinclude:: ../../samples/project/Gemfile
39
- :language: ruby
40
- :linenos:
41
-
42
- And then your Rakefile might look something like this
43
-
44
- .. literalinclude:: ../../samples/project/Rakefile
45
- :language: ruby
46
- :linenos:
47
-
48
- To get our images directory set, and to turn on proress bars (which I recommend when working under Guard), you'll need a ``config.yml`` file that looks like this.
49
-
50
- .. literalinclude:: ../../samples/project/config.yml
51
- :language: yaml
52
- :linenos:
53
-
54
- Note that we are using ``load`` instead of ``require`` to run our code. In Ruby, ``require`` will only run our code once, because it's about loading a library. The ``load`` will run Ruby code no matter whether or not it's been loaded before. This doesn't usually matter, unless you're running under Guard.
55
-
56
- And then our Guardfile
57
-
58
- .. literalinclude:: ../../samples/project/Guardfile
59
- :language: ruby
60
- :linenos:
61
-
62
-
63
- So, let's say we're working on our Character deck. To run all this we can kick off our Guard with:
64
-
65
- .. code-block:: text
66
-
67
- $ bundle exec guard -g characters
68
- 14:45:20 - INFO - Run 'gem install win32console' to use color on Windows
69
- 14:45:21 - INFO - Starting guard-rake characters
70
- 14:45:21 - INFO - running characters
71
- Loading SVG(s) <===========================================> 100% Time: 00:00:00
72
- Saving PNGs to _output/character__* <======================> 100% Time: 00:00:00
73
- ]2;[running rake task: characters] watched files: []
74
- [1] Characters guard(main)> ow watching at 'C:/Users/andy/code/squib/samples/project'
75
-
76
- Guard will do an initial build, then wait for file changes to be made. From here, once we edit and save anything related to characters - any Excel file, our ``characters.rb`` file, any YML file, etc, we'll rebuild our images.
77
-
78
- Guard can do much, much more. It opens up a debugging console based on `pry <http://pryrepl.org/>`_, which means if your code is broken you can test things out right there.
79
-
80
- Guard also supports all kinds of notifications too. By default it tends to beep, but you can also have visual bells and other notifications.
81
-
82
- To quit guard, type ``quit`` on their console. Or, you can do ``Ctrl+C`` to quit.
83
-
84
- Enjoy!
@@ -1,65 +0,0 @@
1
- Hello, World! Dissected
2
- =======================
3
-
4
- After seeing Squib's `landing page <http://squib.rocks>`_, your might find it helpful to dissect what's really going on in each line of code of a basic Squib snippet.
5
-
6
- .. code-block:: ruby
7
- :linenos:
8
-
9
- require 'squib'
10
-
11
- Squib::Deck.new width: 825, height: 1125, cards: 2 do
12
- background color: 'pink'
13
- rect
14
- text str: ['Hello', 'World!']
15
- save_png prefix: 'hello_'
16
- end
17
-
18
- Let’s dissect this:
19
-
20
- * Line 1: this code will bring in the Squib library for us to use. Keep this at the top.
21
- * Line 2: By convention, we put a blank line between our require statements and the rest of our code
22
- * Line 3: Define a new deck of cards. Just 2 cards. 825 pixels wide etc. Squib also supports :doc:`/units` if you prefer to specify something like ``'2.75in'``.
23
- * Line 4: Set the background to pink. Colors can be in various notations, and supports linear and radial graidents - see :doc:`/colors`.
24
- * Line 5: Draw a rectangle around the edge of each card. Note that this has no arguments, because :doc:`/parameters`. The defaults can be found in the DSL reference for the :doc:`/dsl/rect` method.
25
- * Line 6: Put some text in upper-left the corner of the card, using the default font, etc. See the :doc:`/dsl/text` DSL method for more options. The first card will have ``'Hello'`` and the second card will have ``'World'`` because :doc:`/arrays`.
26
- * Line 7: Save our card out to a png files called ``hello_00.png`` and ``hello_01.png`` saved in the ``_output`` folder.
27
-
28
- Dissection of "Even Bigger..."
29
- ------------------------------
30
-
31
- On Squib's `landing page <http://squib.rocks>`_ we end with a pretty complex example. It's compact and designed to show how much you can get done with a little bit of code. Here's a dissection of that.
32
-
33
- .. code-block:: ruby
34
- :linenos:
35
-
36
- require 'squib'
37
-
38
- Squib::Deck.new(cards: 4, layout: %w(hand.yml even-bigger.yml)) do
39
- background color: '#230602'
40
- deck = xlsx file: 'even-bigger.xlsx'
41
- svg file: deck['Art'], layout: 'Art'
42
-
43
- %w(Title Description Snark).each do |key|
44
- text str: deck[key], layout: key
45
- end
46
-
47
- %w(Attack Defend Health).each do |key|
48
- svg file: "#{key.downcase}.svg", layout: "#{key}Icon"
49
- text str: deck[key], layout: key
50
- end
51
-
52
- save_png prefix: 'even_bigger_'
53
- showcase file: 'showcase.png', fill_color: '#0000'
54
- hand file: 'hand.png', trim: 37.5, trim_radius: 25, fill_color: '#0000'
55
- end
56
-
57
- * Line 3: Make 4 cards. Use two layouts: the built-in hand.yml (see :doc:`/layouts`) and then our own layout. The layouts get merged, with our own `even-bigger.yml` overriding ``hand.yml`` whenever they collide.
58
- * Line 5: Read some data from an Excel file, which amounts to a column-based hash of arrays, so that each element of an array corresponds to a specific data point to a given card. For example, ``3`` in the ``'Attack'`` column will be put on the second card.
59
- * Line 6: Using the Excel data cell for the filename, we can customize a different icon for every card. But, every SVG in this command will be styled according to the ``Art`` entry in our layout (i.e. in ``even-bigger.yml``)
60
- * Line 8: Iterate over an array of strings, namely, ``'Title'``, ``'Description'``, and ``'Snark'``.
61
- * Line 9: Draw text for the (Title, Description, or Snark), using *their* styling rules in our layout.
62
- * Line 13: Using `Ruby String interpolation <https://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Literals#Interpolation>`_, lookup the appropriate icon (e.g. ``'attack.svg'``), converted to lowercase letters, and then using the Icon layout of that for styling (e.g. ``'AttackIcon'`` or ``'DefendIcon'``)
63
- * Line 17: Render every card to individual PNG files
64
- * Line 18: Render a "showcase" of cards, using a perspective-reflect effect. See :doc:`/dsl/showcase` method.
65
- * Line 19: Render a "hand" of cards (spread over a circle). See :doc:`/dsl/hand` method.