Commit 24be2c0e authored by Bruno Coudoin's avatar Bruno Coudoin

Now the bar is centered

svn path=/branches/gcomprixogoo/; revision=3569
parent b48a496c
......@@ -224,9 +224,9 @@ static void menu_start (GcomprisBoard *agcomprisBoard)
gcomprisBoard->maxlevel=1;
/* Set back the bar to it's original location */
gc_bar_location (-1, -1, -1);
gc_bar_set(GC_BAR_CONFIG|GC_BAR_ABOUT);
gc_bar_set_level(gcomprisBoard);
gc_bar_location (-1, -1, -1);
menuitems = g_new(MenuItems, 1);
......
......@@ -168,7 +168,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
canal_lock_next_level();
gc_bar_set(0);
gc_bar_location(0, -1, 0.7);
gc_bar_location(5, -1, -1);
animation = FALSE;
......
......@@ -245,7 +245,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
} else {
gc_bar_set(GC_BAR_CONFIG);
}
gc_bar_location(0, -1, 0.7);
gc_bar_location(5, -1, 0.8);
gamewon = FALSE;
......
......@@ -59,7 +59,6 @@ static gint sound_play_id = 0;
static gboolean _hidden; /* Dialog boxes request a bar hide */
/* Default position for the bar */
static int _default_x;
static int _default_y;
static int _default_zoom;
......@@ -158,14 +157,12 @@ void gc_bar_start (GooCanvas *theCanvas)
height = BARHEIGHT-2;
_default_x = BOARDWIDTH/2;
_default_y = BOARDHEIGHT - BARHEIGHT;
_default_zoom = 1.0;
bar_reset_sound_id();
rootitem = goo_canvas_group_new (goo_canvas_get_root_item(theCanvas), NULL);
goo_canvas_item_translate(rootitem, _default_x, _default_y);
pixmap = gc_skin_pixmap_load("bar_bg.png");
bar_item = goo_canvas_image_new (rootitem,
......@@ -335,9 +332,11 @@ gc_bar_location (int x, int y, double zoom)
ny += BARHEIGHT - (zoom == -1 ? _default_zoom : zoom) * BARHEIGHT;
goo_canvas_item_set_transform(rootitem, NULL);
goo_canvas_item_translate(rootitem,
(x == -1 ? _default_x : x),
y = ny);
GooCanvasBounds bounds;
goo_canvas_item_get_bounds(rootitem, &bounds);
int nx = (x == -1 ? (BOARDWIDTH - bounds.x2 - bounds.x1)/2 : x);
goo_canvas_item_translate(rootitem, nx, ny);
goo_canvas_item_scale(rootitem,
(zoom == -1 ? _default_zoom : zoom),
(zoom == -1 ? _default_zoom : zoom));
......
......@@ -187,7 +187,7 @@ static void start_board (GcomprisBoard *agcomprisBoard)
} else {
gc_bar_set(GC_BAR_LEVEL|GC_BAR_REPEAT);
}
gc_bar_location(BOARDWIDTH-200, 0, 0.7);
gc_bar_location(BOARDWIDTH-160, 3, 0.7);
railroad_next_level();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment