Class: MtgCardMaker::TypeLineLayer
- Includes:
- LayerInitializer
- Defined in:
- lib/mtg_card_maker/layers/type_line_layer.rb
Overview
TypeLineLayer is a specialized layer for the type of the card This is the small area in the center of the card below the artwork
Instance Attribute Summary collapse
- #color_scheme ⇒ Object readonly
- #type_line ⇒ Object readonly
Attributes inherited from BaseLayer
#color, #height, #template, #width, #x, #y
Instance Method Summary collapse
-
#initialize(dimensions:, type_line:, color: nil, color_scheme: DEFAULT_COLOR_SCHEME) ⇒ TypeLineLayer
constructor
A new instance of TypeLineLayer.
- #render ⇒ Object
Methods inherited from BaseLayer
Constructor Details
#initialize(dimensions:, type_line:, color: nil, color_scheme: DEFAULT_COLOR_SCHEME) ⇒ TypeLineLayer
Returns a new instance of TypeLineLayer.
10 11 12 13 14 15 |
# File 'lib/mtg_card_maker/layers/type_line_layer.rb', line 10 def initialize(dimensions:, type_line:, color: nil, color_scheme: DEFAULT_COLOR_SCHEME) frame_color = initialize_layer_color(color, color_scheme, :background_color) super(dimensions: dimensions, color: frame_color) @type_line = type_line @color_scheme = color_scheme end |
Instance Attribute Details
#color_scheme ⇒ Object (readonly)
8 9 10 |
# File 'lib/mtg_card_maker/layers/type_line_layer.rb', line 8 def color_scheme @color_scheme end |
#type_line ⇒ Object (readonly)
8 9 10 |
# File 'lib/mtg_card_maker/layers/type_line_layer.rb', line 8 def type_line @type_line end |
Instance Method Details
#render ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/mtg_card_maker/layers/type_line_layer.rb', line 17 def render # Ensure gradients are defined for this color scheme SvgGradientService.define_all_gradients(svg, color_scheme) svg.g do render_type_background render_type_line render_type_icon end end |