Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

52 lines (37 sloc) 1.867 kb

text message slide-in

_why gave us his one thousandth commit of Shoes on 24th Sep. Here is a new sample - simple-slide.rb: showing slide-in slide-out animation.

simple-slide.png

simple-slide.png

Next sample code, sample37.rb, which works almost similar behavior of the text message slide-in by using mask and animate methods.

# sample37.rb

episode1 =<<-EOS
Episode I 
THE PHANTOM MENACE Turmoil has engulfed the Galactic Republic. The taxation of trade routes to outlying star systems is in dispute. \
Hoping to resolve the matter with a blockade of deadly battleships, the greedy Trade Federation has stopped all shipping to the small planet of Naboo. \
While the Congress of the Republic endlessly debates this alarming chain of events, the Supreme Chanccellor has secretly dispatched two Jedi Knights, the guardians of peace and justice in the galaxy, to settle the conflict... \
    [Quote]  http://www.starwars.com/episode-iii/bts/production/f20050126/indexp2.html 
EOS

Shoes.app :width => 400, :height => 380, :title => 'Episode I' do
  rect 0, 0, 400, 380, :fill => sandybrown
  rect 10, 10, 380, 360, :fill => lavender, :curve => 10
  stack do
    nostroke
    rect 10, 10, 380, 360, :fill => lightblue
    oval 50, 40, 100, :fill => green
    star 250, 245, 5, 100, 40, :fill => deeppink, :angle => 90
    mask do
      @t = para strong(episode1), :left => 15, :top => 340, :width => 380
    end

    @a = animate(36) do |i|
      @t.left, @t.top = 15, 340 - i
      @a.stop if i > 330
    end
  end
end

This is the screenshot.

sample37.png

sample37.png

Policeman

The sample37.rb worked well with Shoes-0.r1263.

Jump to Line
Something went wrong with that request. Please try again.