[PLUGIN] Paster

From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • I think what happens is that, it doesn't runs the actions in the correct order.

    I paste object and then mirror/rotate, but it acts as if the mirror/rotate was done before the paste.

  • Hmm, interesting. I've never enountered that. Then again I haven't used webgl in a while either.

    I probably won't be able to look into it very soon.

    Webgl queues up draw calls until a "present" or "flush" call sends everything to the gpu to draw. If you're interested in tinkering with it you can try adding glwrap.flush() to the end of the paste function in the plugin's runtime.js. It may not be that exactly though. It might solve the out of order issue, but it will also make it slower.

  • I managed to get the effect I wanted, but what I found weird is:

    • every tick

    + load texture from canvas

    + clear to rgba(0,0,0,0)

    If I put the clear above the load texture, then it won't clear it. Some reason it only clears if you do it last. This happens if webgl is disabled (I haven't tested with webgl enabled at all yet).

  • That "load texture from canvas" doesn't work reliably with webgl on since it relies on undefined behavior of the webgl spec. I never got around to removing it.

    That said, it makes sense to me that it would clear only if you clear last. If you cleared first, it would clear but then it would be filled with a copy of the canvas.

  • I'm using canvas2d though, not webgl, and I want it to be filled with a copy of the canvas.

    What I meant is that it doesn't clear at all if it is above. It just loads the texture without clearing first.

    So for some reason I have to clear it at the very end so that it is cleared in the beginning of the next event cycle.

  • Prominent

    It may be because C2 didn't redraw yet. So it doesn't matter what you draw to the object before grabbing the canvas, because c2 hasn't redrawn the canvas.

    Edit:

    Also I cannot reproduce the flicker issue. Can you show the event used?

  • Hm.. but the issue is that it isn't clearing the paster object when that event is first. It draws the canvas to the object but the previous image isn't cleared.

    https://1drv.ms/u/s!AhHSZHEulqh_gWVgeYYDfLejkXNJ

    There's an example of the flickering.

  • There probably is nothing i can do about that.

  • Hi, pardon me if this has been answered before.

    I can't get lighting to work for my game when using paster to make a split screen. Seems to be out of alignment or most likely I'm using it incorrectly?

    https://dl.dropboxusercontent.com/u/42843139/share/pasterlight.capx

  • frozenen

    The light's blend mode seems to be most of the issue. I can't come up with an easy fix but you probably can get it to work by being specific as possible.

    When it's single screen the light layer is black and you erase the lights from it.

    When it's split screen you need to replicate the layer with another paster to get it to work. As it is now it's drawing the light as if it's on the same layer.

  • I'm trying to figure a good way to design my levels. I was considering using lots of tilemaps, that don't fill the entire layout, and overlay each other.

    It seems like pasting all these to a paster object at beginning (then deleting the tilemaps) would improve performance, since the paster only requires one draw versus the many tilemaps with numerous draw calls.

    Is my thinking correct, in that using a single paster object would benefit rendering in this case?

    edit: also, does it render the whole paster object even if it only shows a portion on screen? Perhaps it wouldn't help performance?

    edit: "GPUs are also well-designed enough to only process the on-screen parts of an object that appears partially off-screen. So literally nothing outside the window area is ever rendered by the GPU."

    So I guess it only renders what is visible.

  • I'm trying to figure a good way to design my levels. I was considering using lots of tilemaps, that don't fill the entire layout, and overlay each other.

    It seems like pasting all these to a paster object at beginning (then deleting the tilemaps) would improve performance, since the paster only requires one draw versus the many tilemaps with numerous draw calls.

    Is my thinking correct, in that using a single paster object would benefit rendering in this case?

    edit: also, does it render the whole paster object even if it only shows a portion on screen? Perhaps it wouldn't help performance?

    edit: "GPUs are also well-designed enough to only process the on-screen parts of an object that appears partially off-screen. So literally nothing outside the window area is ever rendered by the GPU."

    So I guess it only renders what is visible.

    If you have a lot of overlapping tilemaps, Paster is the way to go. Tilemaps in C2 are very slow and not all that optimized (compared to other implementations).

  • Cool, I guess I will try this method then.

    If I run into any issues, I'll post them here.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello,

    I'm having issues when pasting objects that have your Outline effect applied. When pasting, it draws black pixels around sprites outline. This only happens under Node Webkit export not preview as far as I know.

    Do you know something about this ?

    I found later that it may be related to Outline effect only, and not Paster, but I don't know.

  • I don't use effects but as far as I know the only issue with the outline effect was being thicker on export but that was corrected in C2's renderer a few releases ago.

    Now the paster object doen't behave the same way as C2's renderer when using effects, so results will be different in a lot of cases. So yeah, it's a bug in the paster plugin but I probably won't get around to fixing it.

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