I know about using alternative dimensions throughout my engine. My physics engine is handmade, and works by placing sensors to create complex physics collision rules. I adjust the sensors based on multiples of the width and height, so it dynamically resizes based on the size of the object. I’ve written my engine around flexibility, so I can resize just about anything, remake just about anything, redraw just about anything, or recode just about anything and the rest of the engine adjusts to fit it. I’m not “constrained to only using an object’s content bounds” at all. I literally have a 300-SLOC-long configuration file that sets all the required properties for the rest of the engine to use. But changing the player from a 128-pixel-tall Spine animation to a quarter-screen-sized snapshot (the size required to avoid clipping animations, what with weapon swings and climb repositioning and all) without actually resizing the player’s object, but instead just adding a couple hundred empty pixels to either side, is a breaking change.
so why can’t it just automatically adjust to fit its children?
I’m not suggesting here that Corona change their default snapshot functionality, I’m just saying that it would be really great if the option were available to do it as I’m describing. My phrasing may have been misleading. What I was imagining is this:
local obj = display.newSnapshot() obj.clipChildren = false
that’s also why it’s “not much use” to talk about the “bounds” of a snapshot in terms of its contents – ie, there’s nothing preventing you from putting an object into a 200x00 snapshot at relative “offscreen” coordinates of -1000000,1000000, so is that now a 1-million-square-pixel snapshot? (cuz i guarantee you don’t have the texture memory to support it :D)
No offense intended to you, but your logic is faulty here. Game engine developers shouldn’t say “If we do X, someone might do Y and wreck it. Thus, we shouldn’t do X.” That would lead to no file I/O of any sort (the file might be corrupted, or too large, or what-have-you), no media functions (the memory might not be sufficient), no math functions (there’s always a risk of division by zero or using a number outside a function’s domain) – the list could go on and on, resulting in death of civilization as we know it ;). Instead of safeguarding against edge cases by removing the feature (note that I’m not saying the Corona devs are doing that; I’m just expanding my argument), programmers should rely on normal computer programming practice:
if size \> MAX\_SUPPORTED\_SIZE then error("The snapshot's children have expanded the snapshot's dimensions beyond the device's texture limit.") end
That way, programmers would code around the limitations themselves instead of being limited by a safety measure to keep people away from an edge case.
wouldn’t it just be simpler to put all your discrete content into a group first, then put the group into the snapshot? cuz you want group-type bounds, right? but you want to render that group’s content to texture for effects and what-not, right?
And we’re back to the beginning… My object is a display group. It’s a souped-up Spine animation, each component of which is inserted into a group. I’m inserting it into a snapshot for effects, and I’m having the problems because of that. I can’t insert the whole map into a display group because I only want the player to flash red, and I can’t not use snapshots because I want the player to flash red.