[gcompris/gcomprismusic] Added more options in activity.desktop x, y co ordinates for every object



commit 5e9d5457e858a1ae0a40a9ecfafe104c5ec261d9
Author: Karthik Subramanian <itskarthik s gmail com>
Date:   Wed Jun 8 13:26:22 2011 +0530

    Added more options in activity.desktop x,y co ordinates for every object

 .../resources/rhymes/activity.desktop              |   20 ++++++++++++++++----
 src/rhymes-activity/rhymes.py                      |   18 +++++++++---------
 2 files changed, 25 insertions(+), 13 deletions(-)
---
diff --git a/src/rhymes-activity/resources/rhymes/activity.desktop b/src/rhymes-activity/resources/rhymes/activity.desktop
index 352f4f0..d353140 100644
--- a/src/rhymes-activity/resources/rhymes/activity.desktop
+++ b/src/rhymes-activity/resources/rhymes/activity.desktop
@@ -1,16 +1,28 @@
 [1]
 title=Humpty Dumpty
+title_x=400
+title_y=50
 text='Humpty Dumpty sat on a wall\nHumpty Dumpty had a great fall,\nAll the king's horses and all the king's men\nCouldn't put Humpty together again.'
 image=rhymes/humptydumpty.svg
+image_x=100
+image_y=140
 icon=rhymes/humptydumptyicon.jpg
-x=600
-y=250
+icon_x=450
+icon_y=400
+text_x=600
+text_y=250
 
 [2]
 title=Twinkle Twinkle little star
+title_x=400
+title_y=50
 text=Twinkle, twinkle, little star\nHow I wonder what you are.\nUp above the world so high,\nLike a diamond in the sky.\nWhen the blazing sun is gone,\nWhen he nothing shines upon,\nThen you show your little light,\nTwinkle, twinkle, all the night.\n\nThen the traveller in the dark,\nThanks you for your tiny spark,\nHe could not see which way to go,\n If you did not twinkle so.\n\nIn the dark blue sky you keep,\nAnd often through my curtains peep,\nFor you never shut your eye,\nTill the sun is in the sky.\n\nAs your bright and tiny spark,\nLights the traveller in the dark.\nThough I know not what you are,\nTwinkle, twinkle, little star.\n\nTwinkle, twinkle, little star.\nHow I wonder what you are.\nUp above the world so high,\nLike a diamond in the sky.\n\nTwinkle, twinkle, little star.\nHow I wonder what you are.\nHow I wonder what you are.
 image=rhymes/twinkletwinkle.jpg
+image_x=100
+image_y=140
 icon=rhymes/twinkleicon.svg
+icon_x=450
+icon_y=400
 audio=rhymes/twinkle.ogg
-x=600
-y=250
+text_x=600
+text_y=250
diff --git a/src/rhymes-activity/rhymes.py b/src/rhymes-activity/rhymes.py
index be3fa32..0768973 100644
--- a/src/rhymes-activity/rhymes.py
+++ b/src/rhymes-activity/rhymes.py
@@ -107,8 +107,8 @@ class Gcompris_rhymes:
     
     self.rhymetitle=goocanvas.Text(
         parent = self.rootitem,
-        x = 400,
-        y = 50,
+        x = int(self.dataset.get(str(calledrhyme),"title_x")),
+        y = int(self.dataset.get(str(calledrhyme),"title_y")),
         text = str(self.dataset.get(str(calledrhyme),"title")),
         font = 'sans bold 25',
         fill_color = 'black',
@@ -127,9 +127,9 @@ class Gcompris_rhymes:
     
     w = 300.0
     h = 475.0
-    x_left = int(self.dataset.get(str(calledrhyme),"x"))
-    x_right = int(self.dataset.get(str(calledrhyme),"x"))+200
-    y = int(self.dataset.get(str(calledrhyme),"y"))-125
+    x_left = int(self.dataset.get(str(calledrhyme),"text_x"))
+    x_right = int(self.dataset.get(str(calledrhyme),"text_x"))+200
+    y = int(self.dataset.get(str(calledrhyme),"text_y"))-125
     
     self.rhymetext.tb = gtk.TextBuffer()
     self.rhymetext.tv = gtk.TextView(self.rhymetext.tb)
@@ -161,8 +161,8 @@ class Gcompris_rhymes:
  #fills the rhymeimage
     self.rhymeimage=goocanvas.Image(
         parent = self.rootitem,
-        x = 100,
-        y = 140,
+        x = int(self.dataset.get(str(calledrhyme),"image_x")),
+        y = int(self.dataset.get(str(calledrhyme),"image_y")),
         width = 280,
         height = 280,
         pixbuf = gcompris.utils.load_pixmap(self.dataset.get(str(calledrhyme),"image"))
@@ -170,8 +170,8 @@ class Gcompris_rhymes:
  #draw the play Icon
     self.rhymeplayicon = goocanvas.Image(
         parent = self.rootitem,
-        x = 450,
-        y = 400,
+        x = int(self.dataset.get(str(calledrhyme),"icon_x")),
+        y = int(self.dataset.get(str(calledrhyme),"icon_y")),
         width = 60,
         height = 60,
         pixbuf = gcompris.utils.load_pixmap("rhymes/playbutton.svg")



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