Issue drawing images on load

Bugs will be moved here once resolved.

Post » Wed Apr 30, 2014 8:29 pm

Problem Description
On load, images are always displayed at axis 0,0. Line of concern is ctx.drawImage(frameimg, 0, 0). We are using a number of images, including sprites with filled color, they appear squashed in the upper left and hand corner not long before being laid out correctly.

Temp solution: for each runtime we could update the script to show images off the stage by setting points to -6000.

However, the option we have gone with until this can be resolved is: add a function on load complete that calls an external JS function that lets canvas know construct is ready, e.g. set canvas style to display:block.

Also note: we are also calling web services to get JSON data.

Observed Result
Image mash up, axis points 0,0

Expected Result
No image mash up.

Affected Browsers
  • Chrome: (NO)
  • FireFox: (YES)

Operating System and Service Pack
Windows 7 Service Pack 1

Construct 2 Version ID
Release 163
B
2
Posts: 9
Reputation: 168

Post » Fri May 02, 2014 2:50 pm

Closing, please follow the bug report guidelines. I do not see this problem and I have no way of reproducing what you've reported because you didn't describe what you are doing.
Scirra Founder
B
395
S
232
G
88
Posts: 24,376
Reputation: 193,792

Post » Mon May 05, 2014 9:58 pm

Hi Ashley, I've read the guidelines BUT this is not about the capx file or anything in it, its in regards to the runtime.js that is created. Regardless of capx file supplied, ALL images are set at axis 0,0 on canvas. Images aren't laid out correctly until events are able to be reached, so for a large game with lots of images. You may get this issue, I think the difference for us is that we are also relying on web services after load AND this may also be creating loading issues, however, regardless the problem still points to how images are being added in the canvas. And creating a good preloader for Construct2 games, e.g. how you would develop a preloader for Adobe Flash Games. Are all assets ready? Show game.
B
2
Posts: 9
Reputation: 168

Post » Tue May 06, 2014 10:05 am

I never see that in any .capx, nor have I ever heard any other users reporting the same issue. Without a way to reproduce the problem there is nothing we can do about it. But it sounds specific to your computer only. Does it happen on any other computers? Are your graphics card drivers up to date?
Scirra Founder
B
395
S
232
G
88
Posts: 24,376
Reputation: 193,792

Post » Wed May 07, 2014 9:43 pm

Works fine on Chrome. Just FireFox is the problem.

I should have also mentioned that this is no ordinary game. We're developing a full featured multimedia educational game. Videos, web services, loading in JSON data etc.. a lot going on. Probably if we strip it back we could eventually determine where it might be getting a hold up. But we're days from launching now, so will keep going with our wrapping preloader option.

I think typically games load reasonably fast, you might not notice images being laid out to their x and y axis points, but something in our game creates the delay where images are still 0,0, at least for 0.5 milliseconds.

Can't upload a capx file as its not personal development.
B
2
Posts: 9
Reputation: 168

Post » Wed May 07, 2014 10:15 pm

@Ashley It only occurs when not using webgl. In the sprite plugin it has the function "preloadCanvas2D" that draws all the animation images to the canvas on load. You can see it in any project if you set "Enable WebGL" to off, "Clear Background" to no and make the bottom layer transparent. So when the load is quick you will never see them since it will be overdrawn.
B
92
S
32
G
107
Posts: 5,274
Reputation: 69,959

Post » Wed May 14, 2014 2:00 am

Correct. We are not using webgl.
B
2
Posts: 9
Reputation: 168

Post » Wed May 14, 2014 2:06 am

Another problem and also related is the FireFox NS Error issue. I think this and the above could be the same problem. FireFox NS Error is the Canvas drawImage, sometimes works, sometimes doesn't. We've updated the Construct2 Sprite runtime.js to include try catch and also reload if there is an err. Also seems to be a recommended approach for those trying to work around the FireFox NS Error issue.
B
2
Posts: 9
Reputation: 168


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests