1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#! /usr/bin/env lua
-- vim:sw=4:sts=4
require 'clutter'
clutter.init(0, nil)
stage = clutter.stage_get_default()
stage:set_size(300, 300)
stage:set_title"Clutter Demo"
-- define a red, somewhat transparent color
red = clutter.new "Color"
red:from_pixel(0xff000088)
-- add a red rectangle
actor = clutter.rectangle_new_with_color(red)
actor:set_size(100, 30)
actor:set_position(150, 130)
stage:add_actor(actor)
-- and another rectangle
actor = clutter.rectangle_new_with_color(red)
actor:set_size(50, 50)
actor:set_position(130, 100)
stage:add_actor(actor)
stage:show_all()
clutter.main()
|