Sha256: 3860ace38c32bf8e00fbb9e7518d108009253c411ad74ddfa1c5b6f6f21d863e

Contents?: true

Size: 815 Bytes

Versions: 2

Compression:

Stored size: 815 Bytes

Contents

require 'squib'

Squib::Deck.new(cards: 8, layout: 'playing-card.yml') do
  background color: :cyan
  rect x: 37, y: 37, width: 750, height: 1050, fill_color: :black, radius: 25
  rect x: 75, y: 75, width: 675, height: 975, fill_color: :white, radius: 20
  text str: ('A'..'Z').to_a, layout: :bonus_ul, font: 'Sans bold 100'

  # Defaults are sensible
  hand #saves to _output/hand.png

  # Here's a prettier version:
  #  - Each card is trimmed with rounded corners
  #  - Zero radius means cards rotate about the bottom of the card
  #  - Cards are shown in reverse order
  hand trim: 37.5, trim_radius: 25,
       radius: 0,
       range: 7.downto(0),
       file: 'hand_pretty.png'

  # Tip: you can have the top card be on the left by reversing the range
  #  angle_range: (Math::PI / 4)..(Math::PI / -4)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
squib-0.8.0 samples/hand.rb
squib-0.7.0 samples/hand.rb