[PLUGIN] Paster

2 favourites
From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • If they are always flipped you could flip the paster object first before pasting the text. Just center the flip on the center of the text object. Or to make the math simpler use a second paster object with the hotspot centered. The just place it over the text, flip it, paste text, flip it back, and move it to where you want to paste on the other paster.

    If it's flipped on only some machines then we need to detect if the textures are flipped. You can't do this with events but I think you can with JavaScript and webgl. The grab canvas action (I may have forgot it's name, but it's the one that tries to copy the game canvas to a paster object) has some code that finds this out first time it's run. It works by running a minimal webgl renderer to draw onto a 1x2 image. It then reads one of the pixels and thereby knows if it's flipped or not.

    Anyways to fix it in the plugin itself probably entails making the plugin check if textures are stored flipped when the plugin first loads, and the add a check to the paste action if it's a text object being pasted and flip it if need be.

    Or maybe look at the text object's source and see what it does. C2 doesn't have an issue with text flipping normally, so maybe by looking at the text object and C2's renderer you can see where the difference is.

    That's as narrowed down a place to start as I can think of.

    Hopefully some of that helps. I'm happy to answer questions from what I can recall but it's probably safe to say I'm not going to touch the plugin's source again.

  • Thanks for the detailed response.

  • Hey R0J0hound , seems like spawning and pasting a total of 256 (sometimes less) different paster objects softlocks the engine even if they are deleted afterwards. Is this a limitation of the plugin or am I doing something wrong?

    Code:

    Demo:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No idea really. I guess you could look at the browser console. Maybe you're running out of video memory?

  • R0J0hound

    hello

    I use your Paster and it works ok but when i make preview in cocoon ios app it works only in canvas+ and not in webview?

    can you comment on this?

    Tnx!

  • irina

    Sorry, I have no idea why one works and the other doesn't. I've only ever used html5 and nwjs export.

  • Hi R0J0hound , first thanks for the great plugin.

    I'm using actually the Canvas & Paster plugin due the canvas have the option to pick RGB values and paster because accept the shader effects.

    My problem is that i'm using the WebGL shaders on a layer(Due some ones only are available for layer and not sprite).

    I can set the Paster size the same as an image imported like 2048x , but i can't add the image with all the layer effects on paster.

    • With "take a snapshot" only takes the window size but if the image is 2048x or more exports cutted.
    • With "load texture from canvas" same problem. I tried also with events change the canvas size and NW.JS windows size to adapt to the image imported but if the SO/Monitor not have that resolution the size can't be higher.

    I saw the "canvas" plugin have an action that says "Pastes layer" but not works, got an error when try to trigger in runtime, btw the canvas not accepts the WebGL effects.

    Is possible add the "Paste Layer" on Paster plugin? Or there is another way i can try to paste in the Paster plugin all the content of a layer? Or maybe on a Sprite using the LoadingURI get the layer content and then paste that image on Paster?

  • At the risk of stepping on toes, I needed a PasteLayer option a while back and always meant to forward you the code. Since you aren't actively working on Paster anymore, I offer this addition, should anyone else find it useful.

    Paster_withPasteLayer.zip

    Example

    If you go back a few pages, I actually added Paste-Layer, as I needed it also.

  • blackhornet No works for my needs, if "Paste Layer" measn simply copy the objects not is what i'm looking for then.

    This is the result:

    I have WebGL effects in the layer that are applied to a sprite.

    But if the photo added is like 2048 or 3000x or whatever, take snapshot or similar not works because only gets the APP canvas or window size depending which option uses.

    So i thought "Paste Layer" was some kind of pasting all the visual on that layer into the plugin, but if are only the objects is not what i need.

    I need some way to get the image/visual/screenshot of a layer to paste in the Paster plugin no matter the APP window size,etc...

    Any solution?

  • C2, as an optimization, will clip objects to the window. I've already asked for a workaround to this, but it wasn't addressed. I know SprteFont falls into this category.

  • if you want to paste something offscreen that isn't drawn when offscreen in that plugin then you have to do something tricky such as make the game canvas the same size as the layout for a tick before pasting.

    For layer effects you'll want to just paste all the relevant objects on that layer to a seperate paster object first and apply the effects and blend mode to that.

    The canvas object will crash when pasting certain objects when webgl is on because those plugin's don't do anything to make the non webgl version work when webgl is available.

    Maybe that can help? You may need to adjust your game or come up with a creative solution to work around it. The paster plugin itself is basically final and meant for simpler things it does well.

  • R0J0hound Yes i make the canvas size and NW.JS window size bigger before use the paster but if the monitor resolution is for example 1280x720 and the image imported is 2048 not works, at least on windows i can make a window more big than the resolution is, no problem with the canvas but due the scale makes somethings weirds. I'm using now "LetterBox integer scale" but when i try to export an image on others options, seems catch stuff in the margins or other weird stuff.

    So well, i will try other options and other workarounds if is possible, but if you have more ideas, please let me know.

  • R0J0hound Tried various stuff but nothing .

    I guess using the shaders on the sprite instead of the layer and just pasting that object will work on any size, right?

    Made on layer because one of the effects, the pixellate one not works correctly applied on the sprite.

    So, i think if finally want use any size will have to rework all the effects system (22 FX XD) if i can get the pixellate shader fixed.

  • Hi,

    Sorry i can't be more help. I'm really detached from this and am only vaguely familiar with it's issues and caveats of use. So it's safe to say i don't know a solution and probably won't be finding one.

  • Awesome plugin!

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