1. Computing

Displaying Images With Shoes

By

3 of 4

Using Images as Backgrounds
Displaying Images With Shoes

The filename of an image can be used as the background for any stack or flow. The image will be tiled to take up all the space in the stack or flow. Note that when using the background method, always use it first thing in the stack or flow. If the background method is called after other elements, the background will paint over those other elements.

Shoes.app :width => 350, :height => 310 do
  background 'background.jpg'
  para "This is a paragraph that will ",
    "be displayed over the background image.",
    "A different color was selected to make ",
    "the text stand out better against the ",
    "background", :stroke => yellow
end
  1. About.com
  2. Computing
  3. Ruby
  4. Graphical User Interfaces
  5. Shoes
  6. Using Images as Backgrounds

©2014 About.com. All rights reserved.