1 -- compile time definitions
18 edj
[i
][j
] = ego
:edje
{
19 name
= 'icon_' .. i
.. '_' .. j
,
21 pos
= {(i
-1)/n
, (j
-1)/n
},
26 edj
[i
][j
].rect
= ego
:rectangle
{
27 name
= 'rect_' .. i
.. '_' .. j
,
28 color
= {i
*255/n
, j
*255/n
, 0, 255}
31 edj
[i
][j
].container
.swallow
= edj
[i
][j
].rect
38 file
= images
['frywintux.jpeg'],
39 color
= {255, 255, 255, 128},
40 moveto
= function (self
, x
, y
, v
)
41 self
.animator
= coroutine
.wrap (function (anim
)
42 geo
= anim
.ptr
.geometry
48 for X
= geo
[1], x
, e
do
49 anim
.ptr
:move (X
, geo
[2])
50 coroutine
.yield (true)
58 self
.anim
= ego
:animator (self
.animator
)
61 callback_resize
= function (self
) self
:fit () end,
68 overlay
= ego
:rectangle
{
73 callback_key_down
= function (self
, key
)
81 callback_mouse_down
= function (self
, button
, x
, y
, X
, Y
)
91 self.mv = ego:smart (move)
93 color = {255, 0, 0, 128},
103 fill
= {0, 0, HEIGHT
, WIDTH
},
104 repeat_events
= true,
111 animator
= coroutine
.wrap( function (self
)
115 coroutine
.yield (true)
123 for _
,v
in ipairs (gra
.colors
) do
124 gra
:color_stop_add (v
)
126 --gra.anim = ego:animator (gra.animator)
130 repeat_events
= true,
133 math
.random (HEIGHT
),
143 color
= {255,255,0,32},
152 for _
,v
in ipairs (poly
.points
) do
153 poly
:point_add (v
[1], v
[2])
158 repeat_events
= true,
160 font_source
= 'test.ego',
161 font
= {'default', 20},
162 text
= 'hello world',
163 color
= {255, 255, 255, 255},
164 outline_color
= {0, 0, 0, 255},
165 glow_color
= {0, 0, 255, 255},
166 glow2_color
= {0, 255, 0, 255},
167 shadow_color
= {255, 0, 0, 128} ,
172 sty
= ego
:textblock_style ()
174 DEFAULT='font=notepad.ttf font_size=20 align=center color=#000 style=outline_shadow outline_color=#000 shadow_color=#fff wrap=word'
183 repeat_events
= true,
185 text_markup
= '<r>hello</r> world, <g>whats</g> up? <b>are</b> you <y>alright</y>?',
195 clicked
= coroutine
.wrap (function (self
)
208 content_min_limit
= {true, false},
216 label
= 'I am a label',
223 states_labels
= {'off', 'on'},
225 changed
= function (self
)
233 label
= 'test frame',
249 color
= {64*i
, 64*j
, 0, 255},
253 tbl
:pack (r
, i
, j
, 1, 1)
266 ['changed'] = function (self
) print 'changed' end,
267 ['selection,start'] = function (self
) print 'selection,start' end,
268 ['selection,changed'] = function (self
) print 'selection,changed' end,
269 ['selection,cleard'] = function (self
) print 'selection,cleared' end,
270 ['selection,paste'] = function (self
) print 'selection,paste' end,
271 ['selection,copy'] = function (self
) print 'selection,copy' end,
272 ['selection,cut'] = function (self
) print 'selection,cut' end,
273 ['cursor,changed'] = function (self
) print 'cursor,changed' end,
274 ['anchor,clicked'] = function (self
) print 'anchor,clicked' end,
275 ['activated'] = function (self
) print 'activated' end,
279 trans
= ego
:transform
{
289 gra2
= ego
:gradient2_linear
{
291 fill_transform
= trans
,
292 fill
= {0, 0, 50, 50},
298 {255, 0, 0, 255, 0.0},
299 {0, 255, 0, 255, 0.2},
300 {0, 0, 255, 255, 0.7},
301 {0, 255, 255, 255, 1.0}
304 for _
, v
in ipairs (gra2
.transient
) do
305 gra2
:color_np_stop_insert (v
)
310 label
= 'I am a bubble',
311 info
= 'I really am a bubble',
312 icon
= ego
:rectangle
{
313 color
= {255, 0, 0, 255},