File: 001-overlap.lua

package info (click to toggle)
lua-gtk 0.9%2B20100528-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,176 kB
  • ctags: 1,934
  • sloc: ansic: 9,571; sh: 373; makefile: 241
file content (33 lines) | stat: -rwxr-xr-x 599 bytes parent folder | download
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()