Pomógł: 1 raz Dołączył: 21 Maj 2010 Posty: 236 Skąd: z nikąd
Wysłany: Sro 21 Lip, 2010 13:42
Skrypt na title'a w rogu ekranu
Witajcie dziś napisałem skrypt na nazwę title'a w rogu ekranu.
Oto on:
Spoiler:
Kod:
class Window_okno < Window_Base
def initialize(x = 7, y = 16, width = 320, height = 60)
super(x, y, width, height)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 18
self.back_opacity = 160
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0, 288, 32, "Nazwa titla", 1)
end
end
A teraz scene_map podmieniamy na to:
Spoiler:
Kod:
class Window_okno < Window_Base
def initialize(x = 7, y = 16, width = 320, height = 60)
super(x, y, width, height)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = "Tahoma"
self.contents.font.size = 18
self.back_opacity = 160
refresh
end
def refresh
self.contents.clear
self.contents.draw_text(0, 0, 288, 32, "Nazwa titla", 1)
end
end
class Scene_Map
def main
@spriteset = Spriteset_Map.new
@message_window = Window_Message.new
@okienko = Window_okno.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@message_window.dispose
@okienko.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
end
def update
loop do
$game_map.update
$game_system.map_interpreter.update
$game_player.update
$game_system.update
$game_screen.update
unless $game_temp.player_transferring
break
end
transfer_player
if $game_temp.transition_processing
break
end
end
@spriteset.update
@message_window.update
@okienko.refresh
if $game_temp.gameover
$scene = Scene_Gameover.new
return
end
if $game_temp.to_title
$scene = Scene_Title.new
return
end
if $game_temp.transition_processing
$game_temp.transition_processing = false
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
if $game_temp.message_window_showing
return
end
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
n = rand($game_map.encounter_list.size)
troop_id = $game_map.encounter_list[n]
if $data_troops[troop_id] != nil
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
if Input.trigger?(Input::B)
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
$game_temp.menu_calling = true
$game_temp.menu_beep = true
end
end
if $DEBUG and Input.press?(Input::F9)
$game_temp.debug_calling = true
end
unless $game_player.moving?
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end
def transfer_player
$game_temp.player_transferring = false
if $game_map.map_id != $game_temp.player_new_map_id
$game_map.setup($game_temp.player_new_map_id)
end
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
case $game_temp.player_new_direction
when 2
$game_player.turn_down
when 4
$game_player.turn_left
when 6
$game_player.turn_right
when 8
$game_player.turn_up
end
$game_player.straighten
$game_map.update
@spriteset.dispose
@spriteset = Spriteset_Map.new
if $game_temp.transition_processing
$game_temp.transition_processing = false
Graphics.transition(20)
end
$game_map.autoplay
Graphics.frame_reset
Input.update
end
end
________________________ 89% graczy uważa, że najważniejsza jest grafika.
Jeśli należysz do pozostałych 11% wklej to do swojego podpisu.
Cóż, ciekawy skrypt...nie wiem jednak czy będzie przydatny, można to w końcu zwyczajnie zrobić przy pomocy "Pokaż obrazek", tak żeby nie zablokować gracza >_>
Być może komuś się przyda.
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum