loading.rml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <rml>
  2. <head >
  3. <title>Main Menu</title>
  4. <link type="text/template" href="window.rml" />
  5. <style>
  6. body
  7. {
  8. width: 400px;
  9. height: 225px;
  10. margin: auto;
  11. background-color: #44f;
  12. }
  13. div#title_bar_content
  14. {
  15. font-size: 48;
  16. //text-align: left;
  17. position: absolute;
  18. top: 40%;
  19. //vertical-align: center;
  20. }
  21. </style>
  22. <script>
  23. import _rocketcore as rocket
  24. # This handler overrides the 'onkeydown' handler from the template
  25. def OnKeyDown(event, document):
  26. keyId = event.parameters['key_identifier']
  27. if keyId in [ rocket.key_identifier.RETURN,
  28. rocket.key_identifier.ESCAPE,
  29. rocket.key_identifier.SPACE ]:
  30. FireClosing(document)
  31. # custom event
  32. def FireClosing(document):
  33. document.DispatchEvent("aboutToClose", { }, False)
  34. </script>
  35. </head>
  36. <body id='window' template="window" onclick='FireClosing(document)'>
  37. <div id="title_bar_content" >
  38. <label id="loadingLabel">Loading...</label>
  39. </div>
  40. </body>
  41. </rml>