Module: Shoes::DSL

Includes:
Color::DSLHelpers, Animate, Art, Element, Interaction, Media, Style, Text
Included in:
App
Defined in:
shoes-core/lib/shoes/dsl.rb,
shoes-core/lib/shoes/dsl/art.rb,
shoes-core/lib/shoes/dsl/text.rb,
shoes-core/lib/shoes/color/dsl.rb,
shoes-core/lib/shoes/dsl/media.rb,
shoes-core/lib/shoes/dsl/style.rb,
shoes-core/lib/shoes/dsl/animate.rb,
shoes-core/lib/shoes/dsl/element.rb,
shoes-core/lib/shoes/dsl/interaction.rb

Overview

Methods for creating and manipulating elements from Shoes applications. The DSL methods define the primary interface into Shoes for people writing their own Shoes apps.

For ease of maintenance, the DSL methods are defined in their own submodules which are included into Shoes::DSL for surfacing in the Shoes runtime context.

Defined Under Namespace

Modules: Animate, Art, Element, Interaction, Media, Style, Text

Constant Summary

Constants included from Style

Style::OTHER_APP_STYLES, Style::PATTERN_APP_STYLES

Class Method Summary collapse

Methods included from Text

#banner, #bg, #caption, #code, #del, #em, #fg, #ins, #inscription, #link, #para, #span, #strong, #sub, #subtitle, #sup, #tagline, #title

Methods included from Media

#image, #sound, #video

Methods included from Interaction

#append, #clipboard, #clipboard=, #download, #gutter, #hover, #keypress, #keyrelease, #leave, #motion, #mouse, #resize, #scroll_top, #scroll_top=, #visit

Methods included from Style

#nofill, #nostroke, #style, #translate

Methods included from Element

#background, #border, #button, #check, #edit_box, #edit_line, #flow, #list_box, #progress, #radio, #stack

Methods included from Art

#arc, #arrow, #line, #mask, #oval, #rect, #shape, #star

Methods included from Animate

#animate, #every, #timer

Methods included from Color::DSLHelpers

#color, #gradient, #gray, #pattern, #rgb

Methods included from Common::ImageHandling

#absolute_file_path, #default_search_paths, #search_for

Class Method Details

.define_shoes_color(color_name, r, g, b) ⇒ Object


157
158
159
160
161
162
163
164
# File 'shoes-core/lib/shoes/color/dsl.rb', line 157

def self.define_shoes_color(color_name, r, g, b)
  Shoes::COLORS[color_name] = Shoes::Color.new(r, g, b)
  define_method(color_name) do |alpha = Shoes::Color::OPAQUE|
    color = Shoes::COLORS.fetch(color_name)
    return color if alpha == Shoes::Color::OPAQUE
    Shoes::Color.new(color.red, color.green, color.blue, alpha)
  end
end