Hay.
I edit this script a bit and now it'S working.
#==============================================================================
# ** [STR14] Sidetext (von star) (Version 0.7)
#------------------------------------------------------------------------------
# Ermöglicht zusätzlichen Text an der linken Seite anzuzeigen.
#==============================================================================
if false
# Das folgenden wird in ein Call Skript geschrieben
s = $game_temp.sidetext
i = s.index(nil)
i = s.size if (i == nil)
t = "Sidetext" # Text, der angezeigt werden soll
f = true # Buchstaben haben Rand? (aus = false)
w = 120 # Anzeigedauer (in Frames)
c = Color.new(64,32,128) # Farbe des Randes (rot, grün, blau)
ii = -1 # Iconid if -1 no icon
s[i] = Sprite_Sidetext.new(t,f,w,c,ii)
#
end
#==============================================================================
# ? Sprite_Sidetext
#==============================================================================
class Sprite_Sidetext < Sprite
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
def initialize(text, frame = false, wait = 120, c = Color.new(64,32,128),icon_id = -1)
super()
self.x = 16
num = $game_temp.sidetext.index(nil)
num = $game_temp.sidetext.size if (num == nil)
y = 80 + (num * 24)
self.y = y
self.z = 200
bitmap = Bitmap.new(32, 24)
w = bitmap.text_size(text).width
w = icon_id < 0 ? w : w + 28
xc = w - bitmap.text_size(text).width
bitmap.dispose
bitmap = Bitmap.new(w, 24)
if frame
bitmap.draw_text_f(xc, 0, w, 24, text, 0, c)
else
bitmap.font.color = c
bitmap.draw_text(xc, 0, w, 24, text)
end
iconset = Cache.system("Iconset")
rect = Rect.new(icon_id % 16 * 24, icon_id / 16 * 24, 24, 24)
bitmap.blt(0,0,iconset,rect)
self.bitmap = bitmap
self.opacity = 0
@wait = wait
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
if @wait > 0
self.opacity += 24
return if self.opacity != 255
@wait -= 1
else
self.x += 4
self.opacity -= 8
dispose if self.opacity == 0
end
end
end
#==============================================================================
# ? Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ? ??????????
#--------------------------------------------------------------------------
attr_accessor :sidetext
#--------------------------------------------------------------------------
# ? ?????????
#--------------------------------------------------------------------------
alias initialize_str14 initialize
def initialize
initialize_str14
@sidetext = []
end
end
#==============================================================================
# ? Spriteset_Map
#==============================================================================
class Spriteset_Map
#--------------------------------------------------------------------------
# ? S???????
#--------------------------------------------------------------------------
def create_sidetext
$game_temp.sidetext = []
end
#--------------------------------------------------------------------------
# ? S???????
#--------------------------------------------------------------------------
def dispose_sidetext
for i in 0...$game_temp.sidetext.size
$game_temp.sidetext[i].dispose if $game_temp.sidetext[i] != nil
end
$game_temp.sidetext = []
end
#--------------------------------------------------------------------------
# ? S???????
#--------------------------------------------------------------------------
def update_sidetext
for i in 0...$game_temp.sidetext.size
if $game_temp.sidetext[i] != nil
$game_temp.sidetext[i].update
if $game_temp.sidetext[i].disposed?
$game_temp.sidetext[i] = nil
end
end
end
end
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
alias create_parallax_str14 create_parallax
def create_parallax
create_parallax_str14
create_sidetext
end
alias dispose_str14 dispose
def dispose
dispose_sidetext
dispose_str14
end
alias update_str14 update
def update
update_str14
update_sidetext
end
end
#==============================================================================
# ? Spriteset_Battle
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# ? S???????
#--------------------------------------------------------------------------
def create_sidetext
$game_temp.sidetext = []
end
#--------------------------------------------------------------------------
# ? S???????
#--------------------------------------------------------------------------
def dispose_sidetext
for i in 0...$game_temp.sidetext.size
$game_temp.sidetext[i].dispose if $game_temp.sidetext[i] != nil
end
$game_temp.sidetext = []
end
#--------------------------------------------------------------------------
# ? S???????
#--------------------------------------------------------------------------
def update_sidetext
for i in 0...$game_temp.sidetext.size
if $game_temp.sidetext[i] != nil
$game_temp.sidetext[i].update
if $game_temp.sidetext[i].disposed?
$game_temp.sidetext[i] = nil
end
end
end
end
#--------------------------------------------------------------------------
# ? ?????
#--------------------------------------------------------------------------
alias create_battleback_str14 create_battleback
def create_battleback
create_battleback_str14
create_sidetext
end
alias dispose_str14 dispose
def dispose
dispose_sidetext
dispose_str14
end
alias update_str14 update
def update
update_str14
update_sidetext
end
end
#==============================================================================
# ? Bitmap
#==============================================================================
class Bitmap
#--------------------------------------------------------------------------
# ? ???????
#--------------------------------------------------------------------------
def draw_text_f(x, y, width, height, str, align = 0, color = Color.new(64,32,128))
shadow = self.font.shadow
b_color = self.font.color.dup
font.shadow = false
font.color = color
draw_text(x + 1, y, width, height, str, align)
draw_text(x - 1, y, width, height, str, align)
draw_text(x, y + 1, width, height, str, align)
draw_text(x, y - 1, width, height, str, align)
font.color = b_color
draw_text(x, y, width, height, str, align)
font.shadow = shadow
end
def draw_text_f_rect(r, str, align = 0, color = Color.new(64,32,128))
draw_text_f(r.x, r.y, r.width, r.height, str, align = 0, color)
end
end
The new CallScript is:
s = $game_temp.sidetext
i = s.index(nil)
i = s.size if (i == nil)
t = "Sidetext" # Text, der angezeigt werden soll
f = true # Buchstaben haben Rand? (aus = false)
w = 120 # Anzeigedauer (in Frames)
c = Color.new(64,32,128) # Farbe des Randes (rot, grün, blau)
ii = -1 # Iconid if -1 no icon
s
= Sprite_Sidetext.new(t,f,w,c,ii)
As you mabye can see, ii was added to the callscript. ii means icon_id and if it is lower then 0 no icon will be drawn.
Deity