Jump to content
Rpg²S Forum

*Testo Scorrevole


Black_Dragon
 Share

Recommended Posts

Autore

Black_Dragon

Descrizione

Ciao a tutti.Posto ora questo semplice script che permette di visualizzare un testo scorrevole. Le istruzioni sono all'interno dello script/demo

Screen

http://img517.imageshack.us/img517/6915/testxv3.png

Script

 

#TESTO SCORREVOLE BY BLACK_DRAGON
#ISTRUZIONI:
#-creare la classe (@nome_var=Window_Tc.new(x,y))
#-x,yindica la posizione della finestre
#-per inserire il testo da visuallizzare
# chiamrare il metodo set_wind(testo,font_size)
# il parametro font_size è opzionale
#-la finestra si ridimensionerà automaticamente
#per fermare il testo settare l'attributo stop=true
#per far ripartire il testo stop=true
#Per domande, spiegazioni, consigli: black_dasa@hotmail.it
#Se usate questo script nel vostro gioco ditemelo pure!!!

class Window_Tc<Window_Base
	
	attr_accessor :text#testo da far scorrere
	attr_accessor :stop#movimento o no
	
	def initialize(x,y,z=0)
		super(x,y,0,0)
		self.z=z+100
		self.active=true
		self.visible=true
		self.opacity=128
		clear()
	end
	
	def update()
		if @stop==false && @text !=nil
			self.contents.clear()
			self.contents.font.color=normal_color
			self.contents.font.name="Arial"
			width=self.contents.width-8
			if @x<=-(self.width-64)
				@x=self.width-32
			else
				@x-=1
			end
			self.contents.draw_text(@x,0,width,32,@text)
		end
	end
	
	def set_wind(text,font_size=18)
		self.height=font_size*4
		self.width=text.size*font_size/2
		@text=text
		self.contents=Bitmap.new(self.width-32,self.height-32)
		self.contents.font.size=font_size
		@x=self.width-32
		@stop=false
	end
	
	def clear()
		@stop=true
		@text=nil
		@x=0
	end
end








EDIT di Marigno: Ho aggiustato il titolo. ^^

Testo_Scorrevole.rar

Edited by Flame

"Fight for honor, fight for your life. Pray to god that our side is right.

-Avenged sevenfold M.I.A.

 

http://mypsn.eu.playstation.com/psn/profile/Black_Serian.png

Link to comment
Share on other sites

Bhe con poche modifiche lo si adatta.

Era per dare una solida base per qualsiasi applicazione si voglia fare.

Ringrazio chi ha corretto il titolo

"Fight for honor, fight for your life. Pray to god that our side is right.

-Avenged sevenfold M.I.A.

 

http://mypsn.eu.playstation.com/psn/profile/Black_Serian.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...