new 4475edb243ed4627f4c5f2c470ca40b3def034d4
[tagua/yd.git] / tests / luaimage / test.lua
blob8d9e0d0b26a8f62a48c0546e792bc17076d575dd
3 print("Hello!!")
5 a = Rect("1",3,4,5)
6 b = Point(4,5)
8 print(a)
9 a.x = -3
10 a:translate(b)
12 print(a.x)
13 print("right = "..a.right)
15 print(a)
17 puppamelo = Image(200,800)
18 puppamelo:clear()
19 if(true) then
20 puppamelo:fill_rect(Rect(0,0,200,800), Color(255,0,0,128))
21 puppamelo:fill_rect(Rect(50,50,100,700), "#ffff00")
22 puppamelo:fill_rect(Rect(75,100,50,600), "#0000ff")
24 puppamelo:draw_image(Rect(0,0,200,200), "data/white_rook.png")
25 puppamelo:draw_svg(Rect(0,200,200,200), "data/wk.svg")
27 if(true) then
28 puppamelo:fill_rect(Rect(0,400,200,200), "yellow")
29 ziocane = Brush(Image("data/white_rook.png"))
30 ziocane:scale(0.2,0.2)
31 ziocane:rotate(45)
32 ziocane = Color(255,0,0,128)
33 puppamelo:draw_glyph(Rect(0,200,128,4*128), "data/Enquil.ttf", "0x006B",
34 Color(0,128,0,128), ziocane, 0.0, true);
35 end
36 else
37 puppamelo:fill_rect(Rect(50,50,200,800), Image("data/white_rook.png"))
38 end
39 teto = Image(200,200)
40 teto:clear()
41 teto:draw_glyph(Rect(0,0,200,200), "data/Enquil.ttf", "0x0071",
42 "#ffff00", "#ffffff", 5.0, false)
43 shad = teto:create_shadow(25, "#000000")
45 puppamelo:draw_image(Rect(0,600,200,200), shad)
46 puppamelo:draw_image(Rect(0,600,200,200), teto)
48 theme.puppamelo = function(size)
49 print("porca zoccola! "..size)
50 return puppamelo;
51 end
54 --puppamelo = shad
55 -- a:translate(a)