Game Development Community

CompositeSprite Woes

by practicing01 · in Torque 2D Beginner · 07/11/2014 (6:44 pm) · 2 replies

I'm having trouble finding a bug, not sure if it's in my code or in the source. Initially creating a grid works, reinitilizing it somehow expands it. github.com/practicing01/Torque2D/blob/development/modules/CompositeSprite_Tool/1...



#1
07/12/2014 (3:45 am)
The CompositeSprite resizing itself is due to the fact that the center of the Composite is also the center of the tile with logical position 0, 0. Plus all the sprites are being added to the +X, +Y quadrant, leaving the other quadrants empty but still a part of the overall AABB.

Try it with a 400x400 composite and a grid size of 100x100. You'd have an axis length of 350. With a grid size of 200x200 you have an axis length of 300.

By the way, this is a really promising editor. Big thanks for sharing this!
#2
07/12/2014 (8:10 am)
It was a good idea to keep things centered like how it should be, thanks. Have some things that need to be added before it's complete. github.com/practicing01/Torque2D/commit/aa28a39998a6382cba54b7a42e2d56d8f37889aa

s27.postimg.org/4nnc84j6b/Screenshot_from_2014_07_12_10_48_57.png