So first I put in the self.zoom in the update of sprite_battler (see bottom of code):
def update
super
# If battler is nil
if @battler == nil
self.bitmap = nil
loop_animation(nil)
return
end
# If file name or hue are different than current ones
if @battler.battler_name != @battler_name or
@battler.battler_hue != @battler_hue
# Get and set bitmap
@battler_name = @battler.battler_name
@battler_hue = @battler.battler_hue
self.bitmap = RPG::Cache.battler(@battler_name, @battler_hue)
@width = bitmap.width
@height = bitmap.height
self.ox = @width / 2
self.oy = @height
if @battler.is_a?(Game_Enemy)
self.zoom_x = @battler.zoom_x
end
then I've got the attr_accessor and @zoom_x = zoom_x in Game Enemy:
class Game_Enemy < Game_Battler
attr_accessor :coz_moving_x # x coordinate
attr_accessor :coz_moving_y # y coordinate
attr_accessor :zoom_x # x zoom
#--------------------------------------------------------------------------
# * Object Initialization
# troop_id : troop ID
# member_index : troop member index
#--------------------------------------------------------------------------
def initialize(troop_id, member_index)
super()
@troop_id = troop_id
@member_index = member_index
troop = $data_troops[@troop_id]
@enemy_id = troop.members[@member_index].enemy_id
enemy = $data_enemies[@enemy_id]
@battler_name = enemy.battler_name
@battler_hue = enemy.battler_hue
@hp = maxhp
@sp = maxsp
@hidden = troop.members[@member_index].hidden
@immortal = troop.members[@member_index].immortal
@coz_moving_x = 0
@coz_moving_y = 0
@zoom_x = zoom_x
end
and finally I'm trying to call it as simple as possible here in def screen_x of Game_Enemy:
def screen_x
@zoom_x = 20
Nothing happens. Clearly I'm doing something wrong.