Jump to content

Recommended Posts

The way all of the animations in RPG Maker VX Ace work is by using one big image that has all the frames on it and showing different parts of it depending on what frame you want to show. For Sprites this is done by changing the sprites 'src_rect' value which needs to be set to a 'Rect'. For drawing a bitmap on another bitmap such as is often done in Window objects,  A Bitmap's blt method needs a Rect as well.  A 'Rect' a type of rectangle with x, y, width, and height values. I think the VX Ace help has more info on all this stuff if you look through the 'RGSS Built-in Classes' section. There is lots of info there! To make things simpler, VX Ace pretty much always just divides the width and height of the images into a set x amount of frames, though in theory you could use a list of Rects for each frame and make it use any part of the image you want, or even have each frame be it's own image file though that might cause caching problems.

 

Unfortunately there is no way to import animated gifs, apngs, or other animations or movie files that I know of, as handy as that might be. VX Ace can play movie files, but it's support for them is very very limited and pretty much just makes windows do it for it. I know it's kind of a pain to have to arrange animations in a sheet like RPG Maker likes, but I don't know of any other way around it.

Edited by Kayzee

Share this post


Link to post
Share on other sites

Hi there, :)

So to do an animation I need to create 

  def animateface(actor, x, y, enabled = true)
  bitmap = Cache.picture(actor.name + "_bg")
  rect = Rect.new(0, 0, 640,95)
  self.contents.blt( x, y, bitmap, rect, 255)
  bitmap.dispose
  end


or

blt(x, y, src_bitmap, src_rect, opacity = 255)
  bitmap = Cache.picture(actor.name + "_bg")
  rect = Rect.new(0, 0, 640,95)
  self.contents.blt( x, y, bitmap, rect, 255)
  bitmap.dispose
  end

?? 

follow those steps here? https://www.rubydoc.info/github/cstrahan/open-rpg-maker/Rect

Sorry I am a little lost rigt now

 

Share this post


Link to post
Share on other sites

Uh, the first one? Not sure what you are asking me or what you mean by 'following steps', but the first thing before the or seems like a good start to me as far as drawing images goes. What you need to do is basically add a frame counter and change the rect you are using depending on it. Something like this might work?

 

  def animateface(actor, x, y, enabled = true)
    @facecount = 0 unless @facecount # set the frame counter to 0 if unset
    bitmap = Cache.picture(actor.name + "_bg")
    # You can change these numbers however you want
    frame = (@facecount / 10) % 8 # every 10 times this is called is one frame, out of 8 total.
    rect = Rect.new(0, frame*95, 640,95) # assuming you are laying each frame from top to bottom
    self.contents.blt( x, y, bitmap, rect, 255)
    bitmap.dispose
    @facecount += 1 # add to the counter!
  end

Remember though, if you are going to animate anything in a window you need to refresh it very frame or make it a sprite!

Edited by Kayzee

Share this post


Link to post
Share on other sites

Well if you have any particular question that comes to mind I will try to help you, but somtimes it's tricky to know what questio0ns you should be asking huh? I am sure you can do it if you try, but don't push yourself too hard, okay? *sprinkles fairy dust on you*

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×