Failed in ball of canvas

I set the coordinates of the canvas balls to position themselves according to the proportion of the canvas

using this procedure:
Opera Instantâ

when i use a test app that has only the screen it works the way i want:
Opera Instantâ


but when I use it on the real screen of the app it doesn’t work
Does the order of canvas x and y procedures influence functionality?
note: the procedure is the same in both apps:
Opera Instantâ
when it boots:
when i click to move to next image:

was supposed to come out just like the test
someone help me ;-;

This is probably the well known issue with the canvas getting its own sweet time to get its own information when the apps initialize.
Is like it’s too soon to ask a canvas how wide and tall it is when the app initializes, because it will tell you something wrong. You need to give it some time to have that information. What everyone does is to enable a clock in the Screen1.Initialize event. This clock can be something like a quarter of a second (250 ms).
When the Clock.Timer event triggers, then you position the balls.
Try it, I’m pretty sure, that’s the problem here.


Something like this

1 Like

you’re the man
thanks :,)

1 Like

If it helped, please mark the answer as the solution. Thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.