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:



Go to page : 1, 2  Next

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

Administrator
Administrator
#1 RMXP/RMVX Font Shadow Empty RMXP/RMVX Font Shadow
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
Hey guys, been polishing up the Super Mockup Brothers starter kit
(which should be released in a few days Very Happy)
Trying to get the HUD like the original,
I found it hard to see ~ so I did a little research
and ended up making a super simple Font Shadow script!
It's plug and play easy to configure and makes the default
text look nice.

edit: ~> now with "random color option"

^,^ thanks to LiTTleDRAgo for the idea

Spoiler:

Thought I would share with everyone.

plug n play, easy to use ~

RMXP Font Shadow v1.3
Code:
################################################################################
# ■ Super Simple Font Shadow v1.3 by g@Mef@Ce 7/6/2011  www.gameface101.com                            #
################################################################################

#==============================================================================
# ● Customization
#==============================================================================
module G101_FS
#font_shadow horizontal position
FS_X = 2
#font_shadow verticle position
FS_Y = 2
#font_shadow color options
# 1 = black
# 2 = white
# 3 = grey
# 4 = red
# 5 = green
# 6 = blue
# 7 = purple
# 8 = orange
# 9 = brown
#10 = pink
#11 = random
$fs_color = 11
#end of module
end
#==============================================================================
# ■ Bitmap
#==============================================================================
class Bitmap
#use constants in module 
include G101_FS
#prevent reset over flow
unless @font_shadow == true
  alias draw_shadow draw_text
  @font_shadow = true
#end unless
end
#==============================================================================
# ● define draw_text method
#==============================================================================
def draw_text(fsx = 0, fsy = 0, fsw = 0, fsh = 0, fss = 0, fsa = 0)
#if draw_text is being used for a rectangle bitmap
  if fsx.is_a?(Rect)
    x = fsx.x
    y = fsx.y
    width = fsx.width
    height = fsx.height   
    string = fsy
    align = fsw
  else
#set variables for arguments
    x = fsx
    y = fsy
    width = fsw
    height = fsh
    string = fss
    align = fsa
  end
#duplicate font color
  @shade = self.font.color.dup
#set font color in module
case ($fs_color)
when 1 #black
  self.font.color = Color.new(0, 0, 0, 200)
when 2 #white
  self.font.color = Color.new(255, 255, 255, 200)
when 3 #grey
  self.font.color = Color.new(130, 130, 130, 200)
when 4 #red
  self.font.color = Color.new(255, 0, 0, 200)
when 5 #green
  self.font.color = Color.new(0, 255, 0, 200)
when 6 #blue
  self.font.color = Color.new(0, 0, 255, 200)
when 7 #purple
  self.font.color = Color.new(160, 32, 240, 200)
when 8 #orange
  self.font.color = Color.new(255, 165, 0, 200)
when 9 #brown
  self.font.color = Color.new(160, 82, 45, 200)
when 10 #pink
  self.font.color = Color.new(255, 192, 203, 200)
when 11 #random
fsr = rand(200) + 55
fsg = rand(200) + 55
fsb = rand(200) + 55
  self.font.color = Color.new(fsr, fsg, fsb, 200)
# to be continued...?
end
#draw shadow with indent
  draw_shadow(x + FS_X, y + FS_Y, width, height, string, align)
#duplicate font color
  self.font.color = @shade
#draw shadow
  draw_shadow(x, y, width, height, string, align)
#end of draw text method
end
#end of Bitmap class
end
#end of script ^,^
Administrator
Show Signature
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 https://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#2 RMXP/RMVX Font Shadow Empty Re: RMXP/RMVX Font Shadow
Loading

LiTTleDRAgo

LiTTleDRAgo
Active Member
Active Member
Active Member
profile
that's look nice
could you make glowing text too?
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Administrator
Administrator
#3 RMXP/RMVX Font Shadow Empty Re: RMXP/RMVX Font Shadow
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
sure! ~ script has been updated in the original post.
option 11 = "random color" ~ for text that updates every frame,
it will look glowing ~ party on! ^,^
(maybe a new glowing text script, hmm...)

btw - I'm using your multi_treasure_info for points to appear
above the player when points (gold) are added.

~ trying to figure out the positioning
Administrator
Show Signature
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 https://www.youtube.com/user/MrGameface101?feature=watch
||||||||||
||||||||||
#4 RMXP/RMVX Font Shadow Empty Re: RMXP/RMVX Font Shadow
Loading

supercow

supercow
||||||||||
||||||||||
profile
this is nice Razz
the option 11 fits for fun games like circus Cool or some dream/fantasy theme.
at first i thought by glowing it would be "really" glowing Laughing
anyway,can you tell me how to change the option in game? so i can change the option when i want Smile
||||||||||
Show Signature
||||||||||
Administrator
Administrator
#5 RMXP/RMVX Font Shadow Empty Re: RMXP/RMVX Font Shadow
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
to have that glowing effect, you need to have the text update every frame.

here's an example: use Q-toggle on/off F9:for debug
Code:
#================================================
# Glowing Text on Scene Map Example by g@Mef@Ce
#================================================

#================================================
# Class
#================================================
class Glowing_TEXT < Window_Base
#================================================
# Init
#================================================ 
  def initialize
    super(200, 0, 260, 80)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    refresh # <=
  end
#================================================
# Glowing Text on Scene Map Example by g@Mef@Ce
#================================================
  def refresh
    self.contents.clear
    self.contents.font.name = "Impact"
    self.contents.font.color = normal_color
    self.contents.font.size = 60
    self.contents.draw_text(0, -20, 260, 80, $game_party.actors[0].name, 0)
  end
#================================================
# Update
#================================================ 
  def update
    super # <=
    #if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh # <=
    #end
  end
end

#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
#  here's where it gets tricky
#==============================================================================

class Scene_Map
  alias glow_text_main main
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make TEXT window
    @glow_text_window = Glowing_TEXT.new
    # Make sprite set
    @spriteset = Spriteset_Map.new
    # Make message window
    @message_window = Window_Message.new
    # Transition run
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of sprite set
    @spriteset.dispose
    # Dispose of message window
    @message_window.dispose
    # Dispose of HUD window
    @glow_text_window.dispose
    # If switching to title screen
    if $scene.is_a?(Scene_Title)
      # Fade out screen
      Graphics.transition
      Graphics.freeze
      glow_text_main
    end
  end
 
  alias glow_text_update update
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Loop
    loop do
      # Update map, interpreter, and player order
      # (this update order is important for when conditions are fulfilled
      # to run any event, and the player isn't provided the opportunity to
      # move in an instant)
      $game_map.update
      $game_system.map_interpreter.update
      $game_player.update
      # Update system (timer), screen
      $game_system.update
      $game_screen.update
      # Abort loop if player isn't place moving
      unless $game_temp.player_transferring
        break
      end
      # Run place move
      transfer_player
      # Abort loop if transition processing
      if $game_temp.transition_processing
        break
      end
    end
    # Update sprite set
    @spriteset.update
    # Update message window
    @message_window.update
    # Update HUD window
    @glow_text_window.refresh
    # If L (Default Q) button is pressed
      if Input.trigger?(Input::L) and @glow_text_window.visible == true
        @glow_text_window.visible = false
        return
      end
      if Input.trigger?(Input::L) and @glow_text_window.visible != true
        @glow_text_window.visible = true
        return
      end
    # If game over
    if $game_temp.gameover
      # Switch to game over screen
      $scene = Scene_Gameover.new
      return
    end
    # If returning to title screen
    if $game_temp.to_title
      # Change to title screen
      $scene = Scene_Title.new
      return
    end
    # If transition processing
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    # If showing message window
    if $game_temp.message_window_showing
      return
    end
    # If encounter list isn't empty, and encounter count is 0
    if $game_player.encounter_count == 0 and $game_map.encounter_list != []
      # If event is running or encounter is not forbidden
      unless $game_system.map_interpreter.running? or
            $game_system.encounter_disabled
        # Confirm troop
        n = rand($game_map.encounter_list.size)
        troop_id = $game_map.encounter_list[n]
        # If troop is valid
        if $data_troops[troop_id] != nil
          # Set battle calling flag
          $game_temp.battle_calling = true
          $game_temp.battle_troop_id = troop_id
          $game_temp.battle_can_escape = true
          $game_temp.battle_can_lose = false
          $game_temp.battle_proc = nil
        end
      end
    end
    # If B button was pressed
    if Input.trigger?(Input::B)
      # If event is running, or menu is not forbidden
      unless $game_system.map_interpreter.running? or
            $game_system.menu_disabled
        # Set menu calling flag or beep flag
        $game_temp.menu_calling = true
        $game_temp.menu_beep = true
      end
    end
    # If debug mode is ON and F9 key was pressed
    if $DEBUG and Input.press?(Input::F9)
      # Set debug calling flag
      $game_temp.debug_calling = true
    end
    # If player is not moving
    unless $game_player.moving?
      # Run calling of each screen
      if $game_temp.battle_calling
        call_battle
      elsif $game_temp.shop_calling
        call_shop
      elsif $game_temp.name_calling
        call_name
      elsif $game_temp.menu_calling
        call_menu
      elsif $game_temp.save_calling
        call_save
      elsif $game_temp.debug_calling
        call_debug
      end
    end
    glow_text_update
  end
  #--------------------------------------------------------------------------
  # * Battle Call
  #--------------------------------------------------------------------------
  def call_battle
    # Clear battle calling flag
    $game_temp.battle_calling = false
    # Clear menu calling flag
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    # Make encounter count
    $game_player.make_encounter_count
    # Memorize map BGM and stop BGM
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    # Play battle start SE
    $game_system.se_play($data_system.battle_start_se)
    # Play battle BGM
    $game_system.bgm_play($game_system.battle_bgm)
    # Straighten player position
    $game_player.straighten
    # Switch to battle screen
    $scene = Scene_Battle.new
  end
  #--------------------------------------------------------------------------
  # * Shop Call
  #--------------------------------------------------------------------------
  def call_shop
    # Clear shop call flag
    $game_temp.shop_calling = false
    # Straighten player position
    $game_player.straighten
    # Switch to shop screen
    $scene = Scene_Shop.new
  end
  #--------------------------------------------------------------------------
  # * Name Input Call
  #--------------------------------------------------------------------------
  def call_name
    # Clear name input call flag
    $game_temp.name_calling = false
    # Straighten player position
    $game_player.straighten
    # Switch to name input screen
    $scene = Scene_Name.new
  end
  #--------------------------------------------------------------------------
  # * Menu Call
  #--------------------------------------------------------------------------
  def call_menu
    # Clear menu call flag
    $game_temp.menu_calling = false
    # If menu beep flag is set
    if $game_temp.menu_beep
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Clear menu beep flag
      $game_temp.menu_beep = false
    end
    # Straighten player position
    $game_player.straighten
    # Switch to menu screen
    $scene = Scene_Menu.new
  end
  #--------------------------------------------------------------------------
  # * Save Call
  #--------------------------------------------------------------------------
  def call_save
    # Straighten player position
    $game_player.straighten
    # Switch to save screen
    $scene = Scene_Save.new
  end
  #--------------------------------------------------------------------------
  # * Debug Call
  #--------------------------------------------------------------------------
  def call_debug
    # Clear debug call flag
    $game_temp.debug_calling = false
    # Play decision SE
    $game_system.se_play($data_system.decision_se)
    # Straighten player position
    $game_player.straighten
    # Switch to debug screen
    $scene = Scene_Debug.new
  end
  #--------------------------------------------------------------------------
  # * Player Place Move
  #--------------------------------------------------------------------------
  def transfer_player
    # Clear player place move call flag
    $game_temp.player_transferring = false
    # If move destination is different than current map
    if $game_map.map_id != $game_temp.player_new_map_id
      # Set up a new map
      $game_map.setup($game_temp.player_new_map_id)
    end
    # Set up player position
    $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
    # Set player direction
    case $game_temp.player_new_direction
    when 2  # down
      $game_player.turn_down
    when 4  # left
      $game_player.turn_left
    when 6  # right
      $game_player.turn_right
    when 8  # up
      $game_player.turn_up
    end
    # Straighten player position
    $game_player.straighten
    # Update map (run parallel process event)
    $game_map.update
    # Remake sprite set
    @spriteset.dispose
    @spriteset = Spriteset_Map.new
    # If processing transition
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      Graphics.transition(20)
    end
    # Run automatic change for BGM and BGS set on the map
    $game_map.autoplay
    # Frame reset
    Graphics.frame_reset
    # Update input information
    Input.update
  end
end

^this is what I'm working with towards a "glowing text" script.


edit: (new script version in original post)
as for calling the font shadow script in game:

Code:
$fs_color= X

X = 1 through 11 (just like in the options) ^,^
Administrator
Show Signature
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 https://www.youtube.com/user/MrGameface101?feature=watch
||||||||||
||||||||||
#6 RMXP/RMVX Font Shadow Empty Re: RMXP/RMVX Font Shadow
Loading

supercow

supercow
||||||||||
||||||||||
profile
nice i can change it in game now ,thx Razz
||||||||||
Show Signature
||||||||||
Administrator
Administrator
#7 RMXP/RMVX Font Shadow Empty Re: RMXP/RMVX Font Shadow
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
@supercow - ^,^

@LiTTleDRAgo - here's a much simpler example for "glowing text"
on the Scene_Map

Code:
#==============================================================================
# ■ Glowing Text on Scene Map example by g@Mef@Ce www.gameface101.com
#==============================================================================
# to be used with Font Shadow script #
#====================================
#
module G101_GT

#window
X= 0 # horizontal position
Y = 0# verticle position
W = 300# width
H = 140# height
O = 0# opacity

#glowing text
TEXT1 = "g@Mef@Ce"
TEXT2 = "glowing text"
TEXT3 = "example"
#end of module
end
#==============================================================================
# ■ New Class under Window_Base
#==============================================================================
class Glow_Text < Window_Base
#refer to module
  include G101_GT
#==============================================================================
# ■ Initialize
#==============================================================================
  def initialize
      #create window
      super(X,Y,W,H)
      #create contents
      self.contents = Bitmap.new(width - 32, height - 32)
      #windowskin
      self.opacity = O
      #run refresh method
      refresh
      #end initialize method
    end
#==============================================================================
# ■ Refresh
#==============================================================================
  def refresh
    #clear to start with clean slate
    self.contents.clear
    # text 1
    self.contents.draw_text(x, y, 120, 32, TEXT1)
    # text 2
    self.contents.draw_text(x, y, 120, 80, TEXT2)
    # text 3
    self.contents.draw_text(x, y, 120, 128, TEXT3)
    #clear if scene menu
    if $scene.is_a?(Scene_Menu)
      self.contents.clear
    end
    #clear if battle scene
    if $scene.is_a?(Scene_Battle)
      self.contents.clear
      self.visible = false
    end
    #end refresh definition
  end
  #end Glow_text class
end

#==============================================================================
# ■ Scene Map
#==============================================================================
class Scene_Map
  alias gt_main main
#==============================================================================
# ■ Main
#==============================================================================
  def main
    @Gt = Glow_Text.new
    gt_main
    @Gt.dispose
  end
#==============================================================================
# ■ Update
#==============================================================================
  alias gt_update update
  def update
    gt_update
    @Gt.update
    @Gt.refresh
  end
end
Administrator
Show Signature
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 https://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#8 RMXP/RMVX Font Shadow Empty Re: RMXP/RMVX Font Shadow
Loading

LiTTleDRAgo

LiTTleDRAgo
Active Member
Active Member
Active Member
profile
@gameface
it's great but, everything that use draw_text is affected

That make menu and message system become weird

also, the glowing effects its really use a lot of memory + laggy
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Administrator
Administrator
#9 RMXP/RMVX Font Shadow Empty Re: RMXP/RMVX Font Shadow
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
^yeah draw_text is a resource hog, especially when you have to update
every frame to get that glowing effect.

just like controlling the color case through a global variable,
I'll add another to clear...




Administrator
Show Signature
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 https://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#10 RMXP/RMVX Font Shadow Empty Re: RMXP/RMVX Font Shadow
Loading

LiTTleDRAgo

LiTTleDRAgo
Active Member
Active Member
Active Member
profile
how about make something like

RMXP/RMVX Font Shadow Glowql

like your website
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com

Sponsored content

profile

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

Go to page : 1, 2  Next

 

Chatbox system disabled
Personal messaging disabled