Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- id: "titlescreen_controller",
- is_strict: true,
- use_absolute_screen_coordinates: true,
- properties: {
- screen_width: "int :: SCREEN_WIDTH",
- screen_height: "int :: SCREEN_HEIGHT",
- _play_button: { type: "obj button_controller" },
- _editor_button: { type: "obj button_controller" },
- render: "def() ->commands
- set(animation, lib.util.render_frame(c, ww, hh,
- [
- c.rectangle(0,0,ww,hh),
- c.set_source_rgba(0.2,0.2,0.2,1.0),
- c.fill(),
- ]
- )) where ww = screen_width
- where hh = screen_height
- where c = canvas()",
- init_controls: "def() ->commands
- spawn('button_controller', {
- text: 'Play',
- zorder: zorder+1,
- mid_x: int(screen_width/2),
- mid_y: int(screen_height/2) + lib.wesnoth.py(80),
- on_click: def() ->commands fadeout_and_exit_to('game_controller'),
- use_absolute_screen_coordinates: true,
- }, [
- set(me._play_button, child)
- ]);
- spawn('button_controller', {
- text: 'Edit Map',
- zorder: zorder+1,
- mid_x: int(screen_width/2),
- mid_y: int(screen_height/2) + lib.wesnoth.py(140),
- on_click: def() ->commands fadeout_and_exit_to('editor_controller'),
- use_absolute_screen_coordinates: true,
- }, [
- set(me._editor_button, child)
- ]);
- spawn('label', {
- zorder: zorder+10,
- mid_x: int(screen_width/2),
- mid_y: int(screen_height/3) + lib.wesnoth.py(80),
- _text: ['Wesnoth: Genesis Demo'],
- use_absolute_screen_coordinates: true,
- _font_size: 80,
- });
- spawn('image_widget', {
- mid_x: int(screen_width/2),
- mid_y: int(screen_height/5),
- zorder: zorder+5,
- image: 'logo_256.png',
- image_area: [0,0,255,255],
- draw_width: 200,
- draw_height: 200,
- use_absolute_screen_coordinates: true,
- })",
- fadeout_and_exit_to: "def(string to_spawn) ->commands
- map(level.chars,
- animate(value, {
- alpha: 0,
- }, {
- duration: 10,
- on_complete: remove_object(value); add_object(object_playable(to_spawn, 0, 0, 1, {})),
- })
- )"
- },
- events: {
- create: "[
- render(); init_controls();
- // The x,y position and level dimensions need to be set manually here
- set(x, 0);
- set(y, 0);
- set(level.dimensions, [0,0,screen_width,screen_height])
- ]",
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment