LOGIN
SEARCH
PROFILE
keys: ↑ ↓
LOGOUT
INDEX
MEMBERS
keys: ↑ ↓
HOME
PORTAL
PLAY ALONG
PLAY with WORDS
PLAY with GRAPHICS
PLAY with SOUNDS
PLAY with CODES
PLAY with PROJECTS
keys: ← →
Guest Access
Register:
Members:



View previous topic View next topic Go down Message [Page 1 of 1]

Administrator
Administrator
#1 RMXP = NOW PLAYING
Loading

G@MeF@Ce

Administrator
Administrator
Administrator
profile
NOW PLAYING (RMXP)
by G@MeF@Ce 4/1/2012

This script shows the title of the BGM (background music)
Very useful for giving credit to the music makers as their song is playing seamlessly throughout the game instead of giving a shout out after the game in some credits list.

This is an early version I will continue to enhance as I progress.

Script version 1.1
+ background music name

Script version 1.2
+ easy to configure interface module

Script version 1.3
+ case for message option
+ icon graphic
+ case for corner location

Script version 1.4
+ added alignment option for text
+ icon position / window size corrected
Spoiler:
Code:
################################################################################
# ■ ● ○ NOW PLAYING v1.4 for RMXP by G@MeF@Ce 4/1/2012                        #
################################################################################
# credits to MOGhunter and XRXS20 for original map location scripts            #
#                                                                              #
# + background music name                                                      #
# + easy to configure interface module                                        #
# + case for message option                                                    #
# + icon graphic                                                              #
# + case for corner location                                                  #
#                                                                              #
# future version:                                                              #
#                                                                              #
# - disable switch                                                            #
# - picture frame                                                              #
#                                                                              #
################################################################################

###################################(101)########################################

module G101_NOWP

# GENERAL SETTINGS
#-------------------------------------------------------------------------------
NP_NO_MAPS = [5,10] # MAP_ID array that won't NP_OPTION Now Playing

NP_OPTION = 1 #1- BGM name #2- MAP name #3- NP_CUSTOM text
NP_CUSTOM = "enter your customized text here"

NP_LOCATION = 3 #1=top_left, 2=top_right, 3=bot_left, 4=bot_right, 5=center


# WINDOW OPTIONS
#-------------------------------------------------------------------------------
NP_WINDOW_SKIN = "001-Blue01" #name of window skin
NP_OPTION_SKIN = false #show window skin? (true or false)

NP_ICON = "now_play_icon" #name of icon graphic in Icons folder

#window size
NP_WINDOW_WIDTH = 332 #window width
NP_WINDOW_HEIGHT = 40 # window height

#text contents window
NP_TEXT_WINDOW_H = 60 #content window height
NP_TEXT_WINDOW_W = 280 #content window width
NP_TEXT_ALIGN = 3 # 1=center 2=right 3=left
# FONT OPTIONS
#-------------------------------------------------------------------------------
NP_FONT_NAME = "Arial" #font type
NP_FONT_COLOR = Color.new(255, 255, 255, 255) #color black (0,0,0,255)
NP_FONT_SIZE = 20 #font size

NP_FONT_X = 30 #horizontal positioning
NP_FONT_Y = -10 #vertical positioning


#TIMING OPTIONS
TIME_FADEIN = 26 #time for window to appear
TIME_STOP = 200 #time for window to remain visible
TIME_FADEOUT = 24 #time for window to fade away

################################################################################

case NP_LOCATION #screen location presets
#screen location
when 1 #top left
NP_WINDOW_X = 10 #horizontal position
NP_WINDOW_Y = 10 #vertical position
when 2 #top right
NP_WINDOW_X = 320 #horizontal position
NP_WINDOW_Y = 10 #vertical position
when 3 #bottom left
NP_WINDOW_X = 10 #horizontal position
NP_WINDOW_Y = 430 #vertical position
when 4 #bottom right
NP_WINDOW_X = 320 #horizontal position
NP_WINDOW_Y = 430 #vertical position
when 5 #center
NP_WINDOW_X = 180 #horizontal position
NP_WINDOW_Y = 210 #vertical position
end

end
################################################################################

#==============================================================================
# ■ Now_Play_Window
#==============================================================================
class Now_Play_Window < Window_Base
 
  def text_model(text)
    return "~" + text + "~"
  end
 
end
#==============================================================================
# ■ Game Map
#==============================================================================
class Game_Map
  include G101_NOWP
#--------------------------------------------------------------------------
# ○ name
#--------------------------------------------------------------------------

    def np_name
     
      case NP_OPTION
      when 1
      $game_system.playing_bgm.name #working on better method...
      when 2
      data_mapinfos = load_data("Data/MapInfos.rxdata") if $data_mapinfos.nil?
      data_mapinfos[@map_id].name
      when 3
      text = NP_CUSTOM
    end

    end
end
#==============================================================================
# ■ Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ●
#--------------------------------------------------------------------------
      attr_accessor :now_play_fade_duration
end
#==============================================================================
# ■ Game_Map
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# ● for map name
#--------------------------------------------------------------------------
      attr_reader :map_id
end
#==============================================================================
# ■ Now_Playing
#==============================================================================
class Now_Playing < Window_Base
      include G101_NOWP
#--------------------------------------------------------------------------
# ○ initialize
#--------------------------------------------------------------------------
    def initialize(x, y, w, h)
        super(x-16, y-16, w+32, h+32)
        self.opacity = 0
        self.visible = false
        @align = NP_TEXT_ALIGN
    end
#--------------------------------------------------------------------------
# ○ text settings in module
#--------------------------------------------------------------------------
    def set_np_text(text)
     
    if NP_WINDOW_WIDTH == 0
      bitmap = Bitmap.new(1,1)
      bitmap.font.name = NP_FONT_NAME
      bitmap.font.size = NP_FONT_SIZE
      width = bitmap.text_size(text).width + 10
      bitmap.dispose
    else
      width = NP_WINDOW_WIDTH
    end
   
    if self.contents != nil
      self.contents.dispose
    end
      self.width = width + 32
      self.contents = Bitmap.new(width, self.height - 32)
      self.contents.font.name = NP_FONT_NAME
      self.contents.font.color = NP_FONT_COLOR
      self.contents.font.size = NP_FONT_SIZE
      self.contents.font.bold = true
      if text.nil?
      return
      end
#text positioning
      x = NP_FONT_X
      y = NP_FONT_Y
#text content window size
      width = NP_TEXT_WINDOW_W
      height = NP_TEXT_WINDOW_H
#text hemming effect
      text_color = self.contents.font.color.dup
      self.contents.font.color = Color.new( 0, 0, 0, 192)
      self.contents.draw_text(x+2, y+2, width, height, text, @align)
      self.contents.font.color = Color.new( 64, 64, 64, 192)
      self.contents.draw_text(x-1, y-1, width, height, text, @align)
      self.contents.draw_text(x+1, y-1, width, height, text, @align)
      self.contents.draw_text(x-1, y+1, width, height, text, @align)
      self.contents.draw_text(x+1, y+1, width, height, text, @align)
      self.contents.font.color = text_color
      self.contents.draw_text(x, y, width, height, text, @align)
      #icon
      bitmap = RPG::Cache.icon(NP_ICON)
      src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
      self.contents.blt(x-28, y+16, bitmap, src_rect)#icon positioning
      self.z = 9999
    end
    end
#==============================================================================
# □ Now_Play_Window
#==============================================================================
class Now_Play_Window < Window_Base
  include G101_NOWP

  attr_accessor :text
#--------------------------------------------------------------------------
# ○ initialize window
#--------------------------------------------------------------------------
    def initialize
 
    x = NP_WINDOW_X
    y = NP_WINDOW_Y

    w = NP_WINDOW_WIDTH
    h = NP_WINDOW_HEIGHT
 
    super(x,y,w,h)
    self.opacity = 0
    self.visible = false
    self.windowskin = RPG::Cache.windowskin("")
  if NP_WINDOW_SKIN != ""
      skin = (RPG::Cache.windowskin(NP_WINDOW_SKIN) rescue nil)
      self.windowskin = skin unless skin.nil?
  end
      @np_space = Now_Playing.new(self.x, self.y, self.width, self.height)
  end
#--------------------------------------------------------------------------
# ○ set text
#--------------------------------------------------------------------------
  def set_np_text(text)
    if text.nil? or text.empty? or text =~ /^\./
      @NP_OPTIONing_time = -1
      @text = ""
      @np_space.set_np_text(@text)
      $game_temp.now_play_fade_duration = -1
      else
      @text = text_model(text)
      @np_space.set_np_text(@text)
      if NP_WINDOW_WIDTH == 0
      self.width = @np_space.width - 16
      else
      self.width = NP_WINDOW_WIDTH
      end
    end
  self.visible = false
  @np_space.visible = false
  fade_flow
end
#--------------------------------------------------------------------------
# ○ sliding and fading window
#--------------------------------------------------------------------------
def fade_flow

  if $game_temp.now_play_fade_duration.nil?
  $game_temp.now_play_fade_duration = (TIME_FADEIN + TIME_STOP + TIME_FADEOUT)
  end

      d = $game_temp.now_play_fade_duration - (TIME_STOP + TIME_FADEOUT)
     
  if d > 0
  self.visible = NP_OPTION_SKIN
  @np_space.visible = true
  amount = ((TIME_FADEIN - d) * 255.0 / TIME_FADEIN).ceil
  @np_space.contents_opacity = amount
  self.opacity = [amount*5/8, 160].min
  self.x = NP_WINDOW_X - d
  @np_space.x = self.x - 16
  $game_temp.now_play_fade_duration -= 1
  elsif ($game_temp.now_play_fade_duration > TIME_FADEOUT) or
  ($game_temp.now_play_fade_duration == 0 and TIME_FADEOUT == 0)
  self.visible = NP_OPTION_SKIN
  @np_space.visible = true
  @np_space.contents_opacity = 255
  self.opacity = 160
  self.x = NP_WINDOW_X
  @np_space.x = self.x - 16
  if $game_temp.now_play_fade_duration > 0
  $game_temp.now_play_fade_duration -= 1
  end
  elsif $game_temp.now_play_fade_duration > 0
  self.visible = NP_OPTION_SKIN
  @np_space.visible = true
  amount = ($game_temp.now_play_fade_duration * 255.0 / TIME_FADEOUT).ceil
  @np_space.contents_opacity = amount
  self.opacity = amount * 5/8
  self.x = (NP_WINDOW_X + TIME_FADEOUT) - $game_temp.now_play_fade_duration
  @np_space.x = self.x - 16
  $game_temp.now_play_fade_duration -= 1
  if $game_temp.now_play_fade_duration == 0
  self.visible = false
  @np_space.visible = false
  end
 end
end
#--------------------------------------------------------------------------
# ○ update
#--------------------------------------------------------------------------
    def update
    fade_flow
    super
    end
#--------------------------------------------------------------------------
# ○ dispose
#--------------------------------------------------------------------------
    def dispose
    @np_space.dispose
    super
    end
#--------------------------------------------------------------------------
# ○ visible
#--------------------------------------------------------------------------
    def visible=(b)
      @np_space.visible = b unless @np_space.nil?
      super
    end
end

#==============================================================================
# ■ Scene_Map (101 comments for Scene_Map)
#==============================================================================
class Scene_Map #class
  include G101_NOWP #include module
#--------------------------------------------------------------------------
# ● Main
#--------------------------------------------------------------------------
  alias nplay_main main #scene_map alias for main method
    def main #define main method
     
    @nplay_window = Now_Play_Window.new #calls scene
    np_name = NP_NO_MAPS.include?($game_map.map_id) ? nil : $game_map.np_name
    @nplay_window.set_np_text(np_name) #calls window with text
   
    nplay_main #alias method
    @nplay_window.dispose #clear window and text
   
    end #end of definition
#--------------------------------------------------------------------------
# ● update
#--------------------------------------------------------------------------
  alias nplay_update update #scene_map alias for update
      def update #define update method
      @nplay_window.update #updates main method
      nplay_update #alias method
      end #end of definition
#--------------------------------------------------------------------------
# ● transfer player
#--------------------------------------------------------------------------
alias nplay_transfer_player transfer_player #scene_map alias for transfer_player
      def transfer_player #define transfer player method
          @nplay_window.visible = false #window no longer visible
          nplay_transfer_player #alias method
          $game_temp.now_play_fade_duration = nil #fade equals nothing
          np_name = NP_NO_MAPS.include?($game_map.map_id) ? nil : $game_map.np_name
          @nplay_window.set_np_text(np_name) #calls window with text
         
      end #end of definition
    end #end of class

Future versions:

- disable switch
- picture frame

RPG Maker XP Instructions:

F11 - script database
copy and paste this script above Main

pick an icon graphic and copy it to the Icon folder




You can also check out the demo! ^,^

New demo version!!!

Now Playing v1.4

+added 102E driver (for those who don't have RMXP)
+added coffee shop
+added dance club

^ both badly needs a proper tileset :~P

I'm more than certain that there's bugz n compatabilty issues geek

it's just another work in progress...
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr http://www.youtube.com/user/MrGameface101?feature=watch
Touched by Putin
Touched by Putin
#2 Re: RMXP = NOW PLAYING
Loading

Onesimus

Touched by Putin
Touched by Putin
profile
Pretty cool ^
Touched by Putin
Show Signature


On Gameface nobody can hear you scream.

That function is still in development.
Touched by Putin
Poster Mcposty
Poster Mcposty
#3 Re: RMXP = NOW PLAYING
Loading

MotionM

Poster Mcposty
Poster Mcposty
Poster Mcposty
profile
Looks good. I loved the tileset and ho you used Midi's/ Very Happy
Some of the tilesets weren't set to "unpassable" though.
Poster Mcposty
Show Signature



^Want the above userbar in your profile? Here's the code.
Code:
 [img]http://img718.imageshack.us/img718/7481/gfuserbar.jpg[/img][/URL]



View my blog, http://motionmreview.blogspot.com/

Want a certain music album or game reviewed? Send me an Email at MotionM@hotmail.com!

: MShinigaki
Add me for some League of Legends fun!
Poster Mcposty
https://www.dropbox.com/sh/l3s9sn0nmkaxmy7/Lrut_zZyWd http://motionmreview.blogspot.com/ https://twitter.com/_motionm
Administrator
Administrator
#4 Re: RMXP = NOW PLAYING
Loading

G@MeF@Ce

Administrator
Administrator
Administrator
profile
new demo version - a few passable, transfer, and misplaced tile fixes.

+ added a case option for easy positioning, pick a corner or center presets.

+ added graphic icon
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr http://www.youtube.com/user/MrGameface101?feature=watch
Administrator
Administrator
#5 Re: RMXP = NOW PLAYING
Loading

G@MeF@Ce

Administrator
Administrator
Administrator
profile
original post updated with instructions,new script version, and new demo.

script:
+text alignment option
+window size and icon position corrected

demo:
temp dance club and coffee shop :~P

more jamz
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr http://www.youtube.com/user/MrGameface101?feature=watch
#6 Re: RMXP = NOW PLAYING
Loading

Sponsored content

profile

View previous topic View next topic Back to top Message [Page 1 of 1]

 

Chatbox system disabled
Personal messaging disabled