Show text in a special way

Udlice

Veteran
Veteran
Joined
Aug 16, 2014
Messages
54
Reaction score
11
First Language
French
Primarily Uses
Hi,

First, thanks for taking the time to read this.

I would like to be able to show text in the "background" of my maps. A good example of what I want to do is the game Nihilumbra.

Nihilumbra.png

This is a screenshot of Nihilumbra..

There is two big differences between this way to show text and how RPG maker do it :

-There is no "wait" that stop the player from moving while the text is displayed.

-And the text stick to the background (like events or tiles do) and not to the screen (like normal text in RPG maker and pictures do).

This is the effect I want to have. Is there a script out there that can do this ?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
1,483
Reaction score
988
First Language
English
Primarily Uses
As long as you create a bitmap object that covers the whole screen, you can use the draw_text method to draw text anywhere you like.
 

Udlice

Veteran
Veteran
Joined
Aug 16, 2014
Messages
54
Reaction score
11
First Language
French
Primarily Uses
Thanks for the quick reply.

I know it is possible to do this with pictures but there are Two problems :

-It requires A LOT of pictures if I want to show text this way often in the game.

-If I want to correct something, to change the text, or to translate the whole game, I need to change the pictures themselves and it's a hudge pain.

That's why I asked for a script.

But thanks for the help.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
39,141
Reaction score
12,416
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
965
Reaction score
709
First Language
English
Primarily Uses
RMMV
Hmm, well, I do have a script you might be interested in. I really have not spent too much time on it, so it is un-optimized and possibly a bit wonky. But, it will certainly do what you are wanting.

Code:
#==============================================================================# ** Cache#------------------------------------------------------------------------------#  This module loads graphics, creates bitmap objects, and retains them.# To speed up load times and conserve memory, this module holds the# created bitmap object in the internal hash, allowing the program to# return preexisting objects when the same bitmap is requested again.#==============================================================================module Cache    #--------------------------------------------------------------------------  # * ALIAS - Load Bitmap  #--------------------------------------------------------------------------  unless method_defined?(:bit_text_6Lg5dvTN_cache_load_bitmap)    class << self  	  alias :bit_text_6Lg5dvTN_cache_load_bitmap :load_bitmap    end  end    def self.load_bitmap(folder_name, filename, hue = 0, *args, &block)        if filename.is_a?(Hash)      @cache ||= {}      text_bitmap(filename)    else      bit_text_6Lg5dvTN_cache_load_bitmap(folder_name, filename, hue = 0, *args, &block)    end  end    #--------------------------------------------------------------------------  # * NEW - Create/Get Text Bitmap  #--------------------------------------------------------------------------  def self.text_bitmap(data)      unless include?(data[:name])      font = Font.new            data[:font].each_pair { |key, value|         if font.respond_to?("#{key}=")          font.send("#{key}=", value)        end      }            f_bitmap      = Bitmap.new(1,1)      f_bitmap.font = font      f_rect        = f_bitmap.text_size(data[:text])            bitmap        = Bitmap.new(f_rect.width, f_rect.height + (f_rect.height / 2))      bitmap.font   = font            bitmap.draw_text(0, 0, f_rect.width, f_rect.height + (f_rect.height / 2), data[:text], 1)      @cache[data[:name]] = bitmap unless include?(data[:name])      return @cache[data[:name]]    else      return @cache[data[:name]]    end      end  end # Cache
To call the script, use the following in either a 'script' event command or elsewhere.
Code:
#           :name, <font_name>, :size, <font_size>, :color, <font_color>,#           :bold, <boolean>, :outline, <boolean>, out_color, <outline_color>  font = Hash[:name, "Verdana", :size, 28, :color, Color.new(148,148,148,150),            :bold, true, :outline, true, :out_color, Color.new(64,64,64,150)]#           :name, <picture_name>, :text, <picture_text>, :font, <font_hash>data = Hash[:name, "TextImage", :text, "Blah Blah Blah!", :font, font ]#                    [picID] data_hash, origin, x, y, zoom_x, zoom_y, opacity, blend_type$game_map.screen.pictures[2].show(data, 0, 393, 122, 100.0, 100.0, 255, 0) 
In the above example, a new picture with an ID of 2 is created with the image data being text. You can then move the picture around, fade it out, and so on. You can use this in conjunction with Modern Algebra's 'Fix Picture to Map', or other similar scripts to pin the image in place and/or change its z-value.
 

Udlice

Veteran
Veteran
Joined
Aug 16, 2014
Messages
54
Reaction score
11
First Language
French
Primarily Uses
Look perfect to me.

Thanks a lot @Hexhydra !!

 
 

ZirconStorms

VX & VX Ace Scripts
Veteran
Joined
Dec 22, 2014
Messages
359
Reaction score
113
First Language
English
Primarily Uses
RMVXA
Fixed code. (Untested)
Code:
#==============================================================================
# ** Bitmap text
# Author: Ossra (formerly Exhydra)
# Site: https://forums.rpgmakerweb.com/index.php?members/ossra.19410/
# Original link: https://forums.rpgmakerweb.com/index.php?threads/show-text-in-a-special-way.40599/
#==============================================================================
# data = Hash[:name, "TextImage", :text, "Blah Blah Blah!", :font, font ]
# [picID] data_hash, origin, x, y, zoom_x, zoom_y, opacity, blend_type
# $game_map.screen.pictures[2].show(data, 0, 393, 122, 100.0, 100.0, 255, 0)
#==============================================================================
module Cache  
#--------------------------------------------------------------------------
 # * ALIAS - Load Bitmap
 #--------------------------------------------------------------------------
 unless method_defined?(:bit_text_6Lg5dvTN_cache_load_bitmap)  
   class << self      
     alias :bit_text_6Lg5dvTN_cache_load_bitmap :load_bitmap
   end
 end  
 def self.load_bitmap(folder_name, filename, hue = 0, *args, &block)      
   if filename.is_a?(Hash)    
     @cache ||= {}    
     text_bitmap(filename)  
   else    
     bit_text_6Lg5dvTN_cache_load_bitmap(folder_name, filename, hue = 0, *args, &block)  
   end
 end
 #--------------------------------------------------------------------------
 # * NEW - Create/Get Text Bitmap
 #--------------------------------------------------------------------------
 def self.text_bitmap(data)  
   unless include?(data[:name])  
     font = Font.new      
     data[:font].each_pair { |key, value|    
     if font.respond_to?("#{key}=")    
       font.send("#{key}=", value)    
     end    
     }    
     f_bitmap      = Bitmap.new(1,1)  
     f_bitmap.font = font
     f_rect        = f_bitmap.text_size(data[:text])  
     bitmap        = Bitmap.new(f_rect.width, f_rect.height + (f_rect.height / 2))
     bitmap.font   = font
     bitmap.draw_text(0, 0, f_rect.width, f_rect.height + (f_rect.height / 2), data[:text], 1)  
     @cache[data[:name]] = bitmap unless include?(data[:name])    
     return @cache[data[:name]]
   else  
     return @cache[data[:name]]  
   end    
 end
 end # Cache
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

The video of a psycho chasing people on the streets with a sword before getting subdued is wild. Apparent screenshots of his Twitter feed before it went private reveal a dangerous delusional mindset. I heard there was a bow person too. The crazies are really coming out of the woodworks.
Stream will be live shortly with some Witcher 3, followed by a session of the Interactive Text Adventure! Feel free to drop by!
Managed to find a way to hang a bed cover over my window. So no more being toasted alive in the afternoon!:kaoswt2:
So, uh, has anyone tried buying any resources from KokoroReflections? Because I've been looking for a 'buy' button on the site for like 10 minutes now and can't find one.
Any also thought it's too cringy to put the word "and you" in your credit as a special thanks?
Cause that's what I thought...

Forum statistics

Threads
97,993
Messages
948,401
Members
129,255
Latest member
RPGLordLight
Top