Smashman Posted March 17, 2014 Share Posted March 17, 2014 Hi, I am receiving this error when I attempt to crop a Sprite. I'm using Phaser, but I've tracked the error down to Pixi. The crop still works and if I remove the thrown error, my game works fine and the Sprite appears cropped as desired. I'd like to know how I can fix this, however. It's bugging me, ya see. Thanks Quote Link to comment Share on other sites More sharing options...
Dream Of Sleeping Posted March 17, 2014 Share Posted March 17, 2014 Hello. Are you changing the crop x or y? When I did this I got the same error unless I altered the width or height as well. If you set the crop x to 10 then take 10 off the width. That's the only time I've seen that error. Quote Link to comment Share on other sites More sharing options...
xerver Posted March 17, 2014 Share Posted March 17, 2014 This error occurs when the frame rectangle's dimensions are larger than the actual image itself. Dream's case is the most common, where users move the x/y values but do not decrease the width/height so the rectangle is reaching outside the image. Quote Link to comment Share on other sites More sharing options...
Dream Of Sleeping Posted March 17, 2014 Share Posted March 17, 2014 A bit of a coincidence after replying to this thread. But I've started getting the same error when trying to just load a texture has a hash array in phaser. I've done this loads of times before without any trouble. I've used Texture Packer. Any ideas why I might be getting this error now? I've not even used the texture in my game yet. Quote Link to comment Share on other sites More sharing options...
Dream Of Sleeping Posted March 17, 2014 Share Posted March 17, 2014 I've increased the texture size. I'm not getting the problem anymore. I don't know why texture packer would pick a size too small. Quote Link to comment Share on other sites More sharing options...
1-800-STAR-WARS Posted March 18, 2014 Share Posted March 18, 2014 A bit of a coincidence after replying to this thread. But I've started getting the same error when trying to just load a texture has a hash array in phaser. I've done this loads of times before without any trouble. I've used Texture Packer. Any ideas why I might be getting this error now? I've not even used the texture in my game yet. The 'allow rotation' and 'trim mode' settings need to be turned off or you might run into these errors if the texture size isn't big enough and it tries to do tricks to pack the images in that PIXI doesn't support (yet) Dream Of Sleeping 1 Quote Link to comment Share on other sites More sharing options...
Smashman Posted March 19, 2014 Author Share Posted March 19, 2014 So I should remove some x or y to fix this issue?1 Quote Link to comment Share on other sites More sharing options...
Stunt Pixels Posted March 19, 2014 Share Posted March 19, 2014 Sounds like your X and Y are in the right place (if the image looks correct), but your width and/or height are over the edge of the sprite. You should trim back to the actual sprite dimensions on your width and height. Quote Link to comment Share on other sites More sharing options...
Smashman Posted March 19, 2014 Author Share Posted March 19, 2014 I set the x and y to 0 in the rectangle I pass in that worked. The error check seems a but weird as there's no actual issue. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.