RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[Snippet] Animation Bug Fixed~

0 Members and 2 Guests are viewing this topic.

**
Rep:
Level 86
Animation Bug Fixed
by Woratana
Release Date: 21/05/2008


Introduction
I'm not sure how many people noticed that...

when you show animation on character,
and you move in the map that bigger than 17 x 13 which cause map to scroll.
The animation will move with the screen, instead of stay on character.

So I scripted this one to fixed it~


Screenshots
No need...


Script
Place it above main

Code: [Select]
#=========================================================================
# ? ? [VX] Animation Bug Fixed ? ? by Woratana (21/05/2008)
# * Fixed bug that animation will follow screen, not stay on character~ *
# * You can place this script in any slot below the slot 'Sprite_Base'
#-------------------------------------------------------------------------
class Sprite_Base < Sprite
  alias wora_bugfix_sprbas_upd update
  def update
if !@animation.nil?
  if @animation.position == 3
if viewport == nil
  @animation_ox = Graphics.width / 2
  @animation_oy = Graphics.height / 2
else
  @animation_ox = viewport.rect.width / 2
  @animation_oy = viewport.rect.height / 2
end
  else
@animation_ox = x - ox + width / 2
@animation_oy = y - oy + height / 2
if @animation.position == 0
  @animation_oy -= height / 2
elsif @animation.position == 2
  @animation_oy += height / 2
end
  end
end
wora_bugfix_sprbas_upd
  end
end


Instruction
You can place this script in any slot below the slot 'Sprite_Base'  ;)


Author's Notes
Free for use in your work~

*
Rep: +0/-0Level 64
RMRK Junior
Sorry for necroposting, but I only have to say it works well. That was exactly what I was looking for.
I've got a lot of animations combined with screen moving events and now You fixed my problem - following-on-screen animatons;)
Thx m8 :)