Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
72
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.             ig.input.bind( ig.KEY.MOUSE1, 'mouseClick' )
  9.  
  10.             var choices = [];
  11.             choices = [
  12.                 new MenuItem("Start",function(){console.log("start selected");}),
  13.                 new MenuItem("Options",function(){console.log("options selected");}),
  14.                 new MenuItem("Help",function(){console.log("help selected");}),
  15.                 new MenuItem("Credits",function(){console.log("credits selected");})
  16.             ];
  17.  
  18.             var menufont = new ig.Font( 'media/04b03.font.png' );
  19.             this.contextMenu = new Menu(
  20.                 menufont,
  21.                 choices
  22.             );
  23.         },
  24.    
  25.         update: function() {
  26.             // Update all entities and backgroundMaps
  27.             this.parent();
  28.         },
  29.    
  30.         draw: function() {     
  31.             // Draw all entities and backgroundMaps
  32.             this.parent();
  33.            
  34.             this.contextMenu.draw(100, 100);
  35.         }
  36.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement