How do I set runtime.redraw = true.

0 favourites
  • 7 posts
From the Asset Store
Antisuspend Plugin
$7.20 USD
20% off
Antisuspend Plugin for Construct 3 prevents the runtime from getting suspended.
  • I have a project that I am working on and I think the issue I am having is that construct isn't updating the canvas on every tick.

    Problem: When using this draw canvas the unto/redo buttons dont update the canvas usually on the first click, however when I re-click in the canvas.. the undo/redo triggers. Also the "print" button will open the preview for the print, however it is not what is on the current canvas.. its always a few brushtrokes previous. If I close the preview, reclick in the canvas and then print again.. it's the right preview.

    I can see articles saying to set the runtime.redraw = true but where do I do that?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • runtime.redraw is a technical detail of the Javascript SDK that is not applicable if you are actually using Construct 2. Perhaps you are using a third party plugin that is buggy - report the issue to the developer.

  • Hey Ashley,

    Thanks for the reply.

    Maybe you can help me with my problem. I now see what you mean in your reply.

    I am trying to update a project I did not create. It is a sort of "business card maker" using C2 with a canvas. It uses "rex_canvasext" behavior and "rex_undoredo" plugin to add functionality to the canvas.

    Where I am having problems is in the Undo/Redo buttons. They work... but not immediately. When hitting Undo or Redo, I must use a brush to click on the canvas before it updates. In other words once I bring focus back onto the canvas itself, the "undo" shows up. Example: I first draw a vertical line, then I draw a horizontal line... I click "Undo" but nothing changes immediately. I simply click anywhere inside the canvas(thus drawing a single dot) and the horizontal line disappears as it should have when I hit "Undo". This, to me, shows that the "undo" process actually happened, but the canvas won't update until the next time it's affected directly. I am looking through the JS on the plugins, but I can't figure out where exactly I need to make a change so that when the image of the canvas is updated(an undo or redo) that the canvas will immediately change and not require a direct change(a brush stroke) before showing the undo/redo.

    Also, when I go to use my browser to "Print" it seems like it prints 1 step behind whatever the screen shows. So, if I load the page and do nothing and then print.. I see a white screen instead of the main screen. If I click on Object A to load options, and then press print, my preview shows the Main screen BEFORE i clicked object A. If I then click object B and show different options... then press print... my preview shows my screen with Object A and its options loaded... etc. It seems the DOM contains the info that was already past and not what your are currently seeing. Any ideas?

    Any advice you can give me?

  • I can't support another developer's plugins. You have to ask them.

  • I can't support another developer's plugins. You have to ask them.

    Sure, I don't expect you to support their plugin. I was asking for advice on how to solve the problem as the problem itself, I don't believe, is specific to the plugin.

    For example the "print" issue... this happens with construct in general... even if you stated a brand new project with no plug in's at all. Add a canvas and the ability to change it in some way. In your browser if you use your browsers built in "print" it will always show you atleast 1 step behind where you are. That is simply using canvas + your browsers print.

    As I said before, I didn't start this project but I think that "canvas" is a build in part of Construct 2 right?

  • dstaggers

    Giving you advice on how to solve your problem involves at least downloading, exploring, testing and understanding the rex's two plugin you mentionned. Ashley don't have time for that and he actually gave you the best advice he could: "ask the plugins' author"

    The authors are probably the ones who know their plugins the most.

    Canvas isn't built in. You have R0j0hound's canvas plugin and rex's rex_canvasext plugin. Making a plugin is so easy when you know a bit of javascript that there's already a lot of them. If Ashley had to know them all he would go mad and see flying monkeys everywhere.... (Oh... Wait...)

    So yeah, bottom line, ask rex (he is a nice Chinese guy, he won't beat you... (too hard) ) =)

  • Ah ok. I thought Canvas was something built in as the scirra site had info on it here. My mistake! Thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)