Jump to content

Help understanding creating / rendering textures


James Cat
 Share

Recommended Posts

Hi

I am porting a game from C to JavaScript and usng pixiJS as the renderer.

In the original C game there is a part in the code where a random number from 0 to 3 is generated, there is a texture that is 256 x 64 (4x1 of 64px tiles)and depending on the random number either the first, second, third or fourth tile is copied into the container.

I have been through the docs on renderTexture but I am finding it hard to understand how to do the part where I take only a single tile (a rectangle) from the source image and render it onto the renderTexture, is it possible?

many thanks for any help

 

James

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.

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

Loading...
 Share

  • Recently Browsing   0 members

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