Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Easy way to flip a sprite? #314

Closed
cycomachead opened this issue Jan 28, 2014 · 7 comments
Closed

No Easy way to flip a sprite? #314

cycomachead opened this issue Jan 28, 2014 · 7 comments

Comments

@cycomachead
Copy link
Collaborator

Am I missing something?

Is there no command to either flip a sprite (x or y axis) via a command block OR using the costume editor?

If not, I think it would be great if one of the Berkeley students could work on this because it's a PERFECT teaching exercise. :)

@kach
Copy link
Contributor

kach commented Jan 29, 2014

Erm. I'm technically responsible for the paint editor one.

@jmoenig
Copy link
Owner

jmoenig commented Jan 29, 2014

Scratch and Snap let you flip costumes by setting the sprite's rotation mode to "only face left/right". To accomplish this the Costume constructor has a method named "flipped()" - in line 5270 of objects.js. This method returns a copy of the costume that is mirrored along a vertical axis. Since we don't yet expose costumes as first-class members in Snap there is not yet a block for this. But - as the function is already there - it is trivial to add one. :)

@cycomachead
Copy link
Collaborator Author

Oh cool, thanks! :)

Would it make the most sense to add this as an option to the current
graphics effects block or to create a new one? (Though that seems like
clutter, IMO.)

Michael Ball
http://www.michaelballphoto.com
Photos & iPhone Apps!

On Tue, Jan 28, 2014 at 11:26 PM, Jens Mönig notifications@github.comwrote:

Scratch and Snap let you flip costumes by setting the sprite's rotation
mode to "only face left/right/. To accomplish this the Costume constructor
has a method named "flipped()" - in line 5270 of objects.js. This method
returns a copy of the costume that is mirrored along a vertical axis. Since
we don't yet expose costumes as first-class members in Snap there is not
yet a block for this. But - as the function is already there - it is
trivial to add one. :)


Reply to this email directly or view it on GitHubhttps://github.com//issues/314#issuecomment-33562005
.

@brianharvey
Copy link
Collaborator

The left-right button is okay for rotation around the vertical axis, although sometimes I want to change the costume permanently because the picture I clipped from Google Images faces left and so if I use it as a costume the sprite moves backwards from the way it's facing. But none of this lets us flip around the horizontal axis.

With respect to the block question, I think that flipping in the Paint Editor is a permanent change to the underlying costume, but flipping programmatically is indeed a graphics effect.

@larsemil
Copy link

👍 to brianharvey

@kach
Copy link
Contributor

kach commented Jun 3, 2014

#470

@cycomachead
Copy link
Collaborator Author

I'm going to close this since costume editing is what a lot of people like to use. :)

(Though, eventually, a temporary/programatic solution would be great.)

brollb added a commit to c2stem/snap-physics that referenced this issue May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants