Help editing a script
#1
Hi people! I have a script that allows short messages to appear in the lower-right corner without pausing the game action, making the gameplay smoother. I decided to add an Icon to make it nicer, however, due to my lack of expertise in RGSS, the icon always appears and I want it to appear AND disappear along with the text, I think it's a very easy scripting but I do not know how to do it :v

The code:


Code:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#|Autor: RD12| Mensagens na Tela v1.5
#-------------------------------------------------------------------
#Chame o script: Msg_txt("Texto", cor) onde cor = red, blue..
#É opcional por a cor, se você não por, ficará branca.
#--------------------------------------------------------------------

module WIN_MSG
X = 373
Y = 0
L = 300#largura
Windowskin = "windowskin" #"001-blue01"
#Tempo em segundos para ir deletando as mensagens
Clear_Time = 7
end

#::Cores::
def red; return Color.new(255, 0, 0); end
def green; return Color.new(0, 255, 0); end
def blue; return Color.new(0, 0, 255); end
def black; return Color.new(0, 0, 0); end
def white; return Color.new(255, 255, 255); end

class Window_Msg < Window_Base

def initialize
super(WIN_MSG::X,WIN_MSG::Y,WIN_MSG::L,30*2)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 126
self.windowskin = RPG::Cache.windowskin(WIN_MSG::Windowskin)
color = Color.new(255, 255, 255)
$Msg_log = [["", color], ["", color], ["", color], ["", color]]
self.y = 420
Msg_txt("")
refresh
end

def refresh
self.contents.clear
self.contents.font.name = "Corbel"
self.contents.font.size = 15
#::Escrever as Mensagens::
bitmap = RPG::Cache.icon("info.png")
self.contents.blt(0, 0, bitmap, Rect.new(0, 0, 24, 24), 255)
self.contents.font.color = $Msg_log[$Msg_log.size-1][1]
self.contents.draw_text(40, 0, 310, 32, "#{$Msg_log[$Msg_log.size-1][0]}")
end

end

def Msg_txt(text, color=Color.new(255, 255, 255))
$Msg_log << [text, color]
end

class Scene_Map
alias me_main main
def main
@win_msg = Window_Msg.new
me_main
@win_msg.dispose
end
alias msg_update update
def update
msg_update
@win_msg.refresh
if Graphics.frame_count % (40*WIN_MSG::Clear_Time) == 0
Msg_txt("")
end
end
end

and an image:
[Image: obci.png]
I'm looking for a scripter to help me with my proyect. Need some minor adjustments-modifications and some larger codes. The larger ones will be remunerated :) Thanks beforehand.
Reply }


Messages In This Thread
Help editing a script - by Iqus - 12-25-2013, 04:31 PM
RE: Help editing a script - by MechanicalPen - 12-25-2013, 04:54 PM
RE: Help editing a script - by Iqus - 02-16-2014, 10:17 PM
RE: Help editing a script - by JayRay - 02-17-2014, 08:33 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
   Plugin or Script help with Item menu, SKill menu, and Equip menu JayRay 2 67 11-20-2024, 03:09 AM
Last Post: JayRay
   Script compatibility help Lord Vectra 3 4,605 07-25-2021, 11:42 PM
Last Post: DerVVulfman
   Adding face script on Cogwheel's RTAB Battle Status rekkatsu 15 15,854 08-25-2020, 03:09 AM
Last Post: DerVVulfman
   "Wait" in the script Whisper 13 16,172 04-28-2020, 04:06 PM
Last Post: Whisper
   Skill Cooldown script Fenriswolf 11 16,455 12-10-2019, 11:10 AM
Last Post: Fenriswolf
   Help iwth script (RGSS Player crash) Whisper 3 8,535 06-17-2017, 05:03 PM
Last Post: Whisper
   Help modifying a script Keeroh 7 10,222 06-11-2017, 04:43 PM
Last Post: DerVVulfman
Question  Mog Menu script: help me stop the crazy picture movement during transitions Zachariad 4 9,859 05-31-2017, 05:10 AM
Last Post: Zachariad
   Actor names in Quest Script jreagan406 5 8,644 03-07-2017, 08:06 AM
Last Post: JayRay
   Bizarre issue with Lanzer counter script. Steel Beast 6Beets 2 7,249 10-04-2016, 11:46 AM
Last Post: Steel Beast 6Beets



Users browsing this thread: 1 Guest(s)