Jump to content

Draw image/sprite warped like in Slick2D?


Recommended Posts

Can we do something like Image.drawWarped (link goes to the javadoc of slick2d) with pixi.js?

It gave devs the possibility to define where to render the 4 corners of an image with absolute x, y locations and it automatically skewed the image to fit in. I guess it just redefined the points of the triangles used to render the image or something like that. (I'm not that fit with gl, thats why I use pixi.js.^^)


Link to comment
Share on other sites

You can even convert your own sprite class into it, there's "convert2d" function for containers/sprites that adds necessary fields.

"2d" is for sprites that use 3x3 matrix instead of pixi default 3x2, performance is the same as a simple sprite.

"2s" is for general curves, in my case, billinear, its slower because of special calculations in fragment shader, math is just harder.

I'm using TS for all of my plugins.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...