Ability to compare costumes with identical (or = )

Currently the only way to compare costumes is by comparing their pixels, but what the user would think that just comparing two costumes with = or identical to would work, but they don't.

I'm suggesting that you should add a much better way of comparing costumes, either using the identical to block, or the equals block. I think that you should use the identical to block because two costumes are different morphs, but they are identical to each other, but then again, comparing lists is with the equals block instead of the identical to block (I'm pretty sure was a change in snap 6.0).

edit: I now realize identical to is checking for exact copies, same text, same list. You should use the equals block instead.

but what condition would define the two costumes' equality? is it checking if each individual pixel in both images are the same color? that would be very slow, and i can't really think of any use cases of that so i don't think that would be needed?

uh, have you tried comparing the pixels of two costumes? It's faster than you think it is.

same pixels, same width and height (same image...)

that reply i made was dumb

it would make sense, but i still don't really know why this would be useful. if it's not useful enough i don't think it's important enough to be a built-in feature. why did you want to see if a costume is the same as another costume, anyway? also, snap already has the feature to compare two lists to see if they have the same items, you can just do the same with the two costumes' pixel list. (and also see if their widths and heights are the same)

I got the idea from First-class colors (Part 2) where it represents a color with a costume. Also, this would help new users who don't know a whole lot about snap be able to compare costumes easily.

Well, it's low priority, since you can easily write it yourself. Possibly when we get around to designing support for abstract data types, part of that will be the ability to specify an equality test for members of an ADT, and then we could use that for costumes too.

ah, ok. Thanks.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.