Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How to make blinking eyes with different graphic files?
Started by d.mach Sep 26 2013 06:12 AM

7 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

d.mach

[GLOBAL: userInfoPane.html]
d.mach
  • Contributor

  • 971 posts
  • Corona SDK

I can't figure out how to animate eyes with different graphic files in the same place. How can I set keyframes to make the graphics not visible and make them visible on another frame?

 

Can anyone please help me with this?

 

Thank you!

 

Daniela

 



[TOPIC: post.html]
#2

CineTek

[GLOBAL: userInfoPane.html]
CineTek
  • Contributor

  • 310 posts
  • Corona SDK

What exactly do you mean with "different graphic files"? :)

 

Max / CineTek



[TOPIC: post.html]
#3

d.mach

[GLOBAL: userInfoPane.html]
d.mach
  • Contributor

  • 971 posts
  • Corona SDK

For example a file "eyes_open.png" and "eyes_closed.png". I can't figure out how to switch them in an animation? How to set keyframes for active and inactive... if that's even how this is done.



[TOPIC: post.html]
#4

CineTek

[GLOBAL: userInfoPane.html]
CineTek
  • Contributor

  • 310 posts
  • Corona SDK

Well, you could pack both files into one sprite and create a simple animation. Then you can switch between both "states" (frames) whenever you want :)

 

PS: Here is a link

 

http://www.coronalabs.com/blog/2013/05/14/sprites-and-image-sheets-for-beginners/

 

You can use object:setFrame(1) or object:setFrame(2) to open or close the eyes



[TOPIC: post.html]
#5

Reaver

[GLOBAL: userInfoPane.html]
Reaver
  • Enthusiast

  • 87 posts
  • Corona SDK

You can key the frames in the Spine editor tool. Add two attachments to the eye slot and then make animations that switches back and forth between them.

 

Alternatively you could make a function that switches between the two attachments using skeleton:setAttachment("name_of_slot", "name_of_attachment")



[TOPIC: post.html]
#6

d.mach

[GLOBAL: userInfoPane.html]
d.mach
  • Contributor

  • 971 posts
  • Corona SDK

You can key the frames in the Spine editor tool. Add two attachments to the eye slot and then make animations that switches back and forth between them.

 

Thank you. That's exactly what I can't figure out. I see in the example (dragon), that there are different graphics for the wing, but I can't find anyting in Spline to add the keyframes for the slots of the graphics, so I can switch between them. I easily can animate bodyparts with scale and translate but I can't find the "Tool" to switch between graphics / generate the keys for the switch, so one is not shown and the other is.



[TOPIC: post.html]
#7

Reaver

[GLOBAL: userInfoPane.html]
Reaver
  • Enthusiast

  • 87 posts
  • Corona SDK

Now I haven't done this with the editor myself but I think you just key the animation frame as you would with scale and translation while selecting which image should be shown in the panel that shows the slots and bones on the right in the editor.

 

This video should provide useful information. About half way through he shows how eyes are blinking.

http://www.youtube.com/watch?v=xY4m3iNtSUQ#

 

EDIT: Actually this is a better video for it. 



[TOPIC: post.html]
#8

d.mach

[GLOBAL: userInfoPane.html]
d.mach
  • Contributor

  • 971 posts
  • Corona SDK

Thank you Reaver! This is exactly what I was looking for! I really appreciate your help!!! :)

 

Daniela




[topic_controls]
[/topic_controls]