Sign in to follow this  
amshegarh

Best way to trim texture

Recommended Posts

I've seen this question before, has anything changed? I need to get texture(s) from spritesheet, sometimes texture needs to be cut in several ones and placed in different sprites, previous answer only took texture from img src and it was something more complicated than it should be for task this simple

Share this post


Link to post
Share on other sites

still "new PIXI.Texture(baseTexture, frame, trim, orig, rotate)". Frame is obvious, but sometimes you need extra stuff,  and i cant explain other params in this thread, look in the docs. After 2-3 fails you'll get it :)

I dont know how to make it easier. If you want to make it even easier - propose an API for it. Yes, sometimes in private code I use methods that actually cut texture region to more texture regions, for example for NineSlice or to sort objects in isometry and cut sprites with multiple vertical lines. This is one of such attempts for pixi-v4: https://github.com/gameofbombs/pixi-heaven/tree/master/srcOld/base/atlas  but it doesnt have nor good API's nor docs.

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.