squib 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/CHANGELOG.md +16 -1
- data/appveyor.yml +2 -3
- data/lib/squib/args/sheet.rb +66 -34
- data/lib/squib/graphics/save_pdf.rb +1 -1
- data/lib/squib/import/data_frame.rb +7 -7
- data/lib/squib/version.rb +1 -1
- data/samples/autoscale_font/_autoscale_font.rb +1 -1
- data/samples/build_groups/build_groups.rb +3 -3
- data/samples/colors/_colors.rb +1 -0
- data/samples/{config_text_markup.rb → config/config_text_markup.rb} +0 -0
- data/samples/{custom_config.rb → config/custom_config.rb} +0 -0
- data/samples/{cairo_access.rb → images/_cairo_access.rb} +0 -0
- data/samples/images/_images.rb +1 -1
- data/samples/{unicode.rb → images/_unicode.rb} +0 -0
- data/samples/intro/01_hello.rb +1 -2
- data/samples/intro/02_options.rb +1 -2
- data/samples/intro/03_layout.rb +1 -2
- data/samples/intro/04_arrays.rb +1 -2
- data/samples/intro/05_excel.rb +3 -4
- data/samples/{tgc_proofs.rb → proofs/_tgc_proofs.rb} +1 -4
- data/samples/saves/_save_pdf.rb +7 -0
- data/samples/{embed_text.rb → text/_embed_text.rb} +1 -0
- data/samples/text/_text.rb +1 -1
- data/samples/{text_options.rb → text/_text_options.rb} +1 -1
- data/samples/{bug134.rb → text/bug134.rb} +0 -0
- data/squib.gemspec +17 -16
- metadata +90 -596
- data/benchmarks/antialias_best.rb +0 -13
- data/benchmarks/antialias_best.yml +0 -1
- data/benchmarks/antialias_fast.rb +0 -13
- data/benchmarks/antialias_fast.yml +0 -1
- data/benchmarks/backend-svg.yml +0 -4
- data/benchmarks/backend_memory.rb +0 -14
- data/benchmarks/backend_svg.rb +0 -14
- data/benchmarks/shiny-purse.png +0 -0
- data/benchmarks/spanner.svg +0 -91
- data/benchmarks/tons_of_png.rb +0 -6
- data/benchmarks/tons_of_svg.rb +0 -7
- data/benchmarks/tons_of_text.rb +0 -8
- data/docs/Makefile +0 -216
- data/docs/_static/css/squibdocs.css +0 -23
- data/docs/args/draw.rst +0 -36
- data/docs/args/expansion.rst +0 -3
- data/docs/args/layout.rst +0 -6
- data/docs/args/output_dir.rst +0 -6
- data/docs/args/range.rst +0 -6
- data/docs/args/transform.rst +0 -51
- data/docs/args/trim.rst +0 -11
- data/docs/args/wh.rst +0 -12
- data/docs/args/xy.rst +0 -12
- data/docs/arrays.rst +0 -80
- data/docs/backends.rst +0 -20
- data/docs/bleed.rst +0 -13
- data/docs/build_groups.rst +0 -45
- data/docs/colors.rst +0 -90
- data/docs/conf.py +0 -287
- data/docs/config.rst +0 -135
- data/docs/data.rst +0 -26
- data/docs/dsl/background.rst +0 -20
- data/docs/dsl/build.rst +0 -32
- data/docs/dsl/build_groups.rst +0 -23
- data/docs/dsl/circle.rst +0 -27
- data/docs/dsl/cm.rst +0 -19
- data/docs/dsl/configure.rst +0 -18
- data/docs/dsl/csv.rst +0 -81
- data/docs/dsl/curve.rst +0 -63
- data/docs/dsl/data_frame.rst +0 -85
- data/docs/dsl/deck.rst +0 -45
- data/docs/dsl/disable_build.rst +0 -25
- data/docs/dsl/disable_build_globally.rst +0 -46
- data/docs/dsl/ellipse.rst +0 -23
- data/docs/dsl/enable_build.rst +0 -25
- data/docs/dsl/enable_build_globally.rst +0 -44
- data/docs/dsl/grid.rst +0 -31
- data/docs/dsl/hand.rst +0 -40
- data/docs/dsl/hint.rst +0 -15
- data/docs/dsl/inches.rst +0 -19
- data/docs/dsl/index.rst +0 -9
- data/docs/dsl/line.rst +0 -52
- data/docs/dsl/mm.rst +0 -19
- data/docs/dsl/png.rst +0 -49
- data/docs/dsl/polygon.rst +0 -28
- data/docs/dsl/rect.rst +0 -22
- data/docs/dsl/save.rst +0 -23
- data/docs/dsl/save_pdf.rst +0 -89
- data/docs/dsl/save_png.rst +0 -46
- data/docs/dsl/save_sheet.rst +0 -55
- data/docs/dsl/showcase.rst +0 -76
- data/docs/dsl/star.rst +0 -35
- data/docs/dsl/svg.rst +0 -119
- data/docs/dsl/text.rst +0 -292
- data/docs/dsl/triangle.rst +0 -50
- data/docs/dsl/use_layout.rst +0 -16
- data/docs/dsl/xlsx.rst +0 -56
- data/docs/guides/game_icons.rst +0 -126
- data/docs/guides/getting-started/index.rst +0 -5
- data/docs/guides/getting-started/part_0_learning_ruby.rst +0 -145
- data/docs/guides/getting-started/part_1_zero_to_game.rst +0 -217
- data/docs/guides/getting-started/part_2_iconography.rst +0 -228
- data/docs/guides/getting-started/part_3_workflows.rst +0 -46
- data/docs/guides/getting-started/part_4_ruby_power.rst +0 -18
- data/docs/guides/git.rst +0 -14
- data/docs/guides/guard.rst +0 -84
- data/docs/guides/hello_world.rst +0 -65
- data/docs/guides/projects.rst +0 -35
- data/docs/help.rst +0 -157
- data/docs/index.rst +0 -35
- data/docs/install.rst +0 -68
- data/docs/layouts.rst +0 -290
- data/docs/learning.rst +0 -12
- data/docs/make.bat +0 -263
- data/docs/parameters.rst +0 -34
- data/docs/server.bat +0 -1
- data/docs/text_feature.rst +0 -115
- data/docs/units.rst +0 -14
- data/samples/autoscale_font/.gitignore +0 -2
- data/samples/autoscale_font/card_00_expected.png +0 -0
- data/samples/backend/.gitignore +0 -1
- data/samples/backend/_backend-config.yml +0 -5
- data/samples/backend/backend_00_expected.png +0 -0
- data/samples/backend/backend_01_expected.png +0 -0
- data/samples/backend/backend_vectorized_expected.pdf +0 -0
- data/samples/backend/backend_vectors_00_expected.svg +0 -84
- data/samples/backend/backend_vectors_01_expected.svg +0 -84
- data/samples/backend/shiny-purse.png +0 -0
- data/samples/backend/showcase_expected.png +0 -0
- data/samples/backend/spanner.svg +0 -91
- data/samples/ball.png +0 -0
- data/samples/build_groups/.gitignore +0 -1
- data/samples/build_groups/Rakefile +0 -25
- data/samples/colors/.gitignore +0 -1
- data/samples/colors/color_constants_00_expected.png +0 -0
- data/samples/colors/colors_00_expected.png +0 -0
- data/samples/colors/gradient_00_expected.png +0 -0
- data/samples/config_disable_quotes.yml +0 -3
- data/samples/config_text_markup.yml +0 -9
- data/samples/custom-config.yml +0 -5
- data/samples/customconfig-imgdir/shiny-purse2.png +0 -0
- data/samples/customconfig-imgdir/spanner2.svg +0 -91
- data/samples/data/.gitignore +0 -1
- data/samples/data/explode_quantities.xlsx +0 -0
- data/samples/data/quantity_explosion.csv +0 -3
- data/samples/data/sample.csv +0 -3
- data/samples/data/sample.xlsx +0 -0
- data/samples/data/sample_csv_00_expected.png +0 -0
- data/samples/data/sample_csv_01_expected.png +0 -0
- data/samples/data/sample_csv_qty_00_expected.png +0 -0
- data/samples/data/sample_excel_00_expected.png +0 -0
- data/samples/data/sample_excel_01_expected.png +0 -0
- data/samples/data/sample_excel_02_expected.png +0 -0
- data/samples/data/sample_excel_resources_00_expected.png +0 -0
- data/samples/data/sample_excel_resources_01_expected.png +0 -0
- data/samples/data/sample_xlsx_qty_00_expected.png +0 -0
- data/samples/glass-heart.svg +0 -52
- data/samples/grit.png +0 -0
- data/samples/images/.gitignore +0 -8
- data/samples/images/_images_00_expected.png +0 -0
- data/samples/images/angler-fish.png +0 -0
- data/samples/images/ball.png +0 -0
- data/samples/images/glass-heart.svg +0 -52
- data/samples/images/grit.png +0 -0
- data/samples/images/offset.svg +0 -85
- data/samples/images/robot-golem.svg +0 -1
- data/samples/images/shiny-purse.png +0 -0
- data/samples/images/spanner.svg +0 -91
- data/samples/images/sprites.png +0 -0
- data/samples/images/with-alpha.png +0 -0
- data/samples/intro/.gitignore +0 -2
- data/samples/intro/auto-repair.svg +0 -1
- data/samples/intro/crawling.svg +0 -1
- data/samples/intro/data.xlsx +0 -0
- data/samples/intro/humans.svg +0 -1
- data/samples/intro/ninja-mask.svg +0 -1
- data/samples/intro/part1_00_expected.png +0 -0
- data/samples/intro/part2_00_expected.png +0 -0
- data/samples/intro/part3_00_expected.png +0 -0
- data/samples/intro/part3_layout.yml +0 -34
- data/samples/intro/part4_00_expected.png +0 -0
- data/samples/intro/part4_01_expected.png +0 -0
- data/samples/intro/part5_00_expected.png +0 -0
- data/samples/intro/part5_01_expected.png +0 -0
- data/samples/intro/part5_02_expected.png +0 -0
- data/samples/intro/part5_03_expected.png +0 -0
- data/samples/intro/part5_hand_expected.png +0 -0
- data/samples/intro/part5_showcase_expected.png +0 -0
- data/samples/intro/pirate-skull.svg +0 -1
- data/samples/intro/robot-golem.svg +0 -1
- data/samples/layouts/custom-layout.yml +0 -60
- data/samples/layouts/custom-layout2.yml +0 -15
- data/samples/layouts/expected_layouts_builtin_economy_00.png +0 -0
- data/samples/layouts/expected_layouts_builtin_fantasy_00.png +0 -0
- data/samples/layouts/expected_layouts_builtin_hand_00.png +0 -0
- data/samples/layouts/expected_layouts_builtin_playing_card_00.png +0 -0
- data/samples/layouts/expected_layouts_builtin_tuck_box_00.png +0 -0
- data/samples/layouts/shiny-purse.png +0 -0
- data/samples/layouts/spanner.svg +0 -91
- data/samples/load_images_config.yml +0 -1
- data/samples/offset.svg +0 -71
- data/samples/pokercard.png +0 -0
- data/samples/project/Gemfile +0 -6
- data/samples/project/Guardfile +0 -18
- data/samples/project/Rakefile +0 -25
- data/samples/project/bw/robot-golem.svg +0 -53
- data/samples/project/color/robot-golem.svg +0 -1
- data/samples/project/config.yml +0 -2
- data/samples/project/layouts/characters.yml +0 -3
- data/samples/project/layouts/skills.yml +0 -3
- data/samples/ranges/glass-heart.svg +0 -52
- data/samples/ranges/ranges_00_expected.png +0 -0
- data/samples/saves/.gitignore +0 -1
- data/samples/saves/hand_expected.png +0 -0
- data/samples/saves/hand_pretty_expected.png +0 -0
- data/samples/saves/save-pdf-small_expected.pdf +0 -0
- data/samples/saves/save-pdf_expected.pdf +0 -0
- data/samples/saves/save_png_00_expected.png +0 -0
- data/samples/saves/save_png_trimmed_00_expected.png +0 -0
- data/samples/saves/save_sheet_00_expected.png +0 -0
- data/samples/saves/save_sheet_01_expected.png +0 -0
- data/samples/saves/save_sheet_range_00_expected.png +0 -0
- data/samples/saves/save_sheet_range_01_expected.png +0 -0
- data/samples/saves/save_single_sheet_00_expected.png +0 -0
- data/samples/saves/saves_notrim_01_expected.png +0 -0
- data/samples/saves/showcase2_expected.png +0 -0
- data/samples/saves/showcase_expected.png +0 -0
- data/samples/saves/showcase_individual_00_expected.png +0 -0
- data/samples/saves/showcase_individual_01_expected.png +0 -0
- data/samples/saves/showcase_individual_02_expected.png +0 -0
- data/samples/saves/showcase_individual_03_expected.png +0 -0
- data/samples/saves/spanner.svg +0 -91
- data/samples/shapes/.gitignore +0 -1
- data/samples/shapes/shape_00_expected.png +0 -0
- data/samples/shiny-purse.png +0 -0
- data/samples/spanner.svg +0 -91
- data/samples/sprites.png +0 -0
- data/samples/text/.gitignore +0 -2
- data/samples/text/README.md +0 -1
- data/samples/text/_text_00_expected.png +0 -0
- data/samples/text/config.yml +0 -2
- data/samples/units/units_00_expected.png +0 -0
- data/samples/units/using_units.yml +0 -10
- data/spec/api/api_data_spec.rb +0 -172
- data/spec/api/api_groups_spec.rb +0 -49
- data/spec/api/api_settings_spec.rb +0 -38
- data/spec/api/api_units_spec.rb +0 -37
- data/spec/args/box_spec.rb +0 -127
- data/spec/args/draw_spec.rb +0 -101
- data/spec/args/embed_key_spec.rb +0 -13
- data/spec/args/input_file_spec.rb +0 -21
- data/spec/args/paint_spec.rb +0 -22
- data/spec/args/paragraph_spec.rb +0 -153
- data/spec/args/range_spec.rb +0 -41
- data/spec/args/save_batch_spec.rb +0 -51
- data/spec/args/scale_box_spec.rb +0 -71
- data/spec/args/sheet_spec.rb +0 -80
- data/spec/args/showcase_special_spec.rb +0 -15
- data/spec/args/transform_spec.rb +0 -25
- data/spec/args/typographer_spec.rb +0 -71
- data/spec/args/unit_conversion_spec.rb +0 -29
- data/spec/card_spec.rb +0 -11
- data/spec/commands/new_spec.rb +0 -48
- data/spec/conf_spec.rb +0 -47
- data/spec/data/conf/basic.yml +0 -1
- data/spec/data/conf/empty.yml +0 -1
- data/spec/data/conf/unrecognized.yml +0 -4
- data/spec/data/csv/basic.csv +0 -3
- data/spec/data/csv/custom_opts.csv +0 -2
- data/spec/data/csv/dup_cols.csv +0 -3
- data/spec/data/csv/newline.csv +0 -3
- data/spec/data/csv/qty.csv +0 -3
- data/spec/data/csv/qty_named.csv +0 -3
- data/spec/data/csv/with_spaces.csv +0 -3
- data/spec/data/csv/yield.csv +0 -3
- data/spec/data/layouts/easy-circular-extends.yml +0 -6
- data/spec/data/layouts/empty-rule.yml +0 -1
- data/spec/data/layouts/empty.yml +0 -1
- data/spec/data/layouts/extends-nonexists.yml +0 -3
- data/spec/data/layouts/extends-units-mixed.yml +0 -8
- data/spec/data/layouts/extends-units.yml +0 -8
- data/spec/data/layouts/hard-circular-extends.yml +0 -9
- data/spec/data/layouts/multi-extends-single-entry.yml +0 -14
- data/spec/data/layouts/multi-level-extends.yml +0 -10
- data/spec/data/layouts/multifile-a.yml +0 -4
- data/spec/data/layouts/multifile-b.yml +0 -4
- data/spec/data/layouts/multifile-extends-a.yml +0 -8
- data/spec/data/layouts/multifile-extends-b.yml +0 -9
- data/spec/data/layouts/no-extends.yml +0 -5
- data/spec/data/layouts/pre-extends.yml +0 -7
- data/spec/data/layouts/self-circular-extends.yml +0 -3
- data/spec/data/layouts/single-extends.yml +0 -7
- data/spec/data/layouts/single-level-multi-extends.yml +0 -12
- data/spec/data/samples/autoscale_font/_autoscale_font.rb.txt +0 -133
- data/spec/data/samples/basic.rb.txt +0 -248
- data/spec/data/samples/cairo_access.rb.txt +0 -59
- data/spec/data/samples/colors/_gradients.rb.txt +0 -84
- data/spec/data/samples/config_text_markup.rb.txt +0 -74
- data/spec/data/samples/custom_config.rb.txt +0 -59
- data/spec/data/samples/data/_csv.rb.txt +0 -231
- data/spec/data/samples/data/_excel.rb.txt +0 -704
- data/spec/data/samples/embed_text.rb.txt +0 -431
- data/spec/data/samples/hello_world.rb.txt +0 -38
- data/spec/data/samples/images/_more_load_images.rb.txt +0 -335
- data/spec/data/samples/layouts.rb.txt +0 -489
- data/spec/data/samples/ranges/_ranges.rb.txt +0 -484
- data/spec/data/samples/saves/_hand.rb.txt +0 -594
- data/spec/data/samples/saves/_portrait_landscape.rb.txt +0 -57
- data/spec/data/samples/saves/_save_pdf.rb.txt +0 -1601
- data/spec/data/samples/saves/_saves.rb.txt +0 -873
- data/spec/data/samples/saves/_showcase.rb.txt +0 -5942
- data/spec/data/samples/shapes/_draw_shapes.rb.txt +0 -757
- data/spec/data/samples/text_options.rb.txt +0 -1158
- data/spec/data/samples/tgc_proofs.rb.txt +0 -102
- data/spec/data/samples/units/_units.rb.txt +0 -53
- data/spec/data/xlsx/basic.xlsx +0 -0
- data/spec/data/xlsx/explode_quantities.xlsx +0 -0
- data/spec/data/xlsx/formulas.xlsx +0 -0
- data/spec/data/xlsx/whitespace.xlsx +0 -0
- data/spec/data/xlsx/with_macros.xlsm +0 -0
- data/spec/deck_spec.rb +0 -73
- data/spec/graphics/cairo_context_wrapper_spec.rb +0 -104
- data/spec/graphics/embedding_utils_spec.rb +0 -73
- data/spec/graphics/graphics_save_doc_spec.rb +0 -74
- data/spec/import/data_frame_spec.rb +0 -251
- data/spec/layout_parser_spec.rb +0 -226
- data/spec/logger_spec.rb +0 -12
- data/spec/samples/_diffs/gitkeep.txt +0 -0
- data/spec/samples/diff-with-css.example.html +0 -39
- data/spec/samples/expected/autoscale_00.png +0 -0
- data/spec/samples/expected/autoscale_01.png +0 -0
- data/spec/samples/expected/autoscale_02.png +0 -0
- data/spec/samples/expected/backend_00.png +0 -0
- data/spec/samples/expected/backend_00.svg +0 -78
- data/spec/samples/expected/backend_01.png +0 -0
- data/spec/samples/expected/backend_01.svg +0 -78
- data/spec/samples/expected/basic_00.png +0 -0
- data/spec/samples/expected/basic_01.png +0 -0
- data/spec/samples/expected/basic_02.png +0 -0
- data/spec/samples/expected/cairo_access_00.png +0 -0
- data/spec/samples/expected/cairo_access_01.png +0 -0
- data/spec/samples/expected/card_00.png +0 -0
- data/spec/samples/expected/card_01.png +0 -0
- data/spec/samples/expected/colors_00.png +0 -0
- data/spec/samples/expected/config_disable_text_00.png +0 -0
- data/spec/samples/expected/config_text_00.png +0 -0
- data/spec/samples/expected/custom-config_00.png +0 -0
- data/spec/samples/expected/embed_00.png +0 -0
- data/spec/samples/expected/embed_multisheet_00.png +0 -0
- data/spec/samples/expected/gitkeep.txt +0 -0
- data/spec/samples/expected/gradient_00.png +0 -0
- data/spec/samples/expected/hand.png +0 -0
- data/spec/samples/expected/hand_pretty.png +0 -0
- data/spec/samples/expected/landscape_00.png +0 -0
- data/spec/samples/expected/layout2_00.png +0 -0
- data/spec/samples/expected/layout_00.png +0 -0
- data/spec/samples/expected/layout_builtin_hand_00.png +0 -0
- data/spec/samples/expected/layout_builtin_playing_card_00.png +0 -0
- data/spec/samples/expected/load_images_00.png +0 -0
- data/spec/samples/expected/portrait_00.png +0 -0
- data/spec/samples/expected/ranges_00.png +0 -0
- data/spec/samples/expected/sample_csv_00.png +0 -0
- data/spec/samples/expected/sample_csv_01.png +0 -0
- data/spec/samples/expected/sample_excel_00.png +0 -0
- data/spec/samples/expected/sample_excel_01.png +0 -0
- data/spec/samples/expected/sample_excel_02.png +0 -0
- data/spec/samples/expected/save_sheet_00.png +0 -0
- data/spec/samples/expected/save_sheet_01.png +0 -0
- data/spec/samples/expected/save_sheet_range_00.png +0 -0
- data/spec/samples/expected/save_sheet_range_01.png +0 -0
- data/spec/samples/expected/save_single_sheet_00.png +0 -0
- data/spec/samples/expected/saves_notrim_01.png +0 -0
- data/spec/samples/expected/shape_00.png +0 -0
- data/spec/samples/expected/showcase.png +0 -0
- data/spec/samples/expected/showcase2.png +0 -0
- data/spec/samples/expected/showcase_individual_00.png +0 -0
- data/spec/samples/expected/showcase_individual_01.png +0 -0
- data/spec/samples/expected/showcase_individual_02.png +0 -0
- data/spec/samples/expected/showcase_individual_03.png +0 -0
- data/spec/samples/expected/text_00.png +0 -0
- data/spec/samples/expected/text_01.png +0 -0
- data/spec/samples/expected/text_02.png +0 -0
- data/spec/samples/expected/tgc_sample_00.png +0 -0
- data/spec/samples/expected/units_00.png +0 -0
- data/spec/samples/run_samples_spec.rb +0 -17
- data/spec/samples/samples_regression_spec.rb +0 -71
- data/spec/samples/sanity.html.erb +0 -28
- data/spec/samples/sanity.rb +0 -70
- data/spec/sanity/.gitignore +0 -1
- data/spec/sanity/sanity.html.erb +0 -42
- data/spec/sanity/sanity_test.rb +0 -42
- data/spec/sanity/tests.yml +0 -12
- data/spec/spec_helper.rb +0 -159
data/docs/guides/projects.rst
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
Squib in Action
|
|
2
|
-
===============
|
|
3
|
-
|
|
4
|
-
Squib is in use by a lot of people! You can learn a lot from looking at how a whole project is put together.
|
|
5
|
-
|
|
6
|
-
A good way to peruse Squib code is to search for Ruby files on GitHub that have the phrase ``require 'squib'`` in them. And these are the just the people who have decided to release their code open source!
|
|
7
|
-
|
|
8
|
-
My Projects
|
|
9
|
-
-----------
|
|
10
|
-
|
|
11
|
-
Here are some of my own board and card games that use Squib. They are all under "active" development, which means that sometimes I leave them alone for long periods of time ;)
|
|
12
|
-
|
|
13
|
-
* `Your Last Heist <http://github.com/andymeneely/project-timber-wolf>`_ is a big-box cooperative game. Lots of really cool Squib things in here, including lots of Rake features, color+bw, and showing how skills can "level up" on their backs by diff'ing the stats in Squib. You can see what the components look like at `the game website <http://yourlastheist.com>`_. Also: the best game I've ever made.
|
|
14
|
-
* `Victory Point Salad <https://github.com/andymeneely/victory-point-salad>`_. A card-only game with lots and lots and lots of cards. Pretty straightforward as far as Squib usage goes, but it's a good peek into how I like to use Squib. Also: the funniest game I've made.
|
|
15
|
-
* `Junk Land <https://github.com/andymeneely/junk-land>`_ A game I made prior to making starting Squib, but then ported over to Squib while developing Squib. Uses some strange features of SVG, but also a good intro. Also: the scrappiest game I've made.
|
|
16
|
-
|
|
17
|
-
.. note::
|
|
18
|
-
|
|
19
|
-
Want to donate back to Squib? Volunteer to playtest these games :)
|
|
20
|
-
|
|
21
|
-
Other Projects using Squib
|
|
22
|
-
--------------------------
|
|
23
|
-
|
|
24
|
-
Poking around GitHub, here are a few sightings of Squib:
|
|
25
|
-
|
|
26
|
-
* `Ecovalia <https://github.com/evolve2k/ecovalia-game>`_ - a game rapidly prototyped in a hackathon. Squib is featured in their video!
|
|
27
|
-
* `Werewolf <https://github.com/Xpktro/werewolf>`_ implemented and even uses GitHub releases!
|
|
28
|
-
* `Cult Following <https://github.com/ericathegreat/Cult-Following>`_ is a neat-looking project
|
|
29
|
-
* ScrapyardArmory's `Dysplacement <https://www.thegamecrafter.com/games/dysplacement>`_ was used with Squib, and **won** the `Worker Placement contest <https://www.thegamecrafter.com/games/dysplacement>`_ over at TheGameCrafter.
|
|
30
|
-
* `Mad World <https://github.com/spilth/madworld>`_ uses CircleCI to build, even with some custom fonts.
|
|
31
|
-
|
|
32
|
-
Want yours here?
|
|
33
|
-
----------------
|
|
34
|
-
|
|
35
|
-
Create an issue on Github and ask for a link her and we'll add it here!
|
data/docs/help.rst
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
Get Help and Give Help
|
|
2
|
-
======================
|
|
3
|
-
|
|
4
|
-
.. raw:: html
|
|
5
|
-
|
|
6
|
-
On BoardGameGeek.com? Show your Squib pride by <a href="https://boardgamegeek.com/microbadge/37841">getting the microbadge <img src="https://cdn.rawgit.com/andymeneely/squib/gh-pages/images/microbadge.png"></a> and <a href="https://boardgamegeek.com/guilds/2601">joining our guild!</a>
|
|
7
|
-
|
|
8
|
-
Get Help
|
|
9
|
-
--------
|
|
10
|
-
|
|
11
|
-
Squib is powerful and customizable, which means it can get complicated pretty quickly. Don't settle for being stuck.
|
|
12
|
-
|
|
13
|
-
Here's an ordered list of how to find help:
|
|
14
|
-
|
|
15
|
-
1. Go through this documentation
|
|
16
|
-
2. Go through `the wiki <https://github.com/andymeneely/squib/wiki>`_
|
|
17
|
-
3. Go through `the samples <https://github.com/andymeneely/squib/tree/master/samples>`_
|
|
18
|
-
4. Google it - people have asked lots of questions about Squib already in many forums.
|
|
19
|
-
5. Ask on Stackoverflow `using the tags "ruby" and "squib" <http://stackoverflow.com/questions/ask?tags=ruby squib>`_. You will get answers quickly from Ruby programmers it's and a great way for us to archive questions for future Squibbers.
|
|
20
|
-
6. Our `thread on BoardGameGeek <http://boardgamegeek.com/thread/1293453>`_ or `our guild <https://boardgamegeek.com/guild/2601>`_ is quite active and informal (if a bit unstructured).
|
|
21
|
-
|
|
22
|
-
If you email me directly I'll probably ask you to post your question publicly so we can document answers for future Googling Squibbers.
|
|
23
|
-
|
|
24
|
-
Please use GitHub issues for bugs and feature requests.
|
|
25
|
-
|
|
26
|
-
Help by Troubleshooting
|
|
27
|
-
-----------------------
|
|
28
|
-
|
|
29
|
-
One of the best ways you can help the Squib community is to be active on the above forums. Help people out. Answer questions. Share your code. Most of those forums have a "subscribe" feature.
|
|
30
|
-
|
|
31
|
-
You can also watch the project on GitHub, which means you get notified when new bugs and features are entered. Try reproducing code on your own machine to confirm a bug. Help write minimal test cases. Suggest workarounds.
|
|
32
|
-
|
|
33
|
-
Help by Beta Testing
|
|
34
|
-
--------------------
|
|
35
|
-
|
|
36
|
-
.. Testers needed!! If you want to test new features as I develop them, or make sure I didn't break your code, you can always point your Gemfile to the repository and follow what I'm doing there. Your Gemfile specification looks like this::
|
|
37
|
-
..
|
|
38
|
-
.. gem 'squib', git: 'git://github.com/andymeneely/squib', branch: 'dev'
|
|
39
|
-
..
|
|
40
|
-
.. * The ``dev`` branch is where I am working on features in-process. I have not done much regression testing at this point, but would love testing feedback nonetheless.
|
|
41
|
-
.. * The ``master`` branch is where I consider features and bug that are done and tested, but not released yet.
|
|
42
|
-
|
|
43
|
-
Squib is a small operation. And programming is hard. So we need testers! In particular, I could use help from people to do the following:
|
|
44
|
-
|
|
45
|
-
* Test out new features as I write them
|
|
46
|
-
* Watch for regression bugs by running their current projects on new Squib code, checking for compatibility issues.
|
|
47
|
-
|
|
48
|
-
Want to join the mailing list and get notifications? https://groups.google.com/forum/#!forum/squib-testers
|
|
49
|
-
|
|
50
|
-
There's no time commitment expectation associated with signing up. Any help you can give is appreciated!
|
|
51
|
-
|
|
52
|
-
Beta: Using Pre-Builds
|
|
53
|
-
^^^^^^^^^^^^^^^^^^^^^^
|
|
54
|
-
|
|
55
|
-
The preferred way of doing beta testing is by to get Squib directly from my GitHub repository. Bundler makes this easy.
|
|
56
|
-
|
|
57
|
-
If you are just starting out you'll need to install bundler::
|
|
58
|
-
|
|
59
|
-
$ gem install bundler
|
|
60
|
-
|
|
61
|
-
Then, in the root of your Squib project, create a file called `Gemfile` (capitalization counts). Put this in it::
|
|
62
|
-
|
|
63
|
-
source 'https://rubygems.org'
|
|
64
|
-
|
|
65
|
-
gem 'squib', git: 'git://github.com/andymeneely/squib', branch: 'master'
|
|
66
|
-
|
|
67
|
-
Then run::
|
|
68
|
-
|
|
69
|
-
$ bundle install
|
|
70
|
-
|
|
71
|
-
Your output will look something like this::
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
Fetching git://github.com/andymeneely/squib
|
|
75
|
-
Fetching gem metadata from https://rubygems.org/.........
|
|
76
|
-
Fetching version metadata from https://rubygems.org/...
|
|
77
|
-
Fetching dependency metadata from https://rubygems.org/..
|
|
78
|
-
Resolving dependencies...
|
|
79
|
-
Using pkg-config 1.1.6
|
|
80
|
-
Using cairo 1.14.3
|
|
81
|
-
Using glib2 3.0.7
|
|
82
|
-
Using gdk_pixbuf2 3.0.7
|
|
83
|
-
Using mercenary 0.3.5
|
|
84
|
-
Using mini_portile2 2.0.0
|
|
85
|
-
Using nokogiri 1.6.7
|
|
86
|
-
Using pango 3.0.7
|
|
87
|
-
Using rubyzip 1.1.7
|
|
88
|
-
Using roo 2.3.0
|
|
89
|
-
Using rsvg2 3.0.7
|
|
90
|
-
Using ruby-progressbar 1.7.5
|
|
91
|
-
Using squib 0.9.0b from git://github.com/andymeneely/squib (at master)
|
|
92
|
-
Using bundler 1.10.6
|
|
93
|
-
Bundle complete! 1 Gemfile dependency, 14 gems now installed.
|
|
94
|
-
Use `bundle show [gemname]` to see where a bundled gem is installed.
|
|
95
|
-
|
|
96
|
-
To double-check that you're using the test version of Squib, puts this in your code::
|
|
97
|
-
|
|
98
|
-
require 'squib'
|
|
99
|
-
puts Squib::VERSION # prints the Squib version to the console when you run this code
|
|
100
|
-
|
|
101
|
-
# Rest of your Squib code...
|
|
102
|
-
|
|
103
|
-
When you run your code, say ``deck.rb``, you'll need to put ``bundle exec`` in front of it. Otherwise Ruby will just go with full releases (e.g. ``0.8`` instead of pre-releases, e.g. ``0.9a``). That would look like this::
|
|
104
|
-
|
|
105
|
-
$ bundle exec ruby deck.rb
|
|
106
|
-
|
|
107
|
-
If you need to know the exact commit of the build, you can see that commit hash in the generated ``Gemfile.lock``. That ``revision`` field will tell you the *exact* version you're using, which can be helpful for debugging. That will look something like this::
|
|
108
|
-
|
|
109
|
-
remote: git://github.com/andymeneely/squib
|
|
110
|
-
revision: 440a8628ed83b24987b9f6af66ad9a6e6032e781
|
|
111
|
-
branch: master
|
|
112
|
-
|
|
113
|
-
To update to the latest from the repository, run ``bundle up``.
|
|
114
|
-
|
|
115
|
-
To remove Squib versions, run ``gem cleanup squib``. This will also remove old Squib releases.
|
|
116
|
-
|
|
117
|
-
Beta: About versions
|
|
118
|
-
^^^^^^^^^^^^^^^^^^^^
|
|
119
|
-
|
|
120
|
-
* When the version ends in "a" (e.g. ``v0.9a``), then the build is "alpha". I could be putting in new code all the time without bumping the version. I try to keep things as stable after every commit, but this is considered the least stable code. (Testing still appreciated here, though.) This is also tracked by my ``dev`` branch.
|
|
121
|
-
* For versions ending in "b" (e.g. ``v0.9b``), then the build is in "beta". Features are frozen until release, and we're just looking for bug fixes. This tends to be tracked by the ``master`` branch in my repository.
|
|
122
|
-
* I follow the `Semantic Versioning <http://semver.org>`_ as best I can
|
|
123
|
-
|
|
124
|
-
Beta: About Bundler+RubyGems
|
|
125
|
-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
126
|
-
|
|
127
|
-
The Gemfile is a configuration file (technically it's a Ruby DSL) for a widely-used library in the Ruby community called Bundler. Bundler is a way of managing multiple RubyGems at once, and specifying exactly what you want.
|
|
128
|
-
|
|
129
|
-
Bundler is different from RubyGems. Technically, you CAN use RubyGems without Bundler: just ``gem install`` what you need and your ``require`` statements will work. BUT Bundler helps you specify versions with the Gemfile, and where to get your gems. If you're switching between different versions of gems (like with being tester!), then Bundler is the way to go. The Bundler website is here: http://bundler.io/.
|
|
130
|
-
|
|
131
|
-
By convention, your ``Gemfile`` should be in the root directory of your project. If you did ``squib new``, there will be one created by default. Normally, a Squib project Gemfile will look `like this <https://github.com/andymeneely/squib/blob/master/lib/squib/project_template/Gemfile>`_. That configuration just pulls the Squib from RubyGems.
|
|
132
|
-
|
|
133
|
-
But, as a tester, you'll want to have Bundler install Squib from my repository. That would look like this: https://github.com/andymeneely/project-spider-monkey/blob/master/Gemfile. (Just line 4 - ignore the other stuff.) I tend to work with two main branches - dev and master. Master is more stable, dev is more bleeding edge. Problems in the master branch will be a surprise to me, problems in the dev branch probably won't surprise me.
|
|
134
|
-
|
|
135
|
-
After changing your Gemfile, you'll need to run ``bundle install``. That will generate a ``Gemfile.lock`` file - that's Bundler's way of saying exactly what it's planning on using. You don't modify the Gemfile.lock, but you can look at it to see what version of Squib it's locked onto.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
Help by Fixing Bugs
|
|
140
|
-
-------------------
|
|
141
|
-
|
|
142
|
-
A great way to make yourself known in the community is to go over `our backlog <https://github.com/andymeneely/squib/issues>`_ and work on fixing bugs. Even suggestions on troubleshooting what's going on (e.g. trying it out on different OS versions) can be a big help.
|
|
143
|
-
|
|
144
|
-
Help by Contributing Code
|
|
145
|
-
-------------------------
|
|
146
|
-
|
|
147
|
-
Our biggest needs are in community support. But, if you happen to have some code to contribute, follow this process:
|
|
148
|
-
|
|
149
|
-
1. Fork the git repository ( https://github.com/[my-github-username]/squib/fork )
|
|
150
|
-
2. Create your feature branch (``git checkout -b my-new-feature``)
|
|
151
|
-
3. Commit your changes (``git commit -am 'Add some feature'``)
|
|
152
|
-
4. Push to the branch (``git push origin my-new-feature``)
|
|
153
|
-
5. Create a new Pull Request
|
|
154
|
-
|
|
155
|
-
Be sure to write tests and samples for new features.
|
|
156
|
-
|
|
157
|
-
Be sure to run the unit tests and packaging with just ``rake``. Also, you can check that the samples render properly with ``rake sanity``.
|
data/docs/index.rst
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
Squib Documentation
|
|
2
|
-
===================
|
|
3
|
-
|
|
4
|
-
Welcome to the official Squib documentation!
|
|
5
|
-
|
|
6
|
-
Contents:
|
|
7
|
-
|
|
8
|
-
.. toctree::
|
|
9
|
-
:maxdepth: 3
|
|
10
|
-
|
|
11
|
-
install
|
|
12
|
-
learning
|
|
13
|
-
parameters
|
|
14
|
-
arrays
|
|
15
|
-
layouts
|
|
16
|
-
data
|
|
17
|
-
units
|
|
18
|
-
colors
|
|
19
|
-
text_feature
|
|
20
|
-
bleed
|
|
21
|
-
config
|
|
22
|
-
backends
|
|
23
|
-
build_groups
|
|
24
|
-
help
|
|
25
|
-
dsl/index.rst
|
|
26
|
-
|
|
27
|
-
Indices and tables
|
|
28
|
-
==================
|
|
29
|
-
|
|
30
|
-
* :ref:`genindex`
|
|
31
|
-
* :ref:`search`
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
.. meta::
|
|
35
|
-
:google-site-verification: BWelviUOeiImUuyxt54P6YinZcSuxHm8_aQidm9ju-U
|
data/docs/install.rst
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
Install & Update
|
|
2
|
-
================
|
|
3
|
-
|
|
4
|
-
Squib is a Ruby gem, and installation is handled like most gems.
|
|
5
|
-
|
|
6
|
-
Pre-requisites
|
|
7
|
-
--------------
|
|
8
|
-
|
|
9
|
-
* `Ruby 2.1+ <https://www.ruby-lang.org>`_
|
|
10
|
-
|
|
11
|
-
Squib works with both x86 and x86_64 versions of Ruby.
|
|
12
|
-
|
|
13
|
-
Typical Install
|
|
14
|
-
---------------
|
|
15
|
-
|
|
16
|
-
Regardless of your OS, installation is
|
|
17
|
-
|
|
18
|
-
.. code-block:: none
|
|
19
|
-
|
|
20
|
-
$ gem install squib
|
|
21
|
-
|
|
22
|
-
If you're using `Bundler <http://bundler.io>`_, add this line to your application's Gemfile::
|
|
23
|
-
|
|
24
|
-
gem 'squib'
|
|
25
|
-
|
|
26
|
-
And then execute::
|
|
27
|
-
|
|
28
|
-
$ bundle install
|
|
29
|
-
|
|
30
|
-
Squib has some native dependencies, such as `Cairo <https://github.com/rcairo/rcairo>`_, `Pango <http://ruby-gnome2.sourceforge.jp/hiki.cgi?Pango%3A%3ALayout>`_, and `Nokogiri <http://nokogiri.org/>`_, which will compile upon installation - this is normal.
|
|
31
|
-
|
|
32
|
-
Updating Squib
|
|
33
|
-
--------------
|
|
34
|
-
|
|
35
|
-
At this time we consider Squib to be still in initial development, so we are not supporting older versions. Please upgrade your Squib as often as possible.
|
|
36
|
-
|
|
37
|
-
To keep track of when new Squib releases come out, you can watch the `BoardGameGeek thread <https://boardgamegeek.com/thread/1293453>`_ or follow the RSS feed for Squib on its `RubyGems page <https://rubygems.org/gems/squib>`_.
|
|
38
|
-
|
|
39
|
-
In RubyGems, the command looks like this::
|
|
40
|
-
|
|
41
|
-
$ gem up squib
|
|
42
|
-
|
|
43
|
-
As a quirk of Ruby/RubyGems, sometimes older versions of gems get caught in caches. You can see which versions of Squib are installed and clean them up, use ``gem list`` and ``gem cleanup``::
|
|
44
|
-
|
|
45
|
-
$ gem list squib
|
|
46
|
-
|
|
47
|
-
*** LOCAL GEMS ***
|
|
48
|
-
|
|
49
|
-
squib (0.9.0, 0.8.0)
|
|
50
|
-
|
|
51
|
-
$ gem cleanup squib
|
|
52
|
-
Cleaning up installed gems...
|
|
53
|
-
Attempting to uninstall squib-0.8.0
|
|
54
|
-
Successfully uninstalled squib-0.8.0
|
|
55
|
-
Clean Up Complete
|
|
56
|
-
|
|
57
|
-
This will remove all prior versions of Squib.
|
|
58
|
-
|
|
59
|
-
As a sanity check, you can see what version of Squib you're using by referencing the ``Squib::VERSION`` constant::
|
|
60
|
-
|
|
61
|
-
require 'squib'
|
|
62
|
-
puts Squib::VERSION
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
OS-Specific Quirks
|
|
66
|
-
------------------
|
|
67
|
-
|
|
68
|
-
See the `wiki <http://github.com/andymeneely/squib/wiki>`_ for idiosyncracies about specific operating systems, dependency clashes, and other installation issues. If you've run into issues and solved them, please post your solutions for others!
|
data/docs/layouts.rst
DELETED
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
Layouts are Squib's Best Feature
|
|
2
|
-
================================
|
|
3
|
-
|
|
4
|
-
Working with tons of options to a method can be tiresome. Ideally everything in a game prototype should be data-driven, easily changed, and your Ruby code should readable without being littered with `magic numbers <http://stackoverflow.com/questions/47882/what-is-a-magic-number-and-why-is-it-bad>`_.
|
|
5
|
-
|
|
6
|
-
For this, most Squib methods have a ``layout`` option. Layouts are a way of setting default values for any parameter given to the method. They let you group things logically, manipulate options, and use built-in stylings.
|
|
7
|
-
|
|
8
|
-
Think of layouts and DSL calls like CSS and HTML: you can always specify style in your logic (e.g. directly in an HTML tag), but a cleaner approach is to group your styles together in a separate sheet and work on them separately.
|
|
9
|
-
|
|
10
|
-
To use a layout, set the ``layout:`` option on ``Deck.new`` to point to a YAML file. Any command that allows a ``layout`` option can be set with a Ruby symbol or string, and the command will then load the specified options. The individual command can also override these options.
|
|
11
|
-
|
|
12
|
-
For example, instead of this::
|
|
13
|
-
|
|
14
|
-
# deck.rb
|
|
15
|
-
Squib::Deck.new do
|
|
16
|
-
rect x: 75, y: 75, width: 675, height: 975
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
You can put your logic in the layout file and reference them::
|
|
20
|
-
|
|
21
|
-
# custom-layout.yml
|
|
22
|
-
bleed:
|
|
23
|
-
x: 75
|
|
24
|
-
y: 75
|
|
25
|
-
width: 975
|
|
26
|
-
height: 675
|
|
27
|
-
|
|
28
|
-
Then your script looks like this::
|
|
29
|
-
|
|
30
|
-
# deck.rb
|
|
31
|
-
Squib::Deck.new(layout: 'custom-layout.yml') do
|
|
32
|
-
rect layout: 'bleed'
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
The goal is to make your Ruby code separate the data decisions from logic. For the above example, you are separating the decision to draw rectangle around the "bleed" area, and then your YAML file is defining specifically what "bleed" actually means. (Who is going to remember that ``x: 75`` means "bleed area"??) This process of separating logic from data makes your code more readable, changeable, and maintainable.
|
|
36
|
-
|
|
37
|
-
.. warning::
|
|
38
|
-
|
|
39
|
-
YAML is very finnicky about not allowing tab characters. Use two spaces for indentation instead. If you get a ``Psych`` syntax error, this is likely the culprit. Indendation is also strongly enforced in Yaml too. See the `Yaml docs <http://www.yaml.org/YAML_for_ruby.html>`_ for more info.
|
|
40
|
-
|
|
41
|
-
Order of Precedence for Options
|
|
42
|
-
-------------------------------
|
|
43
|
-
|
|
44
|
-
Layouts will override Squib's system defaults, but are overriden by anything specified in the command itself. Thus, the order of precedence looks like this:
|
|
45
|
-
|
|
46
|
-
1. Use what the DSL method specified, e.g. ``rect x: 25``
|
|
47
|
-
2. If anything was not yet specified, use what was given in a layout (if a layout was specified in the command and the file was given to the Deck). e.g. ``rect layout: :bleed``
|
|
48
|
-
3. If still anything was not yet specified, use what was given in Squib's defaults as defined in the :doc:`dsl/index`.
|
|
49
|
-
|
|
50
|
-
For example, back to our example::
|
|
51
|
-
|
|
52
|
-
# custom-layout.yml
|
|
53
|
-
bleed:
|
|
54
|
-
x: 0.25in
|
|
55
|
-
y: 0.25in
|
|
56
|
-
width: 2.5in
|
|
57
|
-
height: 3.5in
|
|
58
|
-
|
|
59
|
-
(Note that this example makes use of :doc:`/units`)
|
|
60
|
-
|
|
61
|
-
Combined with this script:
|
|
62
|
-
|
|
63
|
-
.. code-block:: ruby
|
|
64
|
-
|
|
65
|
-
# deck.rb
|
|
66
|
-
Squib::Deck.new(layout: 'custom-layout.yml') do
|
|
67
|
-
rect layout: 'bleed', x: 50
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
The options that go into ``rect`` will be:
|
|
71
|
-
|
|
72
|
-
* ``x`` will be 50 because it's specified in the DSL method and overrides the layout
|
|
73
|
-
* ``y``, ``width``, and ``height`` were specified in the layout file, so their values are used
|
|
74
|
-
* The rect's ``stroke_color`` (and others options like it) was never specified anywhere, so the default for ``rect`` is used - as discussed in :doc:`parameters`.
|
|
75
|
-
|
|
76
|
-
.. note::
|
|
77
|
-
|
|
78
|
-
Defaults are not global for the name of the option - they are specific to the method itself. For example, the default ``fill_color`` for ``rect`` is ``'#0000'`` but for ``showcase`` it's ``:white``.
|
|
79
|
-
|
|
80
|
-
.. note::
|
|
81
|
-
|
|
82
|
-
Layouts work with *all* options (for DSL methods that support layouts), so you can use options like ``file`` or ``font`` or whatever is needed.
|
|
83
|
-
|
|
84
|
-
.. warning::
|
|
85
|
-
|
|
86
|
-
If you provide an option in the Yaml file that is not supported by the DSL method, the DSL method will simply ignore it. Same behavior as described in :doc:`parameters`.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
When Layouts Are Similar, Use ``extends``
|
|
90
|
-
-----------------------------------------
|
|
91
|
-
|
|
92
|
-
Using layouts are a great way of keeping your Ruby code clean and concise. But those layout Yaml files can get pretty long. If you have a bunch of icons along the top of a card, for example, you're specifying the same ``y`` option over and over again. This is annoyingly verbose, and what if you want to move all those icons downward at once?
|
|
93
|
-
|
|
94
|
-
Squib provides a way of reusing layouts with the special `extends`` key. When defining an ```extends`` key, we can merge in another key and modify its data coming in if we want to. This allows us to do things like place text next to an icon and be able to move them with each other. Like this::
|
|
95
|
-
|
|
96
|
-
# If we change attack, we move defend too!
|
|
97
|
-
attack:
|
|
98
|
-
x: 100
|
|
99
|
-
y: 100
|
|
100
|
-
defend:
|
|
101
|
-
extends: attack
|
|
102
|
-
x: 150
|
|
103
|
-
#defend now is {:x => 150, :y => 100}
|
|
104
|
-
|
|
105
|
-
Over time, using ``extends`` saves you a lot of space in your Yaml files while also giving more structure and readability to the file itself.
|
|
106
|
-
|
|
107
|
-
You can also **modify** data as they get passed through extends::
|
|
108
|
-
|
|
109
|
-
# If we change attack, we move defend too!
|
|
110
|
-
attack:
|
|
111
|
-
x: 100
|
|
112
|
-
defend:
|
|
113
|
-
extends: attack
|
|
114
|
-
x: += 50
|
|
115
|
-
#defend now is {:x => 150, :y => 100}
|
|
116
|
-
|
|
117
|
-
The following operators are supported within evaluating ``extends``
|
|
118
|
-
* ``+=`` will add the giuven number to the inherited number
|
|
119
|
-
* ``-=`` will subtract the given number from the inherited number
|
|
120
|
-
|
|
121
|
-
Both operators also support :doc:`/units`
|
|
122
|
-
|
|
123
|
-
From a design point of view, you can also extract out a base design and have your other layouts extend from them::
|
|
124
|
-
|
|
125
|
-
top_icons:
|
|
126
|
-
y: 100
|
|
127
|
-
font: Arial 36
|
|
128
|
-
attack:
|
|
129
|
-
extends: top_icon
|
|
130
|
-
x: 25
|
|
131
|
-
defend:
|
|
132
|
-
extends: top_icon
|
|
133
|
-
x: 50
|
|
134
|
-
health:
|
|
135
|
-
extends: top_icon
|
|
136
|
-
x: 75
|
|
137
|
-
# ...and so on
|
|
138
|
-
|
|
139
|
-
.. note::
|
|
140
|
-
|
|
141
|
-
Those fluent in Yaml may notice that ``extends`` key is similar to Yaml's `merge keys <http://www.yaml.org/YAML_for_ruby.html#merge_key>`_. Technically, you can use these together - but I just recommend sticking with ``extends`` since it does what merge keys do *and more*. If you do choose to use both ``extends`` and Yaml merge keys, the Yaml merge keys are processed first (upon Yaml parsing), then ``extends`` (after parsing).
|
|
142
|
-
|
|
143
|
-
Yes, ``extends`` is Multi-Generational
|
|
144
|
-
--------------------------------------
|
|
145
|
-
|
|
146
|
-
As you might expect, ``extends`` can be composed multiple times::
|
|
147
|
-
|
|
148
|
-
socrates:
|
|
149
|
-
x: 100
|
|
150
|
-
plato:
|
|
151
|
-
extends: socrates
|
|
152
|
-
x: += 10 # evaluates to 150
|
|
153
|
-
aristotle:
|
|
154
|
-
extends: plato
|
|
155
|
-
x: += 20 # evaluates to 150
|
|
156
|
-
|
|
157
|
-
Yes, ``extends`` has Multiple Inheritance
|
|
158
|
-
-----------------------------------------
|
|
159
|
-
|
|
160
|
-
If you want to extend multiple parents, it looks like this::
|
|
161
|
-
|
|
162
|
-
socrates:
|
|
163
|
-
x: 100
|
|
164
|
-
plato:
|
|
165
|
-
y: 200
|
|
166
|
-
aristotle:
|
|
167
|
-
extends:
|
|
168
|
-
- socrates
|
|
169
|
-
- plato
|
|
170
|
-
x: += 50 # evaluates to 150
|
|
171
|
-
|
|
172
|
-
If multiple keys override the same keys in a parent, the later ("younger") child in the ``extends`` list takes precedent. Like this::
|
|
173
|
-
|
|
174
|
-
socrates:
|
|
175
|
-
x: 100
|
|
176
|
-
plato:
|
|
177
|
-
x: 200
|
|
178
|
-
aristotle:
|
|
179
|
-
extends:
|
|
180
|
-
- plato # note the order here
|
|
181
|
-
- socrates
|
|
182
|
-
x: += 50 # evaluates to 150 from socrates
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
Multiple Layout Files get Merged
|
|
186
|
-
--------------------------------
|
|
187
|
-
|
|
188
|
-
Squib also supports the combination of multiple layout files. If you provide an ``Array`` of files then Squib will merge them sequentially. Colliding keys will be completely re-defined by the later file. The ``extends`` key is processed after *each file*, but can be used across files. Here's an example::
|
|
189
|
-
|
|
190
|
-
# load order: a.yml, b.yml
|
|
191
|
-
|
|
192
|
-
##############
|
|
193
|
-
# file a.yml #
|
|
194
|
-
##############
|
|
195
|
-
grandparent:
|
|
196
|
-
x: 100
|
|
197
|
-
parent_a:
|
|
198
|
-
extends: grandparent
|
|
199
|
-
x: += 10 # evaluates to 110
|
|
200
|
-
parent_b:
|
|
201
|
-
extends: grandparent
|
|
202
|
-
x: += 20 # evaluates to 120
|
|
203
|
-
|
|
204
|
-
##############
|
|
205
|
-
# file b.yml #
|
|
206
|
-
##############
|
|
207
|
-
child_a:
|
|
208
|
-
extends: parent_a # i.e. extends a layout in a separate file
|
|
209
|
-
x: += 3 # evaluates to 113 (i.e 110 + 3)
|
|
210
|
-
parent_b: # redefined
|
|
211
|
-
extends: grandparent
|
|
212
|
-
x: += 30 # evaluates to 130 (i.e. 100 + 30)
|
|
213
|
-
child_b:
|
|
214
|
-
extends: parent_b
|
|
215
|
-
x: += 3 # evaluates to 133 (i.e. 130 + 3)
|
|
216
|
-
|
|
217
|
-
This can be helpful for:
|
|
218
|
-
* Creating a base layout for structure, and one for full color for easier color/black-and-white switching
|
|
219
|
-
* Sharing base layouts with other designers
|
|
220
|
-
|
|
221
|
-
Squib Comes with Built-In Layouts
|
|
222
|
-
---------------------------------
|
|
223
|
-
|
|
224
|
-
Why mess with x-y coordinates when you're first prototyping your game? Just use a built-in layout to get your game to the table as quickly as possible.
|
|
225
|
-
|
|
226
|
-
If your layout file is not found in the current directory, Squib will search for its own set of layout files. The latest the development version of these can be found `on GitHub <https://github.com/andymeneely/squib/tree/master/lib/squib/layouts>`_.
|
|
227
|
-
|
|
228
|
-
Contributions in this area are particularly welcome!!
|
|
229
|
-
|
|
230
|
-
The following depictions of the layouts are generated with `this script <https://github.com/andymeneely/squib/tree/master/samples/layouts/builtin_layouts.rb>`_
|
|
231
|
-
|
|
232
|
-
fantasy.yml
|
|
233
|
-
~~~~~~~~~~~
|
|
234
|
-
|
|
235
|
-
.. raw:: html
|
|
236
|
-
|
|
237
|
-
<img src="layouts/expected_layouts_builtin_fantasy_00.png"
|
|
238
|
-
class="figure" width=350>
|
|
239
|
-
|
|
240
|
-
https://github.com/andymeneely/squib/tree/master/lib/squib/layouts/fantasy.yml
|
|
241
|
-
|
|
242
|
-
economy.yml
|
|
243
|
-
~~~~~~~~~~~
|
|
244
|
-
|
|
245
|
-
.. raw:: html
|
|
246
|
-
|
|
247
|
-
<img src="layouts/expected_layouts_builtin_economy_00.png"
|
|
248
|
-
class="figure" width=350>
|
|
249
|
-
|
|
250
|
-
https://github.com/andymeneely/squib/tree/master/lib/squib/layouts/economy.yml
|
|
251
|
-
|
|
252
|
-
tuck_box.yml
|
|
253
|
-
~~~~~~~~~~~~
|
|
254
|
-
|
|
255
|
-
Based on TheGameCrafter's template.
|
|
256
|
-
|
|
257
|
-
.. raw:: html
|
|
258
|
-
|
|
259
|
-
<img src="layouts/expected_layouts_builtin_tuck_box_00.png"
|
|
260
|
-
class="figure" width=450>
|
|
261
|
-
|
|
262
|
-
https://github.com/andymeneely/squib/tree/master/lib/squib/layouts/tuck_box.yml
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
hand.yml
|
|
266
|
-
~~~~~~~~
|
|
267
|
-
|
|
268
|
-
.. raw:: html
|
|
269
|
-
|
|
270
|
-
<img src="layouts/expected_layouts_builtin_hand_00.png"
|
|
271
|
-
class="figure" width=350>
|
|
272
|
-
|
|
273
|
-
https://github.com/andymeneely/squib/tree/master/lib/squib/layouts/hand.yml
|
|
274
|
-
|
|
275
|
-
playing_card.yml
|
|
276
|
-
~~~~~~~~~~~~~~~~
|
|
277
|
-
|
|
278
|
-
.. raw:: html
|
|
279
|
-
|
|
280
|
-
<img src="layouts/expected_layouts_builtin_playing_card_00.png"
|
|
281
|
-
class="figure" width=350>
|
|
282
|
-
|
|
283
|
-
https://github.com/andymeneely/squib/tree/master/lib/squib/layouts/playing_card.yml
|
|
284
|
-
|
|
285
|
-
See Layouts in Action
|
|
286
|
-
---------------------
|
|
287
|
-
|
|
288
|
-
`This sample <https://github.com/andymeneely/squib/tree/master/samples/>`_ demonstrates many different ways of using and combining layouts.
|
|
289
|
-
|
|
290
|
-
`This sample <https://github.com/andymeneely/squib/tree/master/samples/>`_ demonstrates built-in layouts based on popular games (e.g. ``fantasy.yml`` and ``economy.yml``)
|