Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by FabienM

Hi,
I have a game who has an original size of 600*400px.
It's for an android tablet , so I put a scale factor to 2
ig.main( '#canvas', MyGame, 30, 600, 400, 2 );

It's nice when the scale is 1, but with 2 it's really dirty. The transparency of the images becomes purple, it's really slow,...
Should I double the size of my images to let the scale at 1 ?
do you have any advice ?

thx
Fabien

1 decade ago by dominic

That really shouldn't happen and I've never seen this on Android devices.

You could try to scale the whole canvas with CSS instead of doing it in Impact:
#canvas {
    width: 1200px;
    height: 800px;

    /* this triggers hw accelerated scaling */
    -webkit-transform: scale3d(1, 1, 1) ;
}

1 decade ago by FabienM

Hi,
it works with this method but I lost my variable ig.system.scale.
So all my mouse coordinates are wrong, I have to divide them by 2.
Anyway, I have some great performances with impact 1.20 : 55 fps on ym tablet
nice !

thx
Fabien

1 decade ago by FabienM

By the way, that's really strange
The performances are really better when I scale with the CCS method.
I double my FPS

Strange isn't it ? Any idea why ?


Fabien

1 decade ago by Heiko

A lot of the 3D transforms are supported in hardware - thus the scale3D transform is probably hardware accelerated.

(2D transforms are not, that's why its recommended to rather use 3D transforms)
Page 1 of 1
« first « previous next › last »