More documentation for prior methods

This commit is contained in:
Andy Meneely
2014-07-22 15:34:03 -04:00
parent 0c6b6e4d72
commit 77b7437df0
4 changed files with 29 additions and 9 deletions
+6 -2
View File
@@ -1,7 +1,11 @@
module Squib
class Deck
def background(range: :all, color: :black)
# Fills the background with the given color
#
# @param range: the range of cards over which this will be rendered. See {file:API.md#label-Specifying+Ranges Specifying Ranges}
# @param color: the color the font will render to. See {file:API.md#label-Specifying+Colors Specifying Colors}
# @api public
def background(range: :all, color: :white)
range = rangeify(range)
color = colorify(color)
range.each { |i| @cards[i].background(color) }
+2
View File
@@ -10,6 +10,7 @@ module Squib
# @param x: the x-coordinate to place
# @param y: the y-coordinate to place
# @param alpha: the alpha-transparency percentage used to blend this image
# @api public
def png(range: :all, file: nil, x: 0, y: 0, alpha: 1.0)
range = rangeify(range)
file = fileify(file)
@@ -25,6 +26,7 @@ module Squib
# @param y: the y-coordinate to place
# @param width: the pixel width that the image should scale to. SVG scaling is done with vectors, so the scaling should be smooth. When set to `:native`, uses the DPI and units of the loaded SVG document.
# @param height: the pixel width that the image should scale to. SVG scaling is done with vectors, so the scaling should be smooth. When set to `:native`, uses the DPI and units of the loaded SVG document.
# @api public
def svg(range: :all, file: nil, x: 0, y: 0, width: :native, height: :native)
range = rangeify(range)
file = fileify(file)
+13
View File
@@ -1,6 +1,19 @@
module Squib
class Deck
# Draw a rounded rectangle
#
# @param x: the x-coordinate to place
# @param y: the y-coordinate to place
# @param width: the width of the rectangle.
# @param height: the height of the rectangle.
# @param x_radius: the radius of the rounded corner horiztonally. Zero is a non-rounded corner.
# @param y_radius: the radius of the rounded corner vertically. Zero is a non-rounded corner.
# @param radius: when set, overrides both x_radius and y_radius
# @param fill_color: the color with which to fill the rectangle
# @param stroke_color: the color with which to stroke the outside of the rectangle
# @param stroke_width: the width of the outside stroke
# @api public
def rect(range: :all, x: 0, y: 0, width: 825, height: 1125, \
radius: nil, x_radius: 0, y_radius: 0, \
fill_color: '#0000', stroke_color: :black, stroke_width: 2.0)