Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Animate Charsets ( Sprites ) in a Window_Class

Hi @all

just a little Question...
Ich want to show some charsets in a window_Class...
But i need them to be able to animate in a direction choosen by me..

any ideas???
 
I really don?t want to use scripts like that. It?s because i can?t script with them like i wat, wthout making mistakes ( im not a pro in scipting.. just.. advanced )
Or if i say it the easy way.. i don?t check this MaCL... XD


So,
is there a standard RGSS function?
 
It's a simple function really to draw animated sprites with the function I put in the MACL.

Code:
class Window_Yours < Window_Base
  # initialize code here
  def refresh
    # code here
    self.contents.draw_anim_sprite(x, y, w, h, name, hue, stance = 0)
    # code here
  end
  def update
    # code here
    if Graphics.frame_count % self.contents.anim_sprite_settings['f'] == 0
      self.contents.draw_anim_sprite(x, y, w, h, name, hue, stance = 0)
    end
    # code here
  end
end

Replace the x, y, width and height with the rect area you want the sprite to be displayed on. Replace name and hue with the character file data, and stance with 0 - 3, depending on which stance you wish to display.
 
ok.. that works.. but.. how i?m able to change the direction???

It?s for a TBKS... on the lower Screenside are the heroes.. and on the upper the enemies.. the heros must look up.. the enemies down..
 
ok..got it..

Last Question now ^^

I use the Animation Script from Trickster
i call my Animation like that:
Code:
$animations.push(Animation.new('event',$attacken_id,[0,0],$game_party.actors[$ident - 1].animation1_id)) #Angriff
$ident = ID of a hero
$attack_id = target ID

now my question is:
How i?m able to save the framecount of the animation into an array???

I need it fro timing... Because i don?t want two or more animations to be overlapped.. but shown directly after the one before..
so i need the frames + a count..
Code:
if count_new = count_old + animation-frames
  Next animation playing
end

like that...
i just need the frames.. i coded a counter by myself..
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top