Jump to content

Draw sprite in perspective


Recommended Posts

that's a tilted camera so the objects that are farther away appear smaller. 

You can accomplish this by skewing/warping the image - not supported in phaser by default, but you can modify the internal updateTransform method for display objects so the x and y axis is skewed appropriately. Or do what samme suggested and perform the transforms on a separate canvas with a bitmap data object. See this thread: 

You could also go with a more practical camera view such as isometric. In which case, you could simply rotate the image -45 degrees and reduce the height (y axis) by 50%. You end up with something like this:


Link to comment
Share on other sites


@feudalwarsI think his requirement for a perspective projection requires more effort, skewing and scaling are affine transformations and can be done with the answer provided by @samme, but projection is not I believe .. Correct me if im wrong though:p..


But switching to isometric view could be an alternative solution.

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...