The RPG Maker Resource Kit

RMRK RPG Maker Creation => VX => VX Scripts Database => Topic started by: worale on February 22, 2008, 03:33:25 AM

Title: +[Quick Face Border]+
Post by: worale on February 22, 2008, 03:33:25 AM
Quick Face Border
Version 1.5
by Woratana
Release Date: 22/02/2008


Introduction
 This script will add the border on Face,

The border will create from window skin you choose  ;)


Features
Version 1.5
- Edited Window_Message Bug
- You can use custom image for border

Version 1.0
- Add border on face
- Choose window skin you want for face's border
- Choose the window you want to use face border


Screenshot
Version 1.5
Spoiler for:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fworatana.fileave.com%2Ffacborcustom.jpg&hash=c3b5a47a5fafeaf2067039c9d9ad1fd6f0596324)
Custom image border!
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fworatana.fileave.com%2Fborderpic.png&hash=e282b98ba1a3fc1d1cd85b832a627e55774a22ea)
The border image I use in screenshot~
Version 1.0
Spoiler for:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fworatana.fileave.com%2Ffacebor1.jpg&hash=db2a39f7cc3f84b47cf19d89d37095735f556179)

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fworatana.fileave.com%2Ffacebor2.jpg&hash=606c7e517e7d55533818b27871cd10fe669aded0)

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fworatana.fileave.com%2Ffacebor3.jpg&hash=9a17f51ebdd37b084785f9c28188c7d7021f8e11)

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fworatana.fileave.com%2Ffacebor4.jpg&hash=86df959321824a4fa4c63751071b0f21db4abc17)

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fworatana.fileave.com%2Ffacebor5.jpg&hash=086f60030dbc64394c4b745d6c69ee64944313b5)


Script
Place it above main.
Spoiler for:
Code: [Select]
#============================================================
# ? [VX] ? Quick Face Border ?
#------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released Date: 23/02/2008
#------------------------------------------------------------
# Version 1.5
# - Edited Window_Message Bug
# - You can use custom image for border
#------------------------------------------------------------
class Window_Base < Window
  #------------------------------
  # START SETUP SCRIPT
  #---------------------------
  BORDER_MODE = 0 # Choose Border Mode (0: Use Windowskin, 1:Use Image)
  BORDER_SKIN = "Window" # Name of Window Skin for Border (Mode 0)
  BORDER_IMAGE = "borderpic" # Custom Image for Border (Mode 1)
  # Custom image must be in folder "Graphics/Pictures" and size 96 x 96 pixel
 
  BORDER_OPACITY = 255 # Face Border's Opacity (0 - 255)
 
  # (true/false)
  USE_BORDER_IN_MENU = true
  USE_BORDER_IN_MESSAGE = true
  USE_BORDER_IN_STATUS_WINDOW = true
  USE_BORDER_IN_NAME_WINDOW = true
  #------------------------------
  # END SETUP SCRIPT
  #---------------------------
  alias wor_facbor_winbas_ini initialize
  alias wor_facbor_winbas_dis dispose
  alias wor_facbor_winbas_draf draw_face
 
  def initialize(x, y, width, height)
wor_facbor_winbas_ini(x, y, width, height)
@border = Array.new
  end

  def dispose
delete_border if @border != []
wor_facbor_winbas_dis
  end
 
  def draw_face(face_name, face_index, x, y, size = 96)
if ($scene.is_a?(Scene_Menu) and USE_BORDER_IN_MENU) or ($scene.is_a?(Scene_Map) and USE_BORDER_IN_MESSAGE) or ($scene.is_a?(Scene_Status) and USE_BORDER_IN_STATUS_WINDOW) or ($scene.is_a?(Scene_Name) and USE_BORDER_IN_NAME_WINDOW)
  if BORDER_MODE == 0
@border.push Window_Border.new(self.x + x + 16,self.y + y + 16,96,96)
  elsif BORDER_MODE == 1
id = @border.size
@border[id] = Sprite.new
@border[id].bitmap = Cache.picture(BORDER_IMAGE)
@border[id].x = self.x + x + 16
@border[id].y = self.y + y + 16
@border[id].z = 500
end
end
wor_facbor_winbas_draf(face_name, face_index, x, y, size)
  end
 
  def delete_border
  for i in 0..(@border.size - 1)
if BORDER_MODE == 0 and !@border[i].nil?
  @border[i].dispose
elsif BORDER_MODE == 1 and !@border[i].nil?
  @border[i].bitmap.dispose
  @border[i].dispose
end
  end
  @border = []
  end
 
end

  $worale = {} if !$worale
  $worale["FaceBorder"] = true
 
class Window_Border < Window_Base
 
  def initialize(x,y,width,height)
super(x,y,width,height)
self.windowskin = Cache.system(BORDER_SKIN)
self.opacity = BORDER_OPACITY
self.back_opacity = 0
self.z = 500
  end
 
end

class Window_Message < Window_Selectable
  alias wor_facbot_winmsg_upd update
  def update
wor_facbot_winmsg_upd
  if @closing and @border != []
delete_border
  end
  end
end

Instruction

Setup script here:

Code: [Select]
  #------------------------------
  # START SETUP SCRIPT
  #---------------------------
  BORDER_MODE = 0 # Choose Border Mode (0: Use Windowskin, 1:Use Image)
  BORDER_SKIN = "Window" # Name of Window Skin for Border (Mode 0)
  BORDER_IMAGE = "borderpic" # Custom Image for Border (Mode 1)
  # Custom image must be in folder "Graphics/Pictures" and size 96 x 96 pixel
 
  BORDER_OPACITY = 255 # Face Border's Opacity (0 - 255)
 
  # (true/false)
  USE_BORDER_IN_MENU = true
  USE_BORDER_IN_MESSAGE = true
  USE_BORDER_IN_STATUS_WINDOW = true
  USE_BORDER_IN_NAME_WINDOW = true
  #------------------------------
  # END SETUP SCRIPT
  #---------------------------

Author's Notes
Free for use in your non-commercial work if credit included. If your project is commercial, please contact me.

Please do not redistribute this script without permission. If you want to post it on any forum, please link to this topic.
Title: Re: +[Quick Face Border]+
Post by: modern algebra on February 22, 2008, 04:16:21 AM
That looks pretty neat. Nice Idea
Title: Re: +[Quick Face Border]+
Post by: worale on February 22, 2008, 07:01:42 PM
UPDATED to version 1.5!

- Edited Window_Message Bug
- You can use custom image for border

Screenshot:
Spoiler for:
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fworatana.fileave.com%2Ffacborcustom.jpg&hash=c3b5a47a5fafeaf2067039c9d9ad1fd6f0596324)

(https://rmrk.net/proxy.php?request=http%3A%2F%2Fworatana.fileave.com%2Fborderpic.png&hash=e282b98ba1a3fc1d1cd85b832a627e55774a22ea)

Script is in first post :)
Title: Errrrr........
Post by: jick6 on October 06, 2008, 11:52:55 PM
Yeah it works but the only problem is if you have a choice (Yes, No thing) the face border still appears.
Lol can u fix this?