Tough luck: it's not a sprite but a window so the method to draw the flipped graphic will indeed be the slow one. So I'll give you two options: flipping with script (slow) or switching to another file flipped with an image editing program.
In the first code MGC gave you (Window_Portrait), modify the refresh method like this:
CODE
#-----------------------------------------------------------------------------
# * Refresh
#-----------------------------------------------------------------------------
def refresh(actor, flip = false)
self.contents.clear
draw_actor_face_graphic(actor, 0, 0, flip)
end
Then modify draw_actor_face_graphic like this:
CODE
#-----------------------------------------------------------------------------
# * Draw Actor Graphic
#-----------------------------------------------------------------------------
def draw_actor_face_graphic(actor, x, y, flip)
bitmap = RPG::Cache.picture(actor.id.to_s)
flipped_bitmap = Bitmap.new(bitmap.width, bitmap.height)
rect = Rect.new(0, 0, 1, height)
if flip
bitmap.width.times do |i|
rect.x = bitmap.width - 1 - i
flipped.blt(i, 0, bitmap, flip_rect)
end
self.contents.blt(x, y, bitmap, Rect.new(0, 0, flipped.width, flipped.height))
else
self.contents.blt(x, y, bitmap, Rect.new(0, 0, flipped.width, flipped.height))
end
end
Now, in the 3rd piece of code MGC gave you, look at this:
CODE
# refresh the portrait
@window_portrait.visible = true
@window_portrait.refresh(@active_battler)
Setup the conditions for the flip (I don't know what they are so I can't do it) and to activate it, simply replace
@window_portrait.refresh(@active_battler) with
@window_portrait.refresh(@active_battler, true) and this is it.
In the event you want to use flipped pictures rather than flipping them with the script (and you should), use the same syntax than before for your file and simply add
_flipped at the end. Then, modify draw_actor_face_graphic like this:
CODE
#-----------------------------------------------------------------------------
# * Draw Actor Graphic
#-----------------------------------------------------------------------------
def draw_actor_face_graphic(actor, x, y, flip)
bitmap = RPG::Cache.picture(actor.id.to_s + '_flipped')
self.contents.blt(x, y, bitmap, Rect.new(0, 0, flipped.width, flipped.height))
end