RPGVX.net

  RPG-Maker VX => VX Skripte [Fertiger Code] => Thema gestartet von: woratana am Februar 22, 2008, 16:58:39

Titel: +[Quick Face Border]+
Beitrag von: woratana am Februar 22, 2008, 16:58:39
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
(http://woratana.fileave.com/facborcustom.jpg)
Custom image border!
(http://woratana.fileave.com/borderpic.png)
The border image I use in screenshot~
Version 1.0
(http://woratana.fileave.com/facebor1.jpg)

(http://woratana.fileave.com/facebor2.jpg)

(http://woratana.fileave.com/facebor3.jpg)

(http://woratana.fileave.com/facebor4.jpg)

(http://woratana.fileave.com/facebor5.jpg)
Yep, Yatzumo's edited windowskin  :lol:


Script
Place it above main.
#============================================================
# ? [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:

  #------------------------------
  # 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.
Titel: +[Quick Face Border]+
Beitrag von: Snake am Februar 22, 2008, 17:36:33
Yay thats a very useful script^^
It saves so much time xD
Thx^^
Titel: +[Quick Face Border]+
Beitrag von: ERZENGEL am Februar 22, 2008, 17:42:59
That's a cool effect. When I start my project I will use it!
Titel: +[Quick Face Border]+
Beitrag von: woratana am Februar 22, 2008, 19:51:46
Thanks for telling me the bug! :)

UPDATED to version 1.5!

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

Screenshot:
(http://woratana.fileave.com/facborcustom.jpg)

(http://woratana.fileave.com/borderpic.png)

Script is in first post :)
Titel: +[Quick Face Border]+
Beitrag von: Yatzumo am Februar 22, 2008, 21:44:35
Very Very NICE woratana!
I like it so much. :D
And again: small but very good. :D

Thanks for it, I'll use it to!

MFG Yatzumo
Titel: +[Quick Face Border]+
Beitrag von: Goldenboss am Februar 22, 2008, 22:11:47
Hi woratana,

i am sure, that this will be a great script.
When I found a nice border i'll use it of course.

Sincerely, Markus.
Titel: +[Quick Face Border]+
Beitrag von: Dainreth am Februar 23, 2008, 11:43:17
Nice, I like this script. I haven't test it yet, but looks really nice. Thanks!
Titel: +[Quick Face Border]+
Beitrag von: $@$uk€ am März 02, 2008, 15:24:42
I like this Script... But the position of the border isn't the best.

Your position uses this coordinates
        @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

But this here are much better for the face pictures, because it takes the whole picture in
        @border.push Window_Border.new(self.x + x + 14,self.y + y + 14,100,100)
      elsif BORDER_MODE == 1
        id = @border.size
        @border[id] = Sprite.new
        @border[id].bitmap = Cache.picture(BORDER_IMAGE)
        @border[id].x = self.x + x + 14
        @border[id].y = self.y + y + 14


(my english isn't very good, but i hope you know what i wanna say^^)
Titel: +[Quick Face Border]+
Beitrag von: woratana am März 02, 2008, 20:04:44
That's what I'm working on! lol

I use this though,

        @border.push Window_Border.new(self.x + x + 15,self.y + y + 14,98,98)
      elsif BORDER_MODE == 1
        id = @border.size
        @border[id] = Sprite.new
        @border[id].bitmap = Cache.picture(BORDER_IMAGE)
        @border[id].x = self.x + x + 15
        @border[id].y = self.y + y + 15

Save 2 px :)

Thanks for suggestion~ :PYou English is not bad
Titel: +[Quick Face Border]+
Beitrag von: Evil95 am April 26, 2008, 17:29:01
if I open the menu the border come a few seconds earlier. also you can see the border before the menu is open. can you fix it?

PS: sry for my bad englisch^^
Titel: +[Quick Face Border]+
Beitrag von: woratana am April 26, 2008, 18:46:32
I can do that if I know exactly how long is delay :)
Titel: +[Quick Face Border]+
Beitrag von: Evil95 am April 26, 2008, 18:48:52
what is delay? PS: i use the MOG Menu Plus script.

EDIT: I've found a bug. look at the picture
(http://img155.imageshack.us/img155/6250/borderij7.th.png) (http://img155.imageshack.us/my.php?image=borderij7.png)
SimplePortal 2.3.3 © 2008-2010, SimplePortal