Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. TestScene = Scene.extend({
  2.         contextMenu: null,
  3.         init: function( title ) {
  4.             this.parent();
  5.        
  6.             this.clearColor = '#422';
  7.            
  8.             var choices = [];
  9.             choices = [
  10.                 new MenuItem("Start",function(){console.log("start selected");}),
  11.                 new MenuItem("Options",function(){console.log("options selected");}),
  12.                 new MenuItem("Help",function(){console.log("help selected");}),
  13.                 new MenuItem("Credits",function(){console.log("credits selected");})
  14.             ];
  15.  
  16.             var menufont = new ig.Font( 'media/04b03.font.png' );
  17.             this.contextMenu = new Menu(
  18.                 menufont,
  19.                 choices
  20.             );
  21.         },
  22.    
  23.         update: function() {
  24.             // Update all entities and backgroundMaps
  25.             this.parent();
  26.         },
  27.    
  28.         draw: function() {     
  29.             // Draw all entities and backgroundMaps
  30.             this.parent();
  31.            
  32.             this.contextMenu.draw(100, 100);
  33.         }
  34.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement