WorldTesting extension
run, untilLoaded, tap and viewPoint on a World, for tests.
- on
Methods
-
run(
double seconds, {int fps = 60}) → void -
Available on World, provided by the WorldTesting extension
Runssecondsof frames,fpsa second:world.update(1 / fps)that many times. -
tap(
double x, double y) → void -
Available on World, provided by the WorldTesting extension
A tap at (x,y) in the view's logical pixels, on the next frame: a finger down and up again, a new one each time. Throws a StateError while the input has no view size. -
untilLoaded(
GameObject object, {Duration timeout = const Duration(seconds: 30), int fps = 60}) → Future< void> -
Available on World, provided by the WorldTesting extension
Waits forobjectto load (GameObject.loaded), running a frame each 5 ms of real time meanwhile, as the app would: for a game whoseonLoadawaits a routine (a fade,wait, a tween), which goes on only in a frame, so a bareawait game.loadedwith no frames run would wait for ever. Throws what the load threw, or a TimeoutException aftertimeoutof real time. -
viewPoint(
double x, double y) → ViewPoint -
Available on World, provided by the WorldTesting extension
(x,y) in the view, as the input gives a finger's place: forcamera.screenPointToRayand the like. Throws a StateError while the input has no view size.