How do I make text appear in the corner temporarily and then fade out?

Necrpotato

Villager
Member
Joined
Jun 12, 2020
Messages
17
Reaction score
2
First Language
English
Primarily Uses
RMVXA
Pretty self-explanatory. I want text to appear in the left upper corner and then disappear after a couple of seconds, just like the display name of a map.
 

Thefirelion

TheFireLion Game Studio
Veteran
Joined
Mar 25, 2017
Messages
147
Reaction score
46
First Language
Spanish
Primarily Uses
RMVXA
Create an picture of the text in question and through the event commands: show, move (to manipulate the transparency) and erase picture you can do it. I personally think that doing this through a script is not worth it.
 

Necrpotato

Villager
Member
Joined
Jun 12, 2020
Messages
17
Reaction score
2
First Language
English
Primarily Uses
RMVXA
Create an picture of the text in question and through the event commands: show, move (to manipulate the transparency) and erase picture you can do it. I personally think that doing this through a script is not worth it.
Yeah, I thought it would be something like that. Thanks. :wink:
 

BluSoulFyre

Villager
Member
Joined
Apr 22, 2016
Messages
14
Reaction score
0
First Language
English
Primarily Uses
RMVXA
You can do that through pictures yes, but if you would like the convenience of scripts may I point you to TheoAllen's Notifs script. It's a little thing you throw in below materials and above main, all you have to do is use a script call.


Ruby:
#==============================================================================
# TheoAllen - Notification Window
# Version : 1.0
# Language : English
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Contact :
#------------------------------------------------------------------------------
# *> http://www.rpgmakervxace.net
# *> http://www.theolized.com
#==============================================================================
($imported ||= {})[:Theo_NotifWindow] = true
#==============================================================================
# Change Logs:
# -----------------------------------------------------------------------------
# 2015.02.09 - Translated to english + import the basic module
# 2013.09.22 - Finished
#==============================================================================
=begin

  ==================
  || Introduction ||
  ------------------
  This script give you an alternative to display a notification instead of
  showed up using show text. Notification will be displayed on the top-left
  corner with typing effect
 
  ======================
  || How to use ||
  ----------------------
  Put this script below material but above main
 
  To show notification, use this script call
  add_notif("Your notification text")
 
  ===================
  || Terms of use ||
  -------------------
  Credit me, TheoAllen. You are free to edit this script by your own. As long
  as you don't claim it yours. For commercial purpose, don't forget to give me
  a free copy of the game.

=end
#==============================================================================
# Configurations
#==============================================================================
module Theo
  module Notif
  #=============================================#
  # Timing (where 60 frame equal as 1 second) ~ #
  #=============================================#
    StartFadein = 15  # Frame required to show the notification window
    DelayTime   = 180 # Time wait before the next notification
    EndFadeout  = 15  # Frame required to hide the notification
    
  #=============================================#
  # Window color in (red, green, blue, alpha) ~ #
  #=============================================#
    ColorStart  = Color.new(0,0,0,180) # From left
    ColorEnd    = Color.new(0,0,0,50)  # To right
    
  #=============================================#
  # Position (smaller value means get on top) ~ #
  #=============================================#
    XPosition   = -6
    
  end
end
#==============================================================================
# Do not touch pass this line
#==============================================================================

#------------------------------------------------------------------------------
# Importing fuction from basic module because people hate to include scripter's
# basic module :v
#------------------------------------------------------------------------------

module THEO
  module FADE
    # Default duration of fading
    DEFAULT_DURATION = 60
    # -------------------------------------------------------------------------
    # *) Init core fade instance variables
    # -------------------------------------------------------------------------
    def init_fade_members
      @obj = nil
      @target_opacity = -1
      @fade_speed = 0.0
      @pseudo_opacity = 0
    end
    # -------------------------------------------------------------------------
    # *) Set object
    # -------------------------------------------------------------------------
    def setfade_obj(obj)
      @obj = obj
      @pseudo_opacity = @obj.opacity
    end
    # -------------------------------------------------------------------------
    # *) Fade function
    # -------------------------------------------------------------------------
    def fade(opacity, duration = DEFAULT_DURATION)
      @target_opacity = opacity
      make_fade_speed(duration)
    end
    # -------------------------------------------------------------------------
    # *) Determine fade speed
    # -------------------------------------------------------------------------
    def make_fade_speed(duration)
      @fade_speed = (@target_opacity - @obj.opacity)/duration.to_f
      @pseudo_opacity = @obj.opacity.to_f
    end
    # -------------------------------------------------------------------------
    # *) Fadeout function
    # -------------------------------------------------------------------------
    def fadeout(duration = DEFAULT_DURATION)
      fade(0, duration)
    end
    # -------------------------------------------------------------------------
    # *) Fadein function
    # -------------------------------------------------------------------------
    def fadein(duration = DEFAULT_DURATION)
      fade(255, duration)
    end
    # -------------------------------------------------------------------------
    # *) Update fade
    # -------------------------------------------------------------------------
    def update_fade
      if fade?
        @pseudo_opacity += @fade_speed
        @obj.opacity = @pseudo_opacity
      else
        @target_opacity = -1
      end
    end
    # -------------------------------------------------------------------------
    # *) Is performing fade?
    # -------------------------------------------------------------------------
    def fade?
      return false if @target_opacity == -1
      @target_opacity != @pseudo_opacity.round
    end
    
  end
end

#------------------------------------------------------------------------------
# End of import
#------------------------------------------------------------------------------

class Game_Interpreter
 
  def add_notif(text)
    $game_temp.stack_notif << text
  end
 
end

class Game_Temp
  attr_reader :stack_notif
 
  alias theo_typenotif_init initialize
  def initialize
    theo_typenotif_init
    @stack_notif ||= []
  end
 
end

class Window_TypingNotif < Window_Base
  class Opacity_Fade
    attr_accessor :opacity
    include THEO::FADE
    
    def initialize
      @opacity = 0
      init_fade_members
      setfade_obj(self)
    end
  end
 
  Color1 = Theo::Notif::ColorStart
  Color2 = Theo::Notif::ColorEnd
 
  def initialize
    super(-12,Theo::Notif::XPosition,Graphics.width+24,fitting_height(1))
    @ref = Opacity_Fade.new
    refresh
    self.contents_opacity = @ref.opacity
    self.opacity = 0
  end
 
  def refresh
    contents.clear
    contents.gradient_fill_rect(contents.rect, Color1, Color2)
  end
 
  def update
    super
    @ref.update_fade
    self.contents_opacity = @ref.opacity
    if @fiber.nil? && !$game_temp.stack_notif.empty?
      @fiber = Fiber.new { update_notif_fiber }
    elsif @fiber
      @fiber.resume
    end
  end
 
  def update_notif_fiber
    refresh
    @ref.fadein(Theo::Notif::StartFadein)
    Fiber.yield while @ref.fade?
    loop do
      notif = $game_temp.stack_notif.shift
      refresh
      draw_text_ex(4 + 12,0,notif)
      Theo::Notif::DelayTime.times { Fiber.yield }
      break if $game_temp.stack_notif.empty?
    end
    @ref.fadeout(Theo::Notif::EndFadeout)
    Fiber.yield while @ref.fade?
    @fiber = nil
  end
 
  def process_character(*args)
    super(*args)
    Fiber.yield
  end
 
end


class Scene_Map
 
  alias theo_typenotif_start start
  def start
    theo_typenotif_start
    @notif_text = Window_TypingNotif.new
  end
 
end
 

Latest Threads

Latest Posts

Latest Profile Posts

I don't believe it. I actually did some proofreading in my game - and fixed some grammar errors! I feel so accomplished, knowing I can actually proofread my own writing!
...I've had a bad day, okay? Bad enough for me to want to proofread stuff. :yswt2:
Ughhh, July is not my month. Thankfully, it's nearly done.

I fixed the lips and noses for MZ! The files have been updated.
qQwgk8C.png

Everything below!
Ugh, I opened MV after a few weeks and I'm completely lost on what I was working on.
Does it happen to someone else or am I the only disorganized one around? :kaoswt:
xH5Fk2f.jpg
Today was not a really productive day, but at least i got some bust sketches going <3
E7QXZHNXoAIkpG8
hmm in exploring MZ with FOSSIL... I see I'll probably need to stick with MV for now as none of the menu altering plugins I use work on MZ lol. and I don't have the money to dump into what I would need in some cases to update plugins to their MZ versions. Everytime I think of converting, 5 or more reasons popup on why I shouldn't.

Forum statistics

Threads
113,665
Messages
1,076,530
Members
147,687
Latest member
sonderaway
Top