[PLUGIN] Paster

From the Asset Store
The I18N (Translation) is a Construct plugin created to translate text in game.
  • sir LoLz

    I finally tried those solutions and you can't get the tilemap to draw tiles that are offscreen. Try instead to move the tilemap onscreen, paste it and move it offscreen. That should work.

    I haven't seen the second issue you describe and I can't reproduce it.

    frcol

    "Paste object" will draw the specified in place wherever it overlaps the paster object.

    See the attached example.

  • Somebody, I´ll take a look at trails.

    Thanks R0J0hound for the example!

  • R0J0hound,

    using Paster, now it is much faster in mobile..great!

    thanks.

  • I think I know why objects disappear from the pastier now. you said that the pastier object checks collisions before pasting? Well the player objects hit box only surrounds there feet.

  • Thanks for paster and canvas R0J0hound, wonderful plugins.

    I am trying to do a perspective adjustment tool: takes a photo of a building and makes a flattened version of its facade. It is something that you can see in action on the youtube video (look for video # shIplS95nyk, i can't post links yet...), and in the below screengrab.

    I've started laying out something (attached capx) but obviously haven't figured out what to do next... any ideas? Somebody?

    The main problem is the fact that there seems to be no way of having a trapezoidal canvas or paster, so there is no way to capture the original distorted facade before stretching it back to a square...

    [attachment=0:38b8clq0][/attachment:38b8clq0]

    [attachment=1:38b8clq0][/attachment:38b8clq0]

  • You cannot capture a trapezoid so you'll need to capture the rectangle and then do some serious math to calculate the distortion, then the clean rectangle based on that. After you have it I would just draw the distorted image as a quad on a paster object of the correct size (but it would probably have a seam of sorts as seen in an older post here.

    I once tried doing this for a work project in a different system and then my head exploded. It might be trivial for someone like R0J0, but if math isn't your strong side it could be tough.

  • icepam

    That's not really possible using this plugin.

    You could of course calculate the transformation matrix from the points on the left to the points on the right, and apply the same transformation on the corners of the image on the left. It's a rough idea and a little tedious to do, especially if you've never done any matrix math. I could also instead possibly add another "draw textured quad" action that let's you specify uv coordinates to use.

    The second and probably more pressing problem is the "draw texture quad" action doesn't do any perspective correction since it has no z knowledge. It looks like "affine" in this link:

    http://en.wikipedia.org/wiki/Texture_ma ... orrectness

    So you'd either have to write an effect to do the perspective drawing or do it with math in events a pixel at a time, which is relatively very slow. The math is basically in the above link but it doesn't cover everything.

    I was able to use it a few posts back with horizontal lines but it's not enough for what you're after.

    plugin-paster_p875157?#p875157

  • Thanks R0J0hound, I found these maths (add the dots): www imagemagick org/Usage/distorts/#perspective, but as you said the block is the lack of trapezoid to start with.

    Can the plugin have an added action like "copy underlying pixels to the quad" (with custom resolution ideally) - which would be similar to having a quad shaped Paster object I guess?

    Then the 2D maths at imagemagick should, if I understood it correctly, allow us to fix the distortion - no need for z.

  • icepam

    I added an improved "draw quad" action that can set the texture uv's of an image. Attached is an example. It uses and updated paster plugin so you'll need to re-download it.

    Notice it still doesn't look right since without z it's an affine transformation. For a correct look the z would need to be calculated for each point and the perspective drawing would have to be done manually.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thank you R0J0hound, this looks nifty, and what you did should be sufficient for my demo, until I find a better technology to do this function. I don't understand uv mapping so I will do some research anyway to understand your capx.

    I have done a version which seems to get slightly better results, but it is much more convoluted than the 5 lines in your capx. I will try to share later if anyone is interested.

  • thinking out loud here, would something like this be feasible with the current plugin? it would allow an extra degree of adjustment in the center of the image where the "diagonal" was hurting most. By extrapolation one can write a routine that will subdivide the whole image with such quads, with coordinated nodes... anyone?'''

    [attachment=0:1gt3meqt][/attachment:1gt3meqt]

  • R0J0hound It looks like your updated Paster do not paste objects anymore

    On every capx I've checked (using r196) "Paste Object into canvas" do not work at all.

  • R0J0hound It looks like your updated Paster do not paste objects anymore

    On every capx I've checked (using r196) "Paste Object into canvas" do not work at all.

    Indeed, can confirm.

  • > R0J0hound It looks like your updated Paster do not paste objects anymore

    > On every capx I've checked (using r196) "Paste Object into canvas" do not work at all.

    >

    Indeed, can confirm.

    me too, thought it was me

  • *sneaky mode on* This would be the perfect occasion to look into pasted object opacity being set to 100 every time as well *sneaky mode to moderate*

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