start.html 957 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Start</title>
  5. <style>
  6. #kity-paper {
  7. width: 100%;
  8. height: 800px;
  9. }
  10. </style>
  11. <!-- dev 版本 示例所需脚本文件 start -->
  12. <script src="../dev-lib/sea.js"></script>
  13. <script>
  14. seajs.config({
  15. base: '../src'
  16. });
  17. define('start', function(require) {
  18. var kity = require('kity');
  19. var paper = new kity.Paper('kity-paper');
  20. var rect = paper.put(new kity.Rect());
  21. var text = paper.put(new kity.Text());
  22. text.setContent('hello kity!');
  23. text.fill('white');
  24. text.setX(100);
  25. text.setY(200);
  26. rect.setBox(text.getBoundaryBox().expand(15));
  27. rect.setRadius(5);
  28. rect.fill('blue');
  29. });
  30. seajs.use('start');
  31. </script>
  32. </head>
  33. <body>
  34. <div id="kity-paper"></div>
  35. </body>
  36. </html>