gnome-games r8630 - trunk/lightsoff



Author: hortont
Date: Sun Feb  1 05:55:48 2009
New Revision: 8630
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8630&view=rev

Log:
Robb didn't like the old arrows (they looked too much like the tiles themselves), so I replaced them with arrows more in the style of the score area. Also, we only use one SVG for the arrows now, since it makes no sense to have two...



Added:
   trunk/lightsoff/arrow.svg   (contents, props changed)
      - copied, changed from r8627, /trunk/lightsoff/arrow-l.svg
Removed:
   trunk/lightsoff/arrow-l.svg
   trunk/lightsoff/arrow-r.svg
Modified:
   trunk/lightsoff/Makefile.am
   trunk/lightsoff/arrow.js.in
   trunk/lightsoff/main.js.in

Modified: trunk/lightsoff/Makefile.am
==============================================================================
--- trunk/lightsoff/Makefile.am	(original)
+++ trunk/lightsoff/Makefile.am	Sun Feb  1 05:55:48 2009
@@ -15,8 +15,7 @@
 	lcd-back.svg \
 	lcd-front.svg \
 	lcd-off.svg \
-	arrow-l.svg \
-	arrow-r.svg
+	arrow.svg
 
 lojsdir = $(pkgdatadir)/lightsoff
 lojs_DATA = \
@@ -56,7 +55,6 @@
 	lcd-front.svg \
 	score.js.in \
 	lcd-off.svg \
-	arrow-l.svg \
-	arrow-r.svg \
+	arrow.svg \
 	lightsoff.in \
 	arrow.js.in

Modified: trunk/lightsoff/arrow.js.in
==============================================================================
--- trunk/lightsoff/arrow.js.in	(original)
+++ trunk/lightsoff/arrow.js.in	Sun Feb  1 05:55:48 2009
@@ -4,7 +4,7 @@
 	init: function(klass)
 	{
 		// Private
-		var direction = 0;
+		var direction = -1;
 		
 		var toggle_arrow = function (actor, event)
 		{
@@ -18,19 +18,23 @@
 		}
 		
 		// Public
-		this.set_arrow_direction = function (dir)
+		this.flip = function ()
 		{
-			direction = dir ? 1 : -1;
-			
-			var bkg = new Clutter.Texture.from_file("@prefix@"+"/share/pixmaps/lightsoff/arrow-" + 
-													(dir ? "r" : "l") + ".svg");
-			
-			bkg.filter_quality = Clutter.TextureQuality.HIGH;
-			this.add_actor(bkg);
-			bkg.show();
+			bkg.rotation_angle_z = 180;
+			direction = 1;
 		}
 
 		// Implementation
+		var bkg = new Clutter.Texture.from_file("@prefix@"+"/share/pixmaps/lightsoff/arrow.svg");
+			
+		bkg.filter_quality = Clutter.TextureQuality.HIGH;
+		this.add_actor(bkg);
+		bkg.show();
+		
+		bkg.set_anchor_point_from_gravity(Clutter.Gravity.CENTER);
+		bkg.x += bkg.width/2;
+		bkg.y += bkg.height/2;
+			
 		this.reactive = true;
 		this.signal.button_press_event.connect(toggle_arrow);
 	}

Copied: trunk/lightsoff/arrow.svg (from r8627, /trunk/lightsoff/arrow-l.svg)
==============================================================================
--- /trunk/lightsoff/arrow-l.svg	(original)
+++ trunk/lightsoff/arrow.svg	Sun Feb  1 05:55:48 2009
@@ -6,7 +6,6 @@
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
    xmlns:svg="http://www.w3.org/2000/svg";
    xmlns="http://www.w3.org/2000/svg";
-   xmlns:xlink="http://www.w3.org/1999/xlink";
    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
    width="49.999996"
@@ -66,61 +65,27 @@
        inkscape:vp_z="744.09448 : 526.18109 : 1"
        inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
        id="perspective10" />
-    <filter
-       inkscape:collect="always"
-       id="filter3478">
-      <feGaussianBlur
-         inkscape:collect="always"
-         stdDeviation="4.3633868"
-         id="feGaussianBlur3480" />
-    </filter>
-    <filter
-       inkscape:collect="always"
-       id="filter3522">
-      <feGaussianBlur
-         inkscape:collect="always"
-         stdDeviation="7.7237026"
-         id="feGaussianBlur3524" />
-    </filter>
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient3444"
-       id="linearGradient2440"
-       gradientUnits="userSpaceOnUse"
-       x1="523.37036"
-       y1="199.07346"
-       x2="523.37036"
-       y2="491.56064" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient3486"
-       id="linearGradient2442"
-       gradientUnits="userSpaceOnUse"
-       x1="523.37036"
-       y1="199.07346"
-       x2="523.37036"
-       y2="491.56064" />
   </defs>
   <sodipodi:namedview
      id="base"
-     pagecolor="#ffffff"
+     pagecolor="#000000"
      bordercolor="#666666"
      borderopacity="1.0"
      gridtolerance="10000"
      guidetolerance="10"
      objecttolerance="10"
-     inkscape:pageopacity="0.0"
+     inkscape:pageopacity="0"
      inkscape:pageshadow="2"
-     inkscape:zoom="11.700001"
-     inkscape:cx="9.615384"
-     inkscape:cy="25.041579"
+     inkscape:zoom="11.760001"
+     inkscape:cx="24.999998"
+     inkscape:cy="24.999998"
      inkscape:document-units="px"
      inkscape:current-layer="layer1"
      showgrid="false"
-     inkscape:window-width="1440"
+     inkscape:window-width="1432"
      inkscape:window-height="817"
      inkscape:window-x="0"
-     inkscape:window-y="33" />
+     inkscape:window-y="0" />
   <metadata
      id="metadata7">
     <rdf:RDF>
@@ -137,38 +102,9 @@
      inkscape:groupmode="layer"
      id="layer1"
      transform="translate(-353.37656,-318.61163)">
-    <rect
-       style="fill:#1ea3f9;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.50078309;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       id="rect2650"
-       width="49.499214"
-       height="49.499214"
-       x="353.62695"
-       y="318.86203"
-       rx="6.7573571"
-       ry="6.7573571" />
     <path
-       style="opacity:0.58536545;fill:#000000;fill-opacity:1;stroke:#ffffff;stroke-width:0.30000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
-       d="M 374.7991,332.20565 L 374.7991,338.1744 L 397.64285,338.1744 L 397.64285,348.3619 L 374.7991,348.3619 L 374.7991,354.33065 L 361.33035,343.26815 L 374.7991,332.20565 z"
+       style="opacity:0.5;fill:#f5f5f5;fill-opacity:0.5098038;stroke:#f5f5f5;stroke-width:2.18480301;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.90196078"
+       d="M 372.51146,327.46981 L 372.51146,336.1791 L 401.09405,336.1791 L 401.09405,351.04416 L 372.51146,351.04416 L 372.51146,359.75345 L 355.65907,343.61163 L 372.51146,327.46981 z"
        id="rect3273" />
-    <rect
-       ry="39.992893"
-       rx="39.992893"
-       y="199.07346"
-       x="234.0726"
-       height="292.48718"
-       width="289.29773"
-       id="rect3442"
-       style="opacity:0.94527366;fill:url(#linearGradient2440);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.94291234;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter3478)"
-       transform="matrix(0.1669277,0,0,0.1669277,315.15745,286.31091)" />
-    <rect
-       style="opacity:0.7761194;fill:url(#linearGradient2442);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.94291234;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter3522)"
-       id="rect3482"
-       width="289.29773"
-       height="292.48718"
-       x="234.0726"
-       y="199.07346"
-       rx="19.512152"
-       ry="19.72727"
-       transform="matrix(0.1669277,0,0,-8.1894579e-2,315.15745,384.66903)" />
   </g>
 </svg>

Modified: trunk/lightsoff/main.js.in
==============================================================================
--- trunk/lightsoff/main.js.in	(original)
+++ trunk/lightsoff/main.js.in	Sun Feb  1 05:55:48 2009
@@ -27,7 +27,7 @@
 Clutter.color_parse("Black", black);
 
 var stage = new Clutter.Stage();
-// Needs to be translatable..I haven't figure this out yet.
+// Needs to be translatable. I haven't figured this out yet.
 stage.title = "Lights Off";
 stage.signal.hide.connect(function () { Clutter.main_quit(); });
 stage.color = black;
@@ -44,11 +44,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_direction(1);
+forward.flip();
 forward.set_position(score.x + score.width + 2*margin,
 					 score.y + (.5 * score.height) - (.5 * forward.height));
 



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