1 decade ago by tangxuanli
Dear guys:
normally we are using below mentioned logic for different device.
But if android device screen size is different,how I can adapt to it?
and also,all the game is running in canvas,if I want to add some other notifications
to the game,I have to give the absolute X .Y for the font.
then again problems accured,screen size different,notification position will be also
problems.
who can share me some solution ,if you can share me some exmaple code.
it will be very helpful for me.
thank.
if(ig.ua.iOS){
document.getElementById('buttonUp').style.display='block';
document.getElementById('buttonDown').style.display='block';
document.getElementById('buttonLeft').style.display='block';
document.getElementById('buttonRight').style.display='block';
ig.main( '#canvas', MyGame, 60, 400, 560, 1,ig.ImpactSplashLoader);
}else if(ig.ua.android){
document.getElementById('buttonUp').style.display='block';
document.getElementById('buttonDown').style.display='block';
document.getElementById('buttonLeft').style.display='block';
document.getElementById('buttonRight').style.display='block';
ig.main( '#canvas', MyGame, 60, 320, 480, 1,ig.ImpactSplashLoader);
}else{
ig.main( '#canvas', MyGame, 60, 320, 480, 2,ig.ImpactSplashLoader);
}
normally we are using below mentioned logic for different device.
But if android device screen size is different,how I can adapt to it?
and also,all the game is running in canvas,if I want to add some other notifications
to the game,I have to give the absolute X .Y for the font.
then again problems accured,screen size different,notification position will be also
problems.
who can share me some solution ,if you can share me some exmaple code.
it will be very helpful for me.
thank.
if(ig.ua.iOS){
document.getElementById('buttonUp').style.display='block';
document.getElementById('buttonDown').style.display='block';
document.getElementById('buttonLeft').style.display='block';
document.getElementById('buttonRight').style.display='block';
ig.main( '#canvas', MyGame, 60, 400, 560, 1,ig.ImpactSplashLoader);
}else if(ig.ua.android){
document.getElementById('buttonUp').style.display='block';
document.getElementById('buttonDown').style.display='block';
document.getElementById('buttonLeft').style.display='block';
document.getElementById('buttonRight').style.display='block';
ig.main( '#canvas', MyGame, 60, 320, 480, 1,ig.ImpactSplashLoader);
}else{
ig.main( '#canvas', MyGame, 60, 320, 480, 2,ig.ImpactSplashLoader);
}