Vultraz

Untitled

Jun 20th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. {
  2. id: "titlescreen_controller",
  3. is_strict: true,
  4. use_absolute_screen_coordinates: true,
  5.  
  6. properties: {
  7. screen_width: "int :: SCREEN_WIDTH",
  8. screen_height: "int :: SCREEN_HEIGHT",
  9.  
  10. _play_button: { type: "obj button_controller" },
  11.  
  12. render: "def() ->commands
  13. set(animation, lib.util.render_frame(c, ww, hh,
  14. [
  15. c.rectangle(0,0,ww,hh),
  16. c.set_source_rgba(0.2,0.2,0.2,1.0),
  17. c.fill(),
  18. ]
  19. )) where ww = screen_width
  20. where hh = screen_height
  21. where c = canvas()",
  22.  
  23. init_controls: "def() ->commands
  24. spawn('button_controller', {
  25. text: 'Play',
  26. zorder: zorder+1,
  27. mid_x: int(screen_width/2),
  28. mid_y: int(screen_height/2),
  29. on_click: def() ->commands [
  30. remove_object(_play_button),
  31. remove_object(me)],
  32. use_absolute_screen_coordinates: true,
  33. }, [
  34. set(me._play_button, child)
  35. ])"
  36. },
  37.  
  38. events: {
  39. being_removed: "spawn('game_controller', {})",
  40.  
  41. create: "render(); init_controls()",
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment