seed r540 - trunk/examples/lightsoff



Author: hortont
Date: Tue Dec 23 07:18:17 2008
New Revision: 540
URL: http://svn.gnome.org/viewvc/seed?rev=540&view=rev

Log:
Small LO fixes.


Modified:
   trunk/examples/lightsoff/arrow.js
   trunk/examples/lightsoff/main.js

Modified: trunk/examples/lightsoff/arrow.js
==============================================================================
--- trunk/examples/lightsoff/arrow.js	(original)
+++ trunk/examples/lightsoff/arrow.js	Tue Dec 23 07:18:17 2008
@@ -29,27 +29,30 @@
     name: "Arrow",
     class_init: function(klass, prototype)
     {
-    	prototype.set_arrow_flipped = function ()
+    	prototype.set_arrow_direction = function (dir)
     	{
-    		this.flipped = 1;
+    		this.flipped = dir;
     		this.remove_all();
-    		
-    		var bkg = Clutter.Texture.new_from_file("./arrow-r.svg");
-			bkg.filter_quality = Clutter.TextureQuality.High;
-			
+
+			if(dir)
+			{
+    		    var bkg = Clutter.Texture.new_from_file("./arrow-r.svg");
+			    bkg.filter_quality = Clutter.TextureQuality.High;
+			}
+			else
+			{
+				var bkg = Clutter.Texture.new_from_file("./arrow-l.svg");
+				bkg.filter_quality = Clutter.TextureQuality.High;
+			}
 			this.add_actor(bkg);
     	}
     },
     instance_init: function(klass)
     {
     	this.flipped = 0;
-    	var bkg = Clutter.Texture.new_from_file("./arrow-l.svg");
-		bkg.filter_quality = Clutter.TextureQuality.High;
-		
+    	
 		this.reactive = true;
 		this.signal.button_press_event.connect(pushed_arrow);
-		
-		this.add_actor(bkg);
     }};
 
 Arrow = new GType(ArrowType);

Modified: trunk/examples/lightsoff/main.js
==============================================================================
--- trunk/examples/lightsoff/main.js	(original)
+++ trunk/examples/lightsoff/main.js	Tue Dec 23 07:18:17 2008
@@ -23,11 +23,12 @@
 Seed.include("board.js");
 Seed.include("arrow.js");
 
-var gconf_client = GConf.Client.get_default();
-var initial_score = 1;
+var gconf_client;
+var initial_score;
 
 try
 {
+	gconf_client = GConf.Client.get_default();
 	initial_score = gconf_client.get_int("/apps/lightsoff/score")
 }
 catch(e)
@@ -55,9 +56,10 @@
 rect.set_position(0, board_size);
 rect.set_size(stage.width, stage.height);
 
+back.set_arrow_direction(0);
 back.set_position(score.x - back.width - 2*margin, score.y + (.5 * score.height) - (.5 * back.height));
 
-forward.set_arrow_flipped();
+forward.set_arrow_direction(1);
 forward.set_position(score.x + score.width + 2*margin, score.y + (.5 * score.height) - (.5 * forward.height));
 
 stage.add_actor(board);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]