Chucksaint 2 Report post Posted February 9 (edited) Hello,here I am again lol I would like to know how to make animations with images ( frames?) thank you Edited February 9 by Chucksaint Share this post Link to post Share on other sites
Kayzee 2,332 Report post Posted Tuesday at 05:54 PM (edited) 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 Tuesday at 05:59 PM by Kayzee Share this post Link to post Share on other sites
Chucksaint 2 Report post Posted Tuesday at 06:20 PM 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
Kayzee 2,332 Report post Posted Tuesday at 06:54 PM (edited) 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 Tuesday at 06:56 PM by Kayzee Share this post Link to post Share on other sites
Chucksaint 2 Report post Posted Tuesday at 08:14 PM (edited) Well I am really above my head, i still can't understand it . Guess I will study RGss3 sorry Edited Tuesday at 08:43 PM by Chucksaint Share this post Link to post Share on other sites
Kayzee 2,332 Report post Posted Thursday at 01:49 AM 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