Hi, I'm using this scroll text script to scroll my longer descriptions. However, this scrolls the text even if I put there like 2 or 3 words, and it gets annoying. What I ask for, is if someone could modify this, so I can assign a notetag (like lets say <scroll>) in items, spells, etc. If something has that notetag, then it will scroll the description text, otherwise no. OR if you know an other script which will do this, then please let me know.
# Original VX script by BigEd781
# Converted for VX Ace by Xypher
# Script is provided as is
class Window_Help < Window_Base
@@SCROLL_DELAY = 2 # seconds
@@SCROLL_SPEED = 1 # pixels / frame (60 frames / sec)
alias :scroll_init :initialize
def initialize(*args)
scroll_init(*args)
@internal_frame_count = 0
@text_is_long = false
self.windowskin = $game_system.window_skin_bitmap(self.class)
end
def get_altered_skin
default = Cache.system('Window')
window = Bitmap.new(default.width, default.height)
window.blt(0, 0, default, default.rect)
window.fill_rect(80, 16, 32, 32, Color.new(0,0,0,0))
return window
end
def set_text(text, align = 0)
unless (text == @text) && (align == @align)
@internal_frame_count = 0
txt_width = self.contents.text_size(text).width
@text_is_long = txt_width > (self.width - 32)
self.contents.dispose
w = @text_is_long ? (txt_width + self.width - 32) : self.width - 32
self.contents = Bitmap.new(w, self.height)
self.contents.clear
self.ox = 0
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, self.contents.width, fitting_height(1), text, align)
@text = text
@align = align
refresh
end
end
def update
super
@internal_frame_count += 1
if ((@internal_frame_count > @@SCROLL_DELAY * 60) && @text_is_long)
if self.ox >= (self.contents.width / 2 - self.width / 2)
self.ox = 0
@internal_frame_count = 0
else
self.ox += @@SCROLL_SPEED
end
end
end
end
# Converted for VX Ace by Xypher
# Script is provided as is
class Window_Help < Window_Base
@@SCROLL_DELAY = 2 # seconds
@@SCROLL_SPEED = 1 # pixels / frame (60 frames / sec)
alias :scroll_init :initialize
def initialize(*args)
scroll_init(*args)
@internal_frame_count = 0
@text_is_long = false
self.windowskin = $game_system.window_skin_bitmap(self.class)
end
def get_altered_skin
default = Cache.system('Window')
window = Bitmap.new(default.width, default.height)
window.blt(0, 0, default, default.rect)
window.fill_rect(80, 16, 32, 32, Color.new(0,0,0,0))
return window
end
def set_text(text, align = 0)
unless (text == @text) && (align == @align)
@internal_frame_count = 0
txt_width = self.contents.text_size(text).width
@text_is_long = txt_width > (self.width - 32)
self.contents.dispose
w = @text_is_long ? (txt_width + self.width - 32) : self.width - 32
self.contents = Bitmap.new(w, self.height)
self.contents.clear
self.ox = 0
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, self.contents.width, fitting_height(1), text, align)
@text = text
@align = align
refresh
end
end
def update
super
@internal_frame_count += 1
if ((@internal_frame_count > @@SCROLL_DELAY * 60) && @text_is_long)
if self.ox >= (self.contents.width / 2 - self.width / 2)
self.ox = 0
@internal_frame_count = 0
else
self.ox += @@SCROLL_SPEED
end
end
end
end