Hello everybody!
I have built the UI interface of a game but now I have to fully adapt it to be played on mobile. I use the Zone component and until now I defined the widths statically. The trouble is that when I release these constraints and set the pattern to 'grid', the zone does not adapt filling several lines when there is not enough space when I shrink my window, and components on right get off the screen.
To be sure I am not missing something, I have recreated a simple zone from scratch in a void project.
Still the same problem: the zone does not adapt when there is not enough space for 5 objects.
According to documentation about Zone:
Thanks a lot for your help.
Tchebychev
I have built the UI interface of a game but now I have to fully adapt it to be played on mobile. I use the Zone component and until now I defined the widths statically. The trouble is that when I release these constraints and set the pattern to 'grid', the zone does not adapt filling several lines when there is not enough space when I shrink my window, and components on right get off the screen.
To be sure I am not missing something, I have recreated a simple zone from scratch in a void project.
Code: Select all
setup: function( gamedatas )
{
console.log( "Starting game setup" );
// Create a zone for holding cards with dimensions 182px x 128px
var zone = new ebg.zone();
zone.create(this, 'game_play_area', 182, 128);
zone.setPattern('grid');
// Put 5 div blocks representing the cards in the zone
var n = 5;
for (var i=0; i<n; i++) {
dojo.place("<div id='card_" + i + "' style='background-color:blue;width:182px;height:128px'>" + i + "</div>", dojo.body());
zone.placeInZone('card_' + i, i);
}
// Setup game notifications to handle (see "setupNotifications" method below)
this.setupNotifications();
console.log( "Ending game setup" );
},
According to documentation about Zone:
Do you have any ideas about what I miss?'grid' (objects will be put on lines from top left to bottom right, wrapping when there is not enough space left on the line)
Thanks a lot for your help.
Tchebychev