2
0

index.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>using Processing.js with Amber Smalltalk</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <meta name="author" content="Stefan Krecher" />
  7. <link rel="stylesheet" type="text/css" href='css/style.css' />
  8. <link type="image/x-icon" rel="shortcut icon" href="/favicon.ico"/>
  9. <link href='http://fonts.googleapis.com/css?family=Istok+Web' rel='stylesheet' type='text/css'>
  10. <script type="text/javascript" src="../vendor/amber/support/requirejs/require.min.js"></script>
  11. <script type='text/javascript' src='../vendor/amber/support/amber.js'></script>
  12. <script type='text/javascript' src='showdown/showdown.js'></script>
  13. <script type="text/javascript" src="processing-1.4.1.js"></script>
  14. </head>
  15. <body>
  16. A Clock made with <a href="http://processingjs.org">Processing.js</a> and <a href="http://amber-lang.net/">Amber</a>
  17. <p>Examine the <button onClick="buttonClick()"> ProcessingClock class</button></p>
  18. <p><canvas id="canvas1" width="200" height="200"></canvas></p>
  19. <script id="script1" type="text/javascript">
  20. var buttonClick;
  21. // Simple way to attach js code to the canvas is by using a function
  22. function sketchProc(processing) {
  23. // Override draw function, by default it will be called 60 times per second
  24. processing.draw = function() {};
  25. }
  26. var canvas = document.getElementById("canvas1");
  27. // attaching the sketchProc function to the canvas
  28. var p = new Processing(canvas, sketchProc);
  29. require.config({
  30. paths: {
  31. 'amber_examples_processing': 'js',
  32. 'amber_examples_processing\_source': 'st'
  33. }
  34. });
  35. require(['amber/devel','amber_examples_processing/Processing-Examples'],function(smalltalk){
  36. smalltalk.defaultAmdNamespace = 'amber_examples_processing';
  37. smalltalk.initialize();
  38. buttonClick = function() {
  39. smalltalk.Browser._openOn_(smalltalk.ProcessingClock);
  40. };
  41. smalltalk.ProcessingClock._init();
  42. });
  43. </script>
  44. </body>
  45. </html>